Split AI functionality

This commit is contained in:
deathbybandaid 2019-05-11 16:39:07 -04:00
parent b1cf70e043
commit 120dfec954
8 changed files with 104 additions and 64 deletions

View File

@ -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):

View 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)

View 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)

View 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)

View 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!")

View 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)

View 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)

View File

@ -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'