mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 15:09:54 -05:00
test
This commit is contained in:
parent
aa66676ee1
commit
6f124a4fbd
@ -60,7 +60,8 @@ class BotPrerun():
|
|||||||
if self.trigger_runstatus(bot, trigger):
|
if self.trigger_runstatus(bot, trigger):
|
||||||
function(bot, trigger, *args, **kwargs)
|
function(bot, trigger, *args, **kwargs)
|
||||||
else:
|
else:
|
||||||
self.trigger_hyphen_arg_handler(bot, trigger)
|
bot.say(trigger.sb["hyphen_arg"])
|
||||||
|
# self.trigger_hyphen_arg_handler(bot, trigger)
|
||||||
|
|
||||||
return internal_prerun
|
return internal_prerun
|
||||||
return actual_decorator
|
return actual_decorator
|
||||||
@ -115,46 +116,38 @@ class BotPrerun():
|
|||||||
bot.say(trigger.sb["com"] + " is a valid alias command for " + trigger.sb["realcom"])
|
bot.say(trigger.sb["com"] + " is a valid alias command for " + trigger.sb["realcom"])
|
||||||
else:
|
else:
|
||||||
bot.say(trigger.sb["com"] + " is a valid command")
|
bot.say(trigger.sb["com"] + " is a valid command")
|
||||||
trigger.sb["hyphen_arg"] = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
elif trigger.sb["hyphen_arg"] in ['enable']:
|
elif trigger.sb["hyphen_arg"] in ['enable']:
|
||||||
|
|
||||||
if not command_permissions_check(bot, trigger, ['admins', 'owner', 'OP', 'ADMIN', 'OWNER']):
|
if not command_permissions_check(bot, trigger, ['admins', 'owner', 'OP', 'ADMIN', 'OWNER']):
|
||||||
bot.say("I was unable to disable this command due to privilege issues.")
|
bot.say("I was unable to disable this command due to privilege issues.")
|
||||||
trigger.sb["hyphen_arg"] = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if trigger.is_privmsg:
|
if trigger.is_privmsg:
|
||||||
bot.notice("This command must be run in a channel you which to enable it in.", trigger.nick)
|
bot.notice("This command must be run in a channel you which to enable it in.", trigger.nick)
|
||||||
trigger.sb["hyphen_arg"] = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if not commands.check_disabled_commands(bot, trigger.sb["realcom"], trigger.sender):
|
if not commands.check_disabled_commands(bot, trigger.sb["realcom"], trigger.sender):
|
||||||
bot.notice(trigger.sb["com"] + " is already enabled in " + str(trigger.sender), trigger.nick)
|
bot.notice(trigger.sb["com"] + " is already enabled in " + str(trigger.sender), trigger.nick)
|
||||||
trigger.sb["hyphen_arg"] = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
commands.unset_command_disabled(bot, trigger.sb["realcom"], trigger.sender)
|
commands.unset_command_disabled(bot, trigger.sb["realcom"], trigger.sender)
|
||||||
bot.say(trigger.sb["com"] + " is now enabled in " + str(trigger.sender))
|
bot.say(trigger.sb["com"] + " is now enabled in " + str(trigger.sender))
|
||||||
trigger.sb["hyphen_arg"] = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
elif trigger.sb["hyphen_arg"] in ['disable']:
|
elif trigger.sb["hyphen_arg"] in ['disable']:
|
||||||
|
|
||||||
if not command_permissions_check(bot, trigger, ['admins', 'owner', 'OP', 'ADMIN', 'OWNER']):
|
if not command_permissions_check(bot, trigger, ['admins', 'owner', 'OP', 'ADMIN', 'OWNER']):
|
||||||
bot.say("I was unable to disable this command due to privilege issues.")
|
bot.say("I was unable to disable this command due to privilege issues.")
|
||||||
trigger.sb["hyphen_arg"] = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if trigger.is_privmsg:
|
if trigger.is_privmsg:
|
||||||
bot.notice("This command must be run in a channel you which to disable it in.", trigger.nick)
|
bot.notice("This command must be run in a channel you which to disable it in.", trigger.nick)
|
||||||
trigger.sb["hyphen_arg"] = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if commands.check_disabled_commands(bot, trigger.sb["realcom"], trigger.sender):
|
if commands.check_disabled_commands(bot, trigger.sb["realcom"], trigger.sender):
|
||||||
bot.notice(trigger.sb["com"] + " is already disabled in " + str(trigger.sender), trigger.nick)
|
bot.notice(trigger.sb["com"] + " is already disabled in " + str(trigger.sender), trigger.nick)
|
||||||
trigger.sb["hyphen_arg"] = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
trailingmessage = spicemanip.main(trigger.sb["args"], 0) or "No reason given."
|
trailingmessage = spicemanip.main(trigger.sb["args"], 0) or "No reason given."
|
||||||
@ -162,10 +155,8 @@ class BotPrerun():
|
|||||||
|
|
||||||
commands.set_command_disabled(bot, trigger.sb["realcom"], trigger.sender, timestamp, trailingmessage, trigger.nick)
|
commands.set_command_disabled(bot, trigger.sb["realcom"], trigger.sender, timestamp, trailingmessage, trigger.nick)
|
||||||
bot.say(trigger.sb["com"] + " is now disabled in " + str(trigger.sender))
|
bot.say(trigger.sb["com"] + " is now disabled in " + str(trigger.sender))
|
||||||
trigger.sb["hyphen_arg"] = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
trigger.sb["hyphen_arg"] = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def trigger_runstatus(self, bot, trigger):
|
def trigger_runstatus(self, bot, trigger):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user