Merge branch 'development' of https://github.com/deathbybandaid/SpiceBot into development

This commit is contained in:
deathbybandaid 2019-05-13 07:48:43 -04:00
commit 503f2e826a
11 changed files with 161 additions and 69 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,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)

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

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

View File

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