diff options
Diffstat (limited to 'src/moyaiBot/moyaiBot.py')
| -rw-r--r-- | src/moyaiBot/moyaiBot.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/moyaiBot/moyaiBot.py b/src/moyaiBot/moyaiBot.py new file mode 100644 index 0000000..0ac4760 --- /dev/null +++ b/src/moyaiBot/moyaiBot.py @@ -0,0 +1,38 @@ +import discord +from discord.ext import commands +from .lib import get_random_response + +intents = discord.Intents.default() +intents.message_content = True +moyai = commands.Bot(command_prefix="m!", description="moyai", intents=intents) + + +async def on_ready(self): + print(f"logged in as {self.user}") + + +async def on_message(self, message): + if message.author == self.user or not message.channel == "moyai-testing": + return + + echo_messages = ["moyai", discord.utils.get(moyai.emojis, name="moyai")] + try: + index = echo_messages.index(message.content.toLower()) + await message.channel.send(echo_messages[index]) + except ValueError: + return + + +async def ask(ctx): + await ctx.send(get_random_response(moyai)) + + +async def moyaispam(ctx): + msg = str() + for i in range(30): + msg += str(discord.utils.get(moyai.emojis, name="moyai")) + await ctx.send(msg) |
