wait til the bot is loaded

This commit is contained in:
deathbybandaid 2019-07-03 09:12:37 -04:00
parent 4b5215a35e
commit 4b0343e5de
14 changed files with 36 additions and 6 deletions

View File

@ -9,6 +9,7 @@ import sopel_modules.SpiceBot as SpiceBot
import spicemanip
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('nickname')
@sopel.module.nickname_commands('ai')
def ai_trigger(bot, trigger, botcom):
@ -18,6 +19,7 @@ def ai_trigger(bot, trigger, botcom):
bot.osd(displayval)
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@sopel.module.rule('(.*)')
def bot_command_rule_ai(bot, trigger):

View File

@ -9,12 +9,14 @@ import spicemanip
import sopel_modules.SpiceBot as SpiceBot
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('nickname')
@sopel.module.nickname_commands('owners', 'owner')
def bot_command_owners(bot, trigger, botcom):
bot_command_process(bot, trigger)
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('nickname')
@sopel.module.nickname_commands('admins', 'admin')
def bot_command_admins(bot, trigger, botcom):

View File

@ -12,12 +12,14 @@ import spicemanip
import sopel_modules.SpiceBot as SpiceBot
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('nickname')
@sopel.module.nickname_commands('query')
def query_trigger(bot, trigger, botcom):
bot.osd("I have been programmed to help find new commands by using `?`.")
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.events.check_ready([SpiceBot.events.BOT_COMMANDS])
@SpiceBot.prerun_query('nickname', 'nickname')
@sopel.module.nickname_commands('(.*)')

View File

@ -10,6 +10,7 @@ import sopel.module
import sopel_modules.SpiceBot as SpiceBot
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@sopel.module.nickname_commands('database')
def bot_command_database(bot, trigger):
bot.osd("Database is " + SpiceBot.config.db_type)

View File

@ -15,6 +15,7 @@ from word2number import w2n
from random import randint
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('module', 'dictcom')
@sopel.module.commands('(.*)')
def command_dictcom(bot, trigger, botcom):

View File

@ -7,10 +7,13 @@ import sopel.module
import sopel_modules.SpiceBot as SpiceBot
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@sopel.module.nickname_commands('help', 'docs', 'wiki')
def bot_command_docs(bot, trigger):
bot.osd(["IRC Modules Repository",
str(SpiceBot.github_dict["url_main"] +
SpiceBot.github_dict["repo_owner"] + "/" +
SpiceBot.github_dict["repo_name"] +
SpiceBot.github_dict["url_path_wiki"])])
sb_git_url = str(
SpiceBot.github_dict["url_main"] +
SpiceBot.github_dict["repo_owner"] + "/" +
SpiceBot.github_dict["repo_name"] +
SpiceBot.github_dict["url_path_wiki"]
)
bot.osd(["IRC Modules Repository", sb_git_url])

View File

@ -11,6 +11,7 @@ import spicemanip
# TODO custom gif shortcut commands
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('module')
@sopel.module.commands('gif')
def gif_trigger(bot, trigger, botcom):

View File

@ -9,18 +9,21 @@ import spicemanip
import sopel_modules.SpiceBot as SpiceBot
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('nickname')
@sopel.module.nickname_commands('action')
def bot_command_action(bot, trigger, botcom):
bot_command_process(bot, trigger)
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('nickname')
@sopel.module.nickname_commands('notice')
def bot_command_notice(bot, trigger, botcom):
bot_command_process(bot, trigger)
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('nickname')
@sopel.module.nickname_commands('privmsg', 'say', 'msg')
def bot_command_privmsg(bot, trigger, botcom):

View File

@ -7,16 +7,23 @@ import sopel.module
import sopel_modules.SpiceBot as SpiceBot
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@sopel.module.rule(r"""(?:)u/
(
(?:\\/ | [^/])+
)
""")
def bot_command_reddit_user(bot, trigger):
message = SpiceBot.reddit.prerun(trigger)
bot.osd(message)
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@sopel.module.rule(r"""(?:)r/
(
(?:\\/ | [^/])+
)
""")
def bot_command_reddit_syntax(bot, trigger):
def bot_command_reddit_subreddit(bot, trigger):
message = SpiceBot.reddit.prerun(trigger)
bot.osd(message)

View File

@ -9,6 +9,7 @@ import spicemanip
import sopel_modules.SpiceBot as SpiceBot
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('nickname')
@sopel.module.nickname_commands('update')
def nickname_comand_update(bot, trigger, botcom):
@ -41,6 +42,7 @@ def nickname_comand_update(bot, trigger, botcom):
SpiceBot.spicebot_reload(bot, 'SpiceBot_Update', quitmessage)
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('nickname')
@sopel.module.nickname_commands('restart')
def nickname_comand_restart(bot, trigger, botcom):

View File

@ -10,6 +10,7 @@ import spicemanip
import sopel_modules.SpiceBot as SpiceBot
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('module')
@sopel.module.commands('search', 'find', 'google', 'lookup')
def search_main(bot, trigger, botcom):
@ -26,6 +27,7 @@ def search_main(bot, trigger, botcom):
bot.osd(["[Information search for '" + str(searchterm) + "']", str(searchreturn)])
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('module')
@sopel.module.commands("where", "whereis")
def search_where(bot, trigger, botcom):
@ -42,6 +44,7 @@ def search_where(bot, trigger, botcom):
bot.osd(["[Location search for " + str(searchterm) + "]", str(searchreturn)])
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('module')
@sopel.module.commands("what", "whatis")
def search_what(bot, trigger, botcom):

View File

@ -9,6 +9,7 @@ import spicemanip
import sopel_modules.SpiceBot as SpiceBot
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('module')
@sopel.module.commands('sherlock', 'username')
def bot_command_sherlock(bot, trigger, botcom):

View File

@ -9,6 +9,7 @@ import time
import sopel_modules.SpiceBot as SpiceBot
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('nickname')
@sopel.module.nickname_commands('uptime')
def bot_command_uptime(bot, trigger, botcom):

View File

@ -8,6 +8,7 @@ import sopel
import sopel_modules.SpiceBot as SpiceBot
@SpiceBot.events.check_ready([SpiceBot.events.BOT_LOADED])
@SpiceBot.prerun('nickname')
@sopel.module.nickname_commands('users', 'user')
def nickname_comand_users(bot, trigger, botcom):