jersey/lightning
5
40
Fork
You've already forked lightning
11

irc: setting bot mode (+B) might not work #220

Open
opened 2026年07月06日 04:38:05 +02:00 by jersey · 15 comments
see https://codeberg.org/jersey/lightning/issues/219#issuecomment-18643889

i set the config option setBot to true image (had to make it a string, wouldn't boot if it were simply a bool) and it doesn't appear to be setting the mode
image

i set the config option setBot to true ![image](/attachments/0c1a4c19-f46a-4e82-8dc6-ce1b7c11bfbe) (had to make it a string, wouldn't boot if it were simply a bool) and it doesn't appear to be setting the mode ![image](/attachments/028455a2-b1fa-4e98-b573-618e960644fa)
Author
Owner
Copy link

what do your logs say?

what do your logs say?

@jersey wrote in #220 (comment):

what do your logs say?

image
nothing much really

@jersey wrote in https://codeberg.org/jersey/lightning/issues/220#issuecomment-18647288: > what do your logs say? ![image](/attachments/61bd84d2-7783-468d-a852-28f10e48abd7) nothing much really

image
this is what it says when i set the config option as a bool rather than as a string

![image](/attachments/96aa10ce-f419-4ce9-8f67-44ed74b3b247) this is what it says when i set the config option as a bool rather than as a string
Contributor
Copy link

@RandomHuman the option is called set_bot, not setBot

bot,_:=strconv.ParseBool(cfg["set_bot"])
@RandomHuman the option is called `set_bot`, not `setBot` ```go bot, _ := strconv.ParseBool(cfg["set_bot"]) ```

@user0-07161 wrote in #220 (comment):

@RandomHuman the option is called set_bot, not setBot

bot,_:=strconv.ParseBool(cfg["set_bot"])

that would probably be me reading client.go rather than the little comment bit for what the config options are, testing this now

@user0-07161 wrote in https://codeberg.org/jersey/lightning/issues/220#issuecomment-18667073: > @RandomHuman the option is called `set_bot`, not `setBot` > > ```go > bot, _ := strconv.ParseBool(cfg["set_bot"]) > ``` that would probably be me reading client.go rather than the little comment bit for what the config options are, testing this now

same behaviour as when i was using the wrong config option

same behaviour as when i was using the wrong config option
Author
Owner
Copy link

it appears to work for me locally with the following config (using a local instance of ergo as an IRCd):

[[plugins]]
type = "irc"
name = "ergo"
config.server = "ergo.localhost:6667"
config.tls = "false"
config.set_bot = "true"
config.nick = "lightning"
config.timeout = "2"

here're logs from lightning

☁ ~/Documents/lightning (mautrix-fork) go run ./cmd/lightning/
14:58:19 main.go:48: bridge: bot started
14:58:19 plugin.go:58: irc: connecting to ergo.localhost:6667
14:58:19 plugin.go:64: irc: connected to ergo.localhost:6667
14:58:19 client.go:216: irc: ready, welcome message: "Welcome to the ErgoTest IRC Network lightning"

and ergo

2026年07月06日T18:57:56.988Z : info : server : ergo-2.19.0-unreleased starting
2026年07月06日T18:57:56.988Z : warn : server : You are currently running an unreleased beta version of Ergo that may be unstable and could corrupt your database.
If you are running a production network, please download the latest build from https://ergo.chat/about and run that instead.
2026年07月06日T18:57:56.988Z : info : server : Using config file : ircd.yaml
2026年07月06日T18:57:56.988Z : info : server : Using datastore : ircd.db
2026年07月06日T18:57:56.988Z : info : server : Proxied IPs will be accepted from : localhost
2026年07月06日T18:57:56.988Z : info : listeners : now listening on 127.0.0.1:6667, tls=false, proxy=false, tor=false, websocket=false.
2026年07月06日T18:57:56.988Z : info : listeners : now listening on [::1]:6667, tls=false, proxy=false, tor=false, websocket=false.
2026年07月06日T18:57:56.988Z : info : listeners : now listening on :6697, tls=true, proxy=false, tor=false, websocket=false.
2026年07月06日T18:57:56.988Z : info : server : Server running
2026年07月06日T18:57:56.988Z : info : connect-ip : s00001 : Client connecting: real IP 127.0.0.1, proxied IP <nil>
2026年07月06日T18:57:56.988Z : info : connect : s00001 : Client connected [lightning] [u:~u] [r:lightning]
2026年07月06日T18:58:11.268Z : info : connect-ip : s00002 : Client connecting: real IP ::1, proxied IP <nil>
2026年07月06日T18:58:11.370Z : info : connect : s00002 : Client connected [jersey] [u:~u] [r:jersey]
2026年07月06日T18:58:12.875Z : info : opers : jersey : opered up as : admin
2026年07月06日T18:58:18.472Z : info : connect-ip : s00001 : Disconnecting session of lightning from 127.0.0.1
2026年07月06日T18:58:18.472Z : info : quit : lightning is no longer on the server
2026年07月06日T18:58:19.222Z : info : connect-ip : s00003 : Client connecting: real IP ::1, proxied IP <nil>
2026年07月06日T18:58:19.222Z : info : connect : s00003 : Client connected [lightning] [u:~u] [r:lightning]

the user list in halloy seems to show it working, and whois does as well

image

image

could you try the latest commit on develop again?

it appears to work for me locally with the following config (using a local instance of ergo as an IRCd): ```toml [[plugins]] type = "irc" name = "ergo" config.server = "ergo.localhost:6667" config.tls = "false" config.set_bot = "true" config.nick = "lightning" config.timeout = "2" ``` here're logs from lightning ``` ☁ ~/Documents/lightning (mautrix-fork) go run ./cmd/lightning/ 14:58:19 main.go:48: bridge: bot started 14:58:19 plugin.go:58: irc: connecting to ergo.localhost:6667 14:58:19 plugin.go:64: irc: connected to ergo.localhost:6667 14:58:19 client.go:216: irc: ready, welcome message: "Welcome to the ErgoTest IRC Network lightning" ``` and ergo ``` 2026年07月06日T18:57:56.988Z : info : server : ergo-2.19.0-unreleased starting 2026年07月06日T18:57:56.988Z : warn : server : You are currently running an unreleased beta version of Ergo that may be unstable and could corrupt your database. If you are running a production network, please download the latest build from https://ergo.chat/about and run that instead. 2026年07月06日T18:57:56.988Z : info : server : Using config file : ircd.yaml 2026年07月06日T18:57:56.988Z : info : server : Using datastore : ircd.db 2026年07月06日T18:57:56.988Z : info : server : Proxied IPs will be accepted from : localhost 2026年07月06日T18:57:56.988Z : info : listeners : now listening on 127.0.0.1:6667, tls=false, proxy=false, tor=false, websocket=false. 2026年07月06日T18:57:56.988Z : info : listeners : now listening on [::1]:6667, tls=false, proxy=false, tor=false, websocket=false. 2026年07月06日T18:57:56.988Z : info : listeners : now listening on :6697, tls=true, proxy=false, tor=false, websocket=false. 2026年07月06日T18:57:56.988Z : info : server : Server running 2026年07月06日T18:57:56.988Z : info : connect-ip : s00001 : Client connecting: real IP 127.0.0.1, proxied IP <nil> 2026年07月06日T18:57:56.988Z : info : connect : s00001 : Client connected [lightning] [u:~u] [r:lightning] 2026年07月06日T18:58:11.268Z : info : connect-ip : s00002 : Client connecting: real IP ::1, proxied IP <nil> 2026年07月06日T18:58:11.370Z : info : connect : s00002 : Client connected [jersey] [u:~u] [r:jersey] 2026年07月06日T18:58:12.875Z : info : opers : jersey : opered up as : admin 2026年07月06日T18:58:18.472Z : info : connect-ip : s00001 : Disconnecting session of lightning from 127.0.0.1 2026年07月06日T18:58:18.472Z : info : quit : lightning is no longer on the server 2026年07月06日T18:58:19.222Z : info : connect-ip : s00003 : Client connecting: real IP ::1, proxied IP <nil> 2026年07月06日T18:58:19.222Z : info : connect : s00003 : Client connected [lightning] [u:~u] [r:lightning] ``` the user list in halloy seems to show it working, and whois does as well ![image](/attachments/5153573d-693b-4dd0-be29-4c03af1be80e) ![image](/attachments/1b779eb5-ff17-49b4-a4d0-90ec3b6c7e86) could you try the latest commit on develop again?

still isn't working for me, using the latest commit built into a docker container with
docker buildx build . -f etc/containerfile --platform linux/amd64 --build-arg VERSION=custom --build-arg SOURCE_DATE_STR="$(date -u '+%Y-%m-%d %H:%M:%S')" -t custom-lightning --load

lightning config for IRC:
image

lightning logs
image

ergo logs
image

whois output
image

still isn't working for me, using the latest commit built into a docker container with `docker buildx build . -f etc/containerfile --platform linux/amd64 --build-arg VERSION=custom --build-arg SOURCE_DATE_STR="$(date -u '+%Y-%m-%d %H:%M:%S')" -t custom-lightning --load` lightning config for IRC: ![image](/attachments/36ea2505-7940-4a85-baab-0fcf1fa34eb6) lightning logs ![image](/attachments/22620246-e114-4a79-bc6e-2fbd18d6e1c0) ergo logs ![image](/attachments/5f6434bb-f791-4950-9128-707c14a05a07) whois output ![image](/attachments/dbd1ac15-74cc-4a2f-96f1-6a0e8778b8e7)
jersey changed title from (削除) set bot mode (+B) when connecting to an IRC network (削除ここまで) to irc: setting bot mode (+B) might not work 2026年07月08日 00:07:14 +02:00
Author
Owner
Copy link

@RandomHuman i'm not entirely sure why this would happen. can you try and add more logging to the IRC client in listen() to see what ergo is returning?

@RandomHuman i'm not entirely sure why this would happen. can you try and add more logging to the IRC client in [`listen()`](https://codeberg.org/jersey/lightning/src/commit/9cca7e5652b195f6e9aef14f571eaf5f9bf2b5e0/pkg/platforms/irc/client.go#L168) to see what ergo is returning?

@jersey wrote in #220 (comment):

@RandomHuman i'm not entirely sure why this would happen. can you try and add more logging to the IRC client in listen() to see what ergo is returning?

apologies, but i don't actually know how to do that, i am entirely unexperienced in Go (have literally never touched it), so i don't even know where i'd be starting for that

@jersey wrote in https://codeberg.org/jersey/lightning/issues/220#issuecomment-18767348: > @RandomHuman i'm not entirely sure why this would happen. can you try and add more logging to the IRC client in [`listen()`](https://codeberg.org/jersey/lightning/src/commit/9cca7e5652b195f6e9aef14f571eaf5f9bf2b5e0/pkg/platforms/irc/client.go#L168) to see what ergo is returning? apologies, but i don't actually know how to do that, i am entirely unexperienced in Go (have literally never touched it), so i don't even know where i'd be starting for that

i can turn on the debug logging in Ergo though

logs everything it sends to and gets from clients, might help

i *can* turn on the debug logging in Ergo though logs everything it sends to and gets from clients, might help

@RandomHuman wrote in #220 (comment):

i can turn on the debug logging in Ergo though

logs everything it sends to and gets from clients, might help

well, according to my Ergo logs, lightning isn't even trying to assign itself the +B mode

after setting the +i mode and getting the debug message, lightning and the server seem to simply not communicate further (this is without the bot actively in a channel)

if you want a photo of the logs i'll DM it, not attaching it here because of the sheer amount of stuff that gets logged while the debugging mode is on

@RandomHuman wrote in https://codeberg.org/jersey/lightning/issues/220#issuecomment-18775328: > i _can_ turn on the debug logging in Ergo though > > logs everything it sends to and gets from clients, might help well, according to my Ergo logs, lightning isn't even trying to assign itself the +B mode after setting the +i mode and getting the debug message, lightning and the server seem to simply not communicate further (this is without the bot actively in a channel) if you want a photo of the logs i'll DM it, not attaching it here because of the sheer amount of stuff that gets logged while the debugging mode is on
Author
Owner
Copy link

could you DM those logs? i'd be interested to see that

could you DM those logs? i'd be interested to see that
Author
Owner
Copy link

@RandomHuman could you try cdf614fae2 and seeing what logs there might relate to bot mode there?

@RandomHuman could you try cdf614fae29f0a4f5c5d2a4be55895e57caad9d1 and seeing what logs there might relate to bot mode there?
Sign in to join this conversation.
No Branch/Tag specified
develop
irc-debug-logging
fluxer-webhooks
mautrix-fork
pluralkit
xmpp
v0.8.9
v0.8.8
v0.8.7
v0.8.6
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.8.0-rc.12
v0.8.0-rc.11
v0.8.0-rc.10
v0.8.0-rc.9
v0.8.0-rc.8
v0.8.0-rc.7
v0.8.0-rc.6
v0.8.0-rc.5
v0.8.0-rc.4
v0.8.0-rc.3
v0.8.0-rc.2
v0.8.0-rc.1
v0.8.0-beta.13
v0.8.0-beta.12
v0.8.0-beta.11
v0.8.0-beta.10
v0.8.0-beta.9
v0.8.0-beta.8
v0.8.0-beta.7
v0.8.0-beta.6
v0.8.0-beta.5
v0.8.0-beta.4
v0.8.0-beta.3
v0.8.0-beta.2
v0.8.0-beta.1
v0.8.0-alpha.13
v0.8.0-alpha.12
v0.8.0-alpha.11
0.8.0-alpha.10
0.8.0-alpha.9
0.8.0-alpha.8
0.8.0-alpha.7
0.8.0-alpha.6
0.8.0-alpha.5
0.8.0-alpha.4
0.8.0-alpha.3
0.8.0-alpha.2
0.8.0-alpha.1
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.6.2a
0.6.2
0.6.1
0.6.0
0.5.8
0.5.7
0.5.6
0.5.5
0.4.13
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
Labels
Clear labels
scope
bolt
anything specific to the hosted product offered as bolt
scope
bridge
anything specific to the bridge application itself
scope
core
anything affecting the main framework
scope
discord
anything specific to the discord plugin
scope
epic
something which requires a large set of changes (new platforms, new types of things to bridge, etc.)
scope
irc
scope
matrix
anything specific to the matrix plugin
scope
osmium
scope
stoat
anything specific to the stoat plugin
scope
telegran
anything specific to the telegram plugin
status
blocked
this is blocked due to something else
status
deferred
status
question
further information is requested or a reproduction is needed
type
breaking
this would change something in a public api
type
bug
Something isn't working
type
build
the docker images and related scripts i think
type
dependencies
dependency-related things
type
documentation
Improvements or additions to documentation
type
enhancement
New feature or request
type
regression
a bug introduced by an update
Milestone
Clear milestone
No items
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jersey/lightning#220
Reference in a new issue
jersey/lightning
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?