diff --git a/sopel_modules/SpiceBot_FriendlyBot/FriendlyBot.py b/sopel_modules/SpiceBot_FriendlyBot/FriendlyBot.py new file mode 100644 index 0000000..e14e5a2 --- /dev/null +++ b/sopel_modules/SpiceBot_FriendlyBot/FriendlyBot.py @@ -0,0 +1,23 @@ +# coding=utf-8 + +from __future__ import unicode_literals, absolute_import, division, print_function + +import sopel.module +from sopel.tools import stderr + +import spicemanip + + +def configure(config): + pass + + +def setup(bot): + pass + + +@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) diff --git a/sopel_modules/SpiceBot_FriendlyBot/__init__.py b/sopel_modules/SpiceBot_FriendlyBot/__init__.py new file mode 100644 index 0000000..5f142f9 --- /dev/null +++ b/sopel_modules/SpiceBot_FriendlyBot/__init__.py @@ -0,0 +1,8 @@ +# coding=utf8 +from __future__ import unicode_literals, absolute_import, division, print_function + +from .FriendlyBot import * + +__author__ = 'Sam Zick' +__email__ = 'sam@deathbybandaid.net' +__version__ = '0.1.1' diff --git a/sopel_modules/SpiceBot_Gender/Gender.py b/sopel_modules/SpiceBot_Gender/Gender.py new file mode 100644 index 0000000..5d5b5b1 --- /dev/null +++ b/sopel_modules/SpiceBot_Gender/Gender.py @@ -0,0 +1,21 @@ +# coding=utf-8 + +from __future__ import unicode_literals, absolute_import, division, print_function + +import sopel.module +from sopel.tools import stderr + +import spicemanip + + +def configure(config): + pass + + +def setup(bot): + pass + + +@sopel.module.nickname_commands('gender') +def bot_command_gender(bot, trigger): + bot.osd("If societal genders are binary, my gender is female") diff --git a/sopel_modules/SpiceBot_Gender/__init__.py b/sopel_modules/SpiceBot_Gender/__init__.py new file mode 100644 index 0000000..5bbadf2 --- /dev/null +++ b/sopel_modules/SpiceBot_Gender/__init__.py @@ -0,0 +1,8 @@ +# coding=utf8 +from __future__ import unicode_literals, absolute_import, division, print_function + +from .Gender import * + +__author__ = 'Sam Zick' +__email__ = 'sam@deathbybandaid.net' +__version__ = '0.1.1' diff --git a/sopel_modules/SpiceBot_InsultHandler/InsultHandler.py b/sopel_modules/SpiceBot_InsultHandler/InsultHandler.py new file mode 100644 index 0000000..ae18b36 --- /dev/null +++ b/sopel_modules/SpiceBot_InsultHandler/InsultHandler.py @@ -0,0 +1,28 @@ +# coding=utf-8 + +from __future__ import unicode_literals, absolute_import, division, print_function + +import sopel.module +from sopel.tools import stderr + +import spicemanip + +from sopel_modules.SpiceBot_SBTools import sopel_triggerargs, command_permissions_check, inlist, inlist_match + + +def configure(config): + pass + + +def setup(bot): + pass + + +@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 + "!!!") diff --git a/sopel_modules/SpiceBot_InsultHandler/__init__.py b/sopel_modules/SpiceBot_InsultHandler/__init__.py new file mode 100644 index 0000000..6f1bdc3 --- /dev/null +++ b/sopel_modules/SpiceBot_InsultHandler/__init__.py @@ -0,0 +1,8 @@ +# coding=utf8 +from __future__ import unicode_literals, absolute_import, division, print_function + +from .InsultHandler import * + +__author__ = 'Sam Zick' +__email__ = 'sam@deathbybandaid.net' +__version__ = '0.1.1' diff --git a/sopel_modules/SpiceBot_SBTools/__init__.py b/sopel_modules/SpiceBot_SBTools/__init__.py index 4c3d6f9..4bbd84e 100644 --- a/sopel_modules/SpiceBot_SBTools/__init__.py +++ b/sopel_modules/SpiceBot_SBTools/__init__.py @@ -87,6 +87,42 @@ def command_permissions_check(bot, trigger, privslist): return True +""" +Time +""" + + +def humanized_time(countdownseconds): + time = float(countdownseconds) + if time == 0: + return "just now" + year = time // (365 * 24 * 3600) + time = time % (365 * 24 * 3600) + day = time // (24 * 3600) + time = time % (24 * 3600) + time = time % (24 * 3600) + hour = time // 3600 + time %= 3600 + minute = time // 60 + time %= 60 + second = time + displaymsg = None + timearray = ['year', 'day', 'hour', 'minute', 'second'] + for x in timearray: + currenttimevar = eval(x) + if currenttimevar >= 1: + timetype = x + if currenttimevar > 1: + timetype = str(x+"s") + if displaymsg: + displaymsg = str(displaymsg + " " + str(int(currenttimevar)) + " " + timetype) + else: + displaymsg = str(str(int(currenttimevar)) + " " + timetype) + if not displaymsg: + return "just now" + return displaymsg + + """List Manipulation Functions""" diff --git a/sopel_modules/SpiceBot_Uptime/Uptime.py b/sopel_modules/SpiceBot_Uptime/Uptime.py new file mode 100644 index 0000000..282eb71 --- /dev/null +++ b/sopel_modules/SpiceBot_Uptime/Uptime.py @@ -0,0 +1,26 @@ +# coding=utf-8 + +from __future__ import unicode_literals, absolute_import, division, print_function + +import sopel.module +from sopel.tools import stderr + +import spicemanip + +import time + +from sopel_modules.SpiceBot_SBTools import humanized_time + + +def configure(config): + pass + + +def setup(bot): + bot.memory["SpiceBot_Uptime"] = time.time() + + +@sopel.module.nickname_commands('uptime') +def bot_command_srewyou(bot, trigger): + timesince = str(humanized_time(time.time() - bot.memory["SpiceBot_Uptime"])) + " ago." + bot.osd("I have been running since " + timesince) diff --git a/sopel_modules/SpiceBot_Uptime/__init__.py b/sopel_modules/SpiceBot_Uptime/__init__.py new file mode 100644 index 0000000..d0079c0 --- /dev/null +++ b/sopel_modules/SpiceBot_Uptime/__init__.py @@ -0,0 +1,8 @@ +# coding=utf8 +from __future__ import unicode_literals, absolute_import, division, print_function + +from .Uptime import * + +__author__ = 'Sam Zick' +__email__ = 'sam@deathbybandaid.net' +__version__ = '0.1.1'