mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-10 21:50:59 -05:00
update
This commit is contained in:
parent
ae6f0686da
commit
ea2341b65a
@ -12,7 +12,10 @@ import spicemanip
|
||||
@SpiceBot.prerun('nickname')
|
||||
@sopel.module.nickname_commands('ai')
|
||||
def ai_trigger(bot, trigger):
|
||||
bot.osd("I have the capability of responding to many requests, but I am not YET sentient.")
|
||||
availablecomsnum = SpiceBot.botai.dict['patterncounts']
|
||||
availablecomsfiles = SpiceBot.botai.dict['filecounts']
|
||||
displayval = "There are " + str(availablecomsnum) + " AI pattern matches available in " + str(availablecomsfiles) + " files."
|
||||
bot.osd(displayval)
|
||||
|
||||
|
||||
@sopel.module.rule('(.*)')
|
||||
|
||||
@ -23,8 +23,11 @@ def nickname_comand_channels(bot, trigger):
|
||||
trigger.sb['args'] = spicemanip.main(trigger.sb['args'], '2+', 'list')
|
||||
|
||||
if commandused == 'list':
|
||||
botcount = len(list(bot.channels.keys()))
|
||||
servercount = len(list(SpiceBot.channels.dict['list'].keys()))
|
||||
displayval = "I am in " + str(botcount) + " of " + str(servercount) + " channel(s) available on this server."
|
||||
chanlist = spicemanip.main(list(bot.channels.keys()), 'andlist')
|
||||
bot.osd("You can find me in " + chanlist)
|
||||
bot.osd([displayval, "You can find me in " + chanlist])
|
||||
return
|
||||
|
||||
elif commandused == 'total':
|
||||
|
||||
@ -24,6 +24,20 @@ def nickname_comand_commands(bot, trigger):
|
||||
else:
|
||||
commandused = spicemanip.main(trigger.sb['args'], 1).lower()
|
||||
|
||||
if commandused == 'list':
|
||||
availablecomsnum, availablecomsfiles = 0, []
|
||||
for commandstype in list(SpiceBot.commands.dict['commands'].keys()):
|
||||
availablecomsnum += len(list(SpiceBot.commands.dict['commands'][commandstype].keys()))
|
||||
for validcom in list(SpiceBot.commands.dict['commands'][commandstype].keys()):
|
||||
if "filepath" in list(SpiceBot.commands.dict['commands'][commandstype][validcom].keys()):
|
||||
filepath = SpiceBot.commands.dict['commands'][commandstype][validcom]["filepath"].lower()
|
||||
if filepath not in availablecomsfiles:
|
||||
availablecomsfiles.append(filepath)
|
||||
availablecomsfiles = len(availablecomsfiles)
|
||||
displayval = "There are " + str(availablecomsnum) + " commands available in " + str(availablecomsfiles) + " files."
|
||||
bot.osd(displayval)
|
||||
return
|
||||
|
||||
commands_list = []
|
||||
for commandstype in list(SpiceBot.commands.dict['commands'].keys()):
|
||||
if commandstype not in ['rule']:
|
||||
@ -34,14 +48,10 @@ def nickname_comand_commands(bot, trigger):
|
||||
else:
|
||||
commands_list.append(com)
|
||||
|
||||
if commandused == 'list':
|
||||
bot.osd(spicemanip.main(commands_list, 'andlist'), trigger.nick, 'NOTICE')
|
||||
return
|
||||
|
||||
elif commandused == 'total':
|
||||
if commandused == 'total':
|
||||
bot.osd("I have " + str(len(commands_list)) + " commands available.")
|
||||
return
|
||||
|
||||
elif commandused == 'random':
|
||||
if commandused == 'random':
|
||||
bot.osd(["Here's a random command for you:", spicemanip.main(commands_list, 'random')])
|
||||
return
|
||||
|
||||
Loading…
Reference in New Issue
Block a user