Closed impredicative closed 1 year ago
Currently irc.nick
is updated whenever the bot changes nickname. If the bot can't get MyBot
, it will change to MyBot_
, and so on. The new nickname is (unfortunately) used if the bot reconnects to IRC.
I think the best fix would be to add a keepnick
argument to miniirc that makes miniirc store the original nickname and try and obtain the original nickname if it can't while connecting. I'll (hopefully) implement this soon.
miniirc store the original nickname and try and obtain the original nickname if it can't while connecting.
I personally think that this should always be the behavior. I can't think of a case when this wouldn't be wanted. As such, I am personally not in favor of a new keepnick
option.
I'm just worried about breaking something since I plan on making irc.nick
store the original nickname and irc.current_nick
store the current one when keepnick is enabled, though irc.current_nick
has existed as an alias since 2019 and any potential breakage would likely be minimal.
Something will break if the bot stays unconnected for a long time if it cannot get the correct nick. Perhaps versions <2.0 can have keepnick
, and versions >=2.0 can eliminate the option once it's known to be very stable.
Something will break if the bot stays unconnected for a long time if it cannot get the correct nick.
Good point. I've released miniirc v1.9.0 with a "keepnick" feature (without an option to disable it), please let me know if there are any bugs.
I've made irc.nick
emulate what it does in earlier versions, hopefully that will prevent anything from breaking.
If my bot's nick is say
MyBot
, then over time, its nick keeps getting changed toMyBot_
, then sometimesMyBot__
, and rarely evenMyBot___
, etc. I have tried to remedy this without reliable success. Canminiirc
be updated to prevent this or to reliably fix it when it happens? This is with v1.8.4 and Python 3.11. I think that the responsibility of ensuring that the bot always has the correct nick should be that ofminiirc
.