diff --git a/bot/__pycache__/CatBot.cpython-310.pyc b/bot/__pycache__/CatBot.cpython-310.pyc index 0328219..db810f5 100644 Binary files a/bot/__pycache__/CatBot.cpython-310.pyc and b/bot/__pycache__/CatBot.cpython-310.pyc differ diff --git a/bot/catbot.py b/bot/catbot.py index 7ddd8cc..d5fe46c 100644 --- a/bot/catbot.py +++ b/bot/catbot.py @@ -2,9 +2,12 @@ import discord import os from discord.ext import commands from dotenv import load_dotenv +import random class CatBot(): - def __init__(self): + + + def __init__(self, base_url, cats): load_dotenv("./vars/.env") intents = discord.Intents.all() client = discord.Client(intents=intents) @@ -17,8 +20,8 @@ class CatBot(): @bot.event async def on_message(message): - if "marco" in message.content: - await message.channel.send('polo') + if "Cat!" in message.content: + await message.channel.send(base_url + random.choice(cats)) bot.run(os.getenv('TOKEN')) \ No newline at end of file diff --git a/main.py b/main.py index 2b28d34..dd97724 100644 --- a/main.py +++ b/main.py @@ -4,14 +4,15 @@ from bot.catbot import CatBot from server.server import Server SERVER_BASE_URL = "https://kaylee.wtf/cats/"; +cats = [] def run_bot(): global cb - cb = CatBot() + cb = CatBot(SERVER_BASE_URL, cats) def run_server(): global s - s = Server() + s = Server(cats) import threading diff --git a/server/__pycache__/server.cpython-310.pyc b/server/__pycache__/server.cpython-310.pyc index 4819452..33b1e53 100644 Binary files a/server/__pycache__/server.cpython-310.pyc and b/server/__pycache__/server.cpython-310.pyc differ diff --git a/server/server.py b/server/server.py index 380d670..cedd84e 100644 --- a/server/server.py +++ b/server/server.py @@ -1,8 +1,6 @@ import time class Server(): - def __init__(self): - i = 0 - while True: - i += 1 - print(i) - time.sleep(1) \ No newline at end of file + def __init__(self, cats): + cats.append("cat1.jpg") + time.sleep(10) + cats.append("cat2.jpg") \ No newline at end of file