mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-11 06:00:59 -05:00
Split AI functionality
This commit is contained in:
parent
b1cf70e043
commit
120dfec954
@ -10,70 +10,6 @@ from sopel_modules.SpiceBot_SBTools import sopel_triggerargs, googlesearch, bot_
|
||||
from sopel_modules.SpiceBot_Events.System import bot_events_check
|
||||
|
||||
|
||||
@sopel.module.rule(r'(?i)(hi|hello|hey),? $nickname[ \t]*$')
|
||||
def bot_command_hello(bot, trigger):
|
||||
hello = spicemanip.main(['Hi', 'Hey', 'Hello'], "random")
|
||||
punctuation = spicemanip.main(['', '!', '?'], "random")
|
||||
bot.osd(hello + ' ' + trigger.nick + punctuation)
|
||||
|
||||
|
||||
@sopel.module.nickname_commands('hello', 'hi', 'hey')
|
||||
def bot_command_hello_b(bot, trigger):
|
||||
bot_command_hello(bot, trigger)
|
||||
|
||||
|
||||
@sopel.module.rule(r'(?i)(bye|goodbye|gtg|seeya|cya|ttyl|g2g|gnight|goodnight),? $nickname[ \t]*$')
|
||||
def bot_command_goodbye(bot, trigger):
|
||||
byemsg = spicemanip.main(['Bye', 'Goodbye', 'Seeya', 'Auf Wiedersehen', 'Au revoir', 'Ttyl'], "random")
|
||||
punctuation = spicemanip.main(['!', ''], "random")
|
||||
bot.say(byemsg + ' ' + trigger.nick + punctuation)
|
||||
|
||||
|
||||
@sopel.module.nickname_commands("bye", "goodbye", "gtg", "seeya", "cya", "ttyl", "g2g", "gnight", "goodnight")
|
||||
def bot_command_goodbye_b(bot, trigger):
|
||||
bot_command_goodbye(bot, trigger)
|
||||
|
||||
|
||||
@sopel.module.rule(r'(?i)(thank you|thanks),? $nickname[ \t]*$')
|
||||
def bot_command_thanks(bot, trigger):
|
||||
bot.reply("You're welcome.")
|
||||
|
||||
|
||||
@sopel.module.rule('$nickname thank you')
|
||||
def bot_command_thanks_b(bot, trigger):
|
||||
bot_command_thanks(bot, trigger)
|
||||
|
||||
|
||||
@sopel.module.nickname_commands('thanks')
|
||||
def bot_command_thanks_c(bot, trigger):
|
||||
bot_command_thanks(bot, trigger)
|
||||
|
||||
|
||||
@sopel.module.rule('$nickname!')
|
||||
def exclaim(bot, trigger):
|
||||
bot.say(trigger.nick + '!')
|
||||
|
||||
|
||||
@sopel.module.rule('$nickname\?')
|
||||
def imhere(bot, trigger):
|
||||
bot.say("I'm here, " + trigger.nick)
|
||||
|
||||
|
||||
@sopel.module.rule(r'(?i)(Fuck|Screw) (you|off),? $nickname[ \t]*$')
|
||||
def bot_command_srewyou(bot, trigger):
|
||||
bot.osd("Watch your mouth, " + trigger.nick + ", or I'll tell your mother!")
|
||||
|
||||
|
||||
@sopel.module.rule(r'(?i)(Damnit|Lazy)? $nickname[ \t]*$')
|
||||
def bot_command_damnlazy(bot, trigger):
|
||||
bot.osd("I do not tell you how to do your job, " + trigger.nick + "!!!")
|
||||
|
||||
|
||||
@sopel.module.rule('$nickname is lazy')
|
||||
def bot_command_damnlazy_b(bot, trigger):
|
||||
bot.osd("I do not tell you how to do your job, " + trigger.nick + "!!!")
|
||||
|
||||
|
||||
@sopel.module.nickname_commands('(.*)')
|
||||
def bot_command_nick(bot, trigger):
|
||||
|
||||
|
||||
15
sopel_modules/SpiceBot_AI/AI_Acknowledge.py
Normal file
15
sopel_modules/SpiceBot_AI/AI_Acknowledge.py
Normal file
@ -0,0 +1,15 @@
|
||||
# coding=utf-8
|
||||
|
||||
from __future__ import unicode_literals, absolute_import, division, print_function
|
||||
|
||||
import sopel.module
|
||||
|
||||
|
||||
@sopel.module.rule('$nickname!')
|
||||
def exclaim(bot, trigger):
|
||||
bot.say(trigger.nick + '!')
|
||||
|
||||
|
||||
@sopel.module.rule('$nickname\?')
|
||||
def imhere(bot, trigger):
|
||||
bot.say("I'm here, " + trigger.nick)
|
||||
19
sopel_modules/SpiceBot_AI/AI_Goodbye.py
Normal file
19
sopel_modules/SpiceBot_AI/AI_Goodbye.py
Normal file
@ -0,0 +1,19 @@
|
||||
# coding=utf-8
|
||||
|
||||
from __future__ import unicode_literals, absolute_import, division, print_function
|
||||
|
||||
import sopel.module
|
||||
|
||||
import spicemanip
|
||||
|
||||
|
||||
@sopel.module.rule(r'(?i)(bye|goodbye|gtg|seeya|cya|ttyl|g2g|gnight|goodnight),? $nickname[ \t]*$')
|
||||
def bot_command_goodbye(bot, trigger):
|
||||
byemsg = spicemanip.main(['Bye', 'Goodbye', 'Seeya', 'Auf Wiedersehen', 'Au revoir', 'Ttyl'], "random")
|
||||
punctuation = spicemanip.main(['!', ''], "random")
|
||||
bot.say(byemsg + ' ' + trigger.nick + punctuation)
|
||||
|
||||
|
||||
@sopel.module.nickname_commands("bye", "goodbye", "gtg", "seeya", "cya", "ttyl", "g2g", "gnight", "goodnight")
|
||||
def bot_command_goodbye_b(bot, trigger):
|
||||
bot_command_goodbye(bot, trigger)
|
||||
19
sopel_modules/SpiceBot_AI/AI_Hello.py
Normal file
19
sopel_modules/SpiceBot_AI/AI_Hello.py
Normal file
@ -0,0 +1,19 @@
|
||||
# coding=utf-8
|
||||
|
||||
from __future__ import unicode_literals, absolute_import, division, print_function
|
||||
|
||||
import sopel.module
|
||||
|
||||
import spicemanip
|
||||
|
||||
|
||||
@sopel.module.rule(r'(?i)(hi|hello|hey),? $nickname[ \t]*$')
|
||||
def bot_command_hello(bot, trigger):
|
||||
hello = spicemanip.main(['Hi', 'Hey', 'Hello'], "random")
|
||||
punctuation = spicemanip.main(['', '!', '?'], "random")
|
||||
bot.osd(hello + ' ' + trigger.nick + punctuation)
|
||||
|
||||
|
||||
@sopel.module.nickname_commands('hello', 'hi', 'hey')
|
||||
def bot_command_hello_b(bot, trigger):
|
||||
bot_command_hello(bot, trigger)
|
||||
10
sopel_modules/SpiceBot_AI/AI_InsultHandler.py
Normal file
10
sopel_modules/SpiceBot_AI/AI_InsultHandler.py
Normal file
@ -0,0 +1,10 @@
|
||||
# coding=utf-8
|
||||
|
||||
from __future__ import unicode_literals, absolute_import, division, print_function
|
||||
|
||||
import sopel.module
|
||||
|
||||
|
||||
@sopel.module.rule(r'(?i)(Fuck|Screw) (you|off),? $nickname[ \t]*$')
|
||||
def bot_command_srewyou(bot, trigger):
|
||||
bot.osd("Watch your mouth, " + trigger.nick + ", or I'll tell your mother!")
|
||||
15
sopel_modules/SpiceBot_AI/AI_Lazy.py
Normal file
15
sopel_modules/SpiceBot_AI/AI_Lazy.py
Normal file
@ -0,0 +1,15 @@
|
||||
# coding=utf-8
|
||||
|
||||
from __future__ import unicode_literals, absolute_import, division, print_function
|
||||
|
||||
import sopel.module
|
||||
|
||||
|
||||
@sopel.module.rule(r'(?i)(Damnit|Lazy)? $nickname[ \t]*$')
|
||||
def bot_command_damnlazy(bot, trigger):
|
||||
bot.osd("I do not tell you how to do your job, " + trigger.nick + "!!!")
|
||||
|
||||
|
||||
@sopel.module.rule('$nickname is lazy')
|
||||
def bot_command_damnlazy_b(bot, trigger):
|
||||
bot_command_damnlazy(bot, trigger)
|
||||
20
sopel_modules/SpiceBot_AI/AI_Thanks.py
Normal file
20
sopel_modules/SpiceBot_AI/AI_Thanks.py
Normal file
@ -0,0 +1,20 @@
|
||||
# coding=utf-8
|
||||
|
||||
from __future__ import unicode_literals, absolute_import, division, print_function
|
||||
|
||||
import sopel.module
|
||||
|
||||
|
||||
@sopel.module.rule(r'(?i)(thank you|thanks),? $nickname[ \t]*$')
|
||||
def bot_command_thanks(bot, trigger):
|
||||
bot.reply("You're welcome.")
|
||||
|
||||
|
||||
@sopel.module.rule('$nickname thank you')
|
||||
def bot_command_thanks_b(bot, trigger):
|
||||
bot_command_thanks(bot, trigger)
|
||||
|
||||
|
||||
@sopel.module.nickname_commands('thanks')
|
||||
def bot_command_thanks_c(bot, trigger):
|
||||
bot_command_thanks(bot, trigger)
|
||||
@ -2,6 +2,12 @@
|
||||
from __future__ import unicode_literals, absolute_import, division, print_function
|
||||
|
||||
from .AI import *
|
||||
from .AI_Hello import *
|
||||
from .AI_Goodbye import *
|
||||
from .AI_Thanks import *
|
||||
from .AI_Acknowledge import *
|
||||
from .AI_Lazy import *
|
||||
from .AI_InsultHandler import *
|
||||
|
||||
__author__ = 'Sam Zick'
|
||||
__email__ = 'sam@deathbybandaid.net'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user