diff --git a/sopel_modules/SpiceBot_AI/AI.py b/sopel_modules/SpiceBot_AI/AI.py index eda930e..97adc03 100644 --- a/sopel_modules/SpiceBot_AI/AI.py +++ b/sopel_modules/SpiceBot_AI/AI.py @@ -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): diff --git a/sopel_modules/SpiceBot_AI/AI_Acknowledge.py b/sopel_modules/SpiceBot_AI/AI_Acknowledge.py new file mode 100644 index 0000000..e9e626e --- /dev/null +++ b/sopel_modules/SpiceBot_AI/AI_Acknowledge.py @@ -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) diff --git a/sopel_modules/SpiceBot_AI/AI_Goodbye.py b/sopel_modules/SpiceBot_AI/AI_Goodbye.py new file mode 100644 index 0000000..7f93bef --- /dev/null +++ b/sopel_modules/SpiceBot_AI/AI_Goodbye.py @@ -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) diff --git a/sopel_modules/SpiceBot_AI/AI_Hello.py b/sopel_modules/SpiceBot_AI/AI_Hello.py new file mode 100644 index 0000000..ee30964 --- /dev/null +++ b/sopel_modules/SpiceBot_AI/AI_Hello.py @@ -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) diff --git a/sopel_modules/SpiceBot_AI/AI_InsultHandler.py b/sopel_modules/SpiceBot_AI/AI_InsultHandler.py new file mode 100644 index 0000000..910dd7b --- /dev/null +++ b/sopel_modules/SpiceBot_AI/AI_InsultHandler.py @@ -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!") diff --git a/sopel_modules/SpiceBot_AI/AI_Lazy.py b/sopel_modules/SpiceBot_AI/AI_Lazy.py new file mode 100644 index 0000000..a3385a6 --- /dev/null +++ b/sopel_modules/SpiceBot_AI/AI_Lazy.py @@ -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) diff --git a/sopel_modules/SpiceBot_AI/AI_Love.py b/sopel_modules/SpiceBot_AI/AI_Love.py new file mode 100644 index 0000000..8674317 --- /dev/null +++ b/sopel_modules/SpiceBot_AI/AI_Love.py @@ -0,0 +1,40 @@ +# coding=utf-8 + +from __future__ import unicode_literals, absolute_import, division, print_function + +import sopel.module + + +@sopel.module.rule(r'(?i)(I love you|loveya),? $nickname[ \t]*$') +def bot_command_love(bot, trigger): + bot.reply("I love you too.") + + +@sopel.module.rule('$nickname (loveya|I love you)') +def bot_command_love_b(bot, trigger): + bot_command_love(bot, trigger) + + +@sopel.module.nickname_commands('loveya') +def bot_command_love_c(bot, trigger): + bot_command_love(bot, trigger) + + +@sopel.module.rule('(I love) $nickname') +def bot_command_love_d(bot, trigger): + bot_command_like(bot, trigger) + + +@sopel.module.rule(r'(?i)(I like you),? $nickname[ \t]*$') +def bot_command_like(bot, trigger): + bot.reply("I like you too.") + + +@sopel.module.rule('$nickname (I like you)') +def bot_command_like_b(bot, trigger): + bot_command_like(bot, trigger) + + +@sopel.module.rule('(I like) $nickname') +def bot_command_like_c(bot, trigger): + bot_command_like(bot, trigger) diff --git a/sopel_modules/SpiceBot_AI/AI_Ping.py b/sopel_modules/SpiceBot_AI/AI_Ping.py new file mode 100644 index 0000000..4931797 --- /dev/null +++ b/sopel_modules/SpiceBot_AI/AI_Ping.py @@ -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)(ping),? $nickname[ \t]*$') +def bot_command_ping(bot, trigger): + bot.say("Pong") + + +@sopel.module.nickname_commands('ping') +def bot_command_ping_b(bot, trigger): + bot_command_ping(bot, trigger) diff --git a/sopel_modules/SpiceBot_AI/AI_Thanks.py b/sopel_modules/SpiceBot_AI/AI_Thanks.py new file mode 100644 index 0000000..be80f7f --- /dev/null +++ b/sopel_modules/SpiceBot_AI/AI_Thanks.py @@ -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) diff --git a/sopel_modules/SpiceBot_AI/__init__.py b/sopel_modules/SpiceBot_AI/__init__.py index b1447b6..93aecc7 100644 --- a/sopel_modules/SpiceBot_AI/__init__.py +++ b/sopel_modules/SpiceBot_AI/__init__.py @@ -2,6 +2,14 @@ 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 * +from .AI_Ping import * +from .AI_Love import * __author__ = 'Sam Zick' __email__ = 'sam@deathbybandaid.net' diff --git a/sopel_modules/SpiceBot_osd/__init__.py b/sopel_modules/SpiceBot_osd/__init__.py index baa2b0e..7bd3142 100644 --- a/sopel_modules/SpiceBot_osd/__init__.py +++ b/sopel_modules/SpiceBot_osd/__init__.py @@ -54,7 +54,6 @@ def setup(bot): sopel.bot.SopelWrapper.action = SopelWrapperOSD.action sopel.bot.SopelWrapper.notice = SopelWrapperOSD.notice sopel.bot.SopelWrapper.reply = SopelWrapperOSD.reply - sopel.bot.SopelWrapper.msg = SopelWrapperOSD.msg # verify config settings for server bot_logging(bot, 'SpiceBot_OSD', "Checking for config settings") @@ -389,10 +388,6 @@ class SopelWrapperOSD(object): recipients = self._trigger.sender self._bot.osd(self, messages, recipients, text_method, max_messages) - def msg(self, destination, message, max_messages=1): - self._bot.osd(self, message, destination, 'PRIVMSG', 1) - # self._bot.msg(destination, message, max_messages) - def say(self, message, destination=None, max_messages=1): if destination is None: destination = self._trigger.sender