--- /dev/null
+from aptbot.bot import Bot, Message, Commands
+import os
+import importlib
+import importlib.util
+from importlib import reload
+import traceback
+
+import tools.raid
+reload(tools.raid)
+
+
+PATH = os.path.dirname(os.path.realpath(__file__))
+
+commands = [
+ c for c in os.listdir(PATH) if os.path.isfile(os.path.join(PATH, c))
+]
+commands.remove(os.path.split(__file__)[1])
+specs = {}
+for command in commands:
+ if command.split('.')[0]:
+ specs[command.split('.')[0]] = (
+ importlib.util.spec_from_file_location(
+ f"{command.split('.')[0]}",
+ os.path.join(PATH, command)
+ )
+ )
+
+modules = {}
+for command in specs:
+ modules[command] = importlib.util.module_from_spec(specs[command])
+ if specs[command] and specs[command].loader:
+ try:
+ specs[command].loader.exec_module(modules[command])
+ except Exception as e:
+ print()
+ print(traceback.format_exc())
+ print(f"Problem Loading Module: {e}")
+
+
+def main(bot: Bot, message: Message):
+ prefix = '?'
+ command = message.value.split(' ')[0]
+ if message.command == Commands.PRIVMSG and command.startswith(prefix):
+ try:
+ modules[command[1:]].main(bot, message)
+ except KeyError:
+ pass
+
+ tools.raid.raid(bot, message)
--- /dev/null
+from aptbot.bot import Message, Commands, Bot
+
+
+def main(bot: Bot, message: Message):
+ msg = message.nick + " you have been scammed KEKW"
+ bot.send_privmsg(message.channel, msg)
--- /dev/null
+from aptbot.bot import Message, Commands, Bot
+
+
+def main(bot: Bot, message: Message):
+ msg = ' '.join(message.value.split(' ')[1:])
+ msg = (msg + ' ') * 10
+ bot.send_privmsg(message.channel, msg)
--- /dev/null
+from aptbot.bot import Bot, Message, Commands
+
+
+def raid(bot: Bot, message: Message):
+ if message.command == Commands.USERNOTICE:
+ if message.tags["msg-id"] == "raid":
+ raider_name = message.tags["msg-param-displayName"]
+ raider_login = message.tags["msg-param-login"]
+ raider_id = message.tags["user-id"]
+ raider_game = ""
+ if raider_id:
+ raider_channel_info = "channel info here"
+ viewers = message.tags["msg-param-viewerCount"]
+ viewers = f"{viewers} viewer" if viewers == "1" else f"{viewers} viewers"
+ msg_reply = f"POGGERS {raider_name} has raided {message.channel} with {viewers}!!! Why don\'t you check them out at https://twitch.tv/{raider_login}"
+ if raider_game:
+ msg_reply += f' they were just playing {raider_game}.'
+ bot.send_privmsg(message.channel, msg_reply)