mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-12 06:29:54 -05:00
update
This commit is contained in:
parent
ae6f0686da
commit
ea2341b65a
@ -12,7 +12,10 @@ import spicemanip
|
|||||||
@SpiceBot.prerun('nickname')
|
@SpiceBot.prerun('nickname')
|
||||||
@sopel.module.nickname_commands('ai')
|
@sopel.module.nickname_commands('ai')
|
||||||
def ai_trigger(bot, trigger):
|
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('(.*)')
|
@sopel.module.rule('(.*)')
|
||||||
|
|||||||
@ -23,8 +23,11 @@ def nickname_comand_channels(bot, trigger):
|
|||||||
trigger.sb['args'] = spicemanip.main(trigger.sb['args'], '2+', 'list')
|
trigger.sb['args'] = spicemanip.main(trigger.sb['args'], '2+', 'list')
|
||||||
|
|
||||||
if commandused == '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')
|
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
|
return
|
||||||
|
|
||||||
elif commandused == 'total':
|
elif commandused == 'total':
|
||||||
|
|||||||
@ -24,6 +24,20 @@ def nickname_comand_commands(bot, trigger):
|
|||||||
else:
|
else:
|
||||||
commandused = spicemanip.main(trigger.sb['args'], 1).lower()
|
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 = []
|
commands_list = []
|
||||||
for commandstype in list(SpiceBot.commands.dict['commands'].keys()):
|
for commandstype in list(SpiceBot.commands.dict['commands'].keys()):
|
||||||
if commandstype not in ['rule']:
|
if commandstype not in ['rule']:
|
||||||
@ -34,14 +48,10 @@ def nickname_comand_commands(bot, trigger):
|
|||||||
else:
|
else:
|
||||||
commands_list.append(com)
|
commands_list.append(com)
|
||||||
|
|
||||||
if commandused == 'list':
|
if commandused == 'total':
|
||||||
bot.osd(spicemanip.main(commands_list, 'andlist'), trigger.nick, 'NOTICE')
|
|
||||||
return
|
|
||||||
|
|
||||||
elif commandused == 'total':
|
|
||||||
bot.osd("I have " + str(len(commands_list)) + " commands available.")
|
bot.osd("I have " + str(len(commands_list)) + " commands available.")
|
||||||
return
|
return
|
||||||
|
|
||||||
elif commandused == 'random':
|
if commandused == 'random':
|
||||||
bot.osd(["Here's a random command for you:", spicemanip.main(commands_list, 'random')])
|
bot.osd(["Here's a random command for you:", spicemanip.main(commands_list, 'random')])
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user