Closed ixxie closed 5 years ago
Yeah, this is a problem i've been thinking about for a while. I think the solution might be to require mentioning the bot pinhook: !quit
that way it is very explicit without having to remember the command prefix.
Normally during the lifetime of a bot being used in a channel the prefix would seldom be changed so it would be easy to remember. Personally consistency across commands combined with the ability to change the prefix globally would be valuable, so I could deploy a pinhook bot to a channel which already has one.
Note how this helps when I want to deploy my bot to multiple channels where I want different prefixes:
bots = [
Bot(
channels=['#philosophy', '#nixos'],
nickname='seriousbot',
cmd_prefix='>'
server='irc.freenode.net'
),
Bot(
channels=['#discord', '#fnord'],
nickname='sillybot',
cmd_prefix='.',
server='discord.maddshark.com'
)
]
for bot in bots:
bot.start()
Okay, I can totally see and respect that. how does adding a cmd_prefix
and also for backwards compatibility making a use_prefix_for_plugins
that will default to False for the current version of pinhook?
That sounds like a great solution! Would you like me to make a PR or would you rather do it yourself?
If it's all the same, I am going to do this because it gives me the excuse to change some stuff in __init__
I have been putting off 😝
Less hassle for me ^^ thanks for responding so swiftly!
This is now fixed and added in pinhook v1.6.0!
If multiple pinhook bots sharing ops are in the same room, conflicts could arise if commands are shared. While plugin command prefixes are controlled by the user, the prefixes for the builtins
!join
,!help
,!reload
and most critically!quit
are hardcoded.Doing something like:
This would resolve this at least for the builtins, but I am not sure how you would like to handle plugin commands. Ideally, this prefix would be applied to them as well, but of course this change is not backwards compatible with existing plugins (which is why I didn't submit a PR).