mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-10 21:50:59 -05:00
Update Command structure
This commit is contained in:
parent
ef250cf636
commit
40babfc809
@ -18,8 +18,17 @@ def setup(bot):
|
||||
pass
|
||||
|
||||
|
||||
@sopel.module.nickname_commands('admins', 'owners', 'owner')
|
||||
def bot_command_hub(bot, trigger):
|
||||
@sopel.module.nickname_commands('owners', 'owner')
|
||||
def bot_command_owners(bot, trigger):
|
||||
bot_command_process(bot, trigger)
|
||||
|
||||
|
||||
@sopel.module.nickname_commands('admins')
|
||||
def bot_command_admins(bot, trigger):
|
||||
bot_command_process(bot, trigger)
|
||||
|
||||
|
||||
def bot_command_process(bot, trigger):
|
||||
triggerargs, triggercommand = sopel_triggerargs(bot, trigger, 'nickname_command')
|
||||
|
||||
if triggercommand == 'owner':
|
||||
|
||||
@ -18,8 +18,22 @@ def setup(bot):
|
||||
pass
|
||||
|
||||
|
||||
@sopel.module.nickname_commands('action', 'notice', 'privmsg')
|
||||
def bot_command_hub(bot, trigger):
|
||||
@sopel.module.nickname_commands('action')
|
||||
def bot_command_action(bot, trigger):
|
||||
bot_command_process(bot, trigger)
|
||||
|
||||
|
||||
@sopel.module.nickname_commands('notice')
|
||||
def bot_command_notice(bot, trigger):
|
||||
bot_command_process(bot, trigger)
|
||||
|
||||
|
||||
@sopel.module.nickname_commands('privmsg', 'say', 'msg')
|
||||
def bot_command_privmsg(bot, trigger):
|
||||
bot_command_process(bot, trigger)
|
||||
|
||||
|
||||
def bot_command_process(bot, trigger):
|
||||
|
||||
if not command_permissions_check(bot, trigger, ['admins', 'owner']):
|
||||
bot.say("I was unable to process this Bot Nick command due to privilege issues.")
|
||||
@ -27,6 +41,9 @@ def bot_command_hub(bot, trigger):
|
||||
|
||||
triggerargs, triggercommand = sopel_triggerargs(bot, trigger, 'nickname_command')
|
||||
|
||||
if triggercommand in ['say', 'msg']:
|
||||
triggercommand = 'privmsg'
|
||||
|
||||
if not len(triggerargs):
|
||||
bot.say("You must specify a channel or nick.")
|
||||
return
|
||||
|
||||
Loading…
Reference in New Issue
Block a user