diff --git a/bot/__pycache__/CatBot.cpython-310.pyc b/bot/__pycache__/CatBot.cpython-310.pyc new file mode 100644 index 0000000..0328219 Binary files /dev/null and b/bot/__pycache__/CatBot.cpython-310.pyc differ diff --git a/bot/catbot.py b/bot/catbot.py new file mode 100644 index 0000000..7ddd8cc --- /dev/null +++ b/bot/catbot.py @@ -0,0 +1,24 @@ +import discord +import os +from discord.ext import commands +from dotenv import load_dotenv + +class CatBot(): + def __init__(self): + load_dotenv("./vars/.env") + intents = discord.Intents.all() + client = discord.Client(intents=intents) + bot = commands.Bot(command_prefix='!', intents=intents) + + # Set the confirmation message when the bot is ready + @bot.event + async def on_ready(): + print(f'Logged in as {bot.user.name}') + + @bot.event + async def on_message(message): + if "marco" in message.content: + await message.channel.send('polo') + + + bot.run(os.getenv('TOKEN')) \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..2b28d34 --- /dev/null +++ b/main.py @@ -0,0 +1,26 @@ +import os +import time +from bot.catbot import CatBot +from server.server import Server + +SERVER_BASE_URL = "https://kaylee.wtf/cats/"; + +def run_bot(): + global cb + cb = CatBot() + +def run_server(): + global s + s = Server() + +import threading + +# run bot (and server which allows users to upload cat images) +if __name__=="__main__": + t1 = threading.Thread(target=run_bot) + t2 = threading.Thread(target=run_server) + t1.start() + t2.start() + t1.join() + t2.join() + print("done") diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ffd7a6b --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +discord.py==2.3.2 +python-dotenv==1.0.1 diff --git a/server/__pycache__/server.cpython-310.pyc b/server/__pycache__/server.cpython-310.pyc new file mode 100644 index 0000000..4819452 Binary files /dev/null and b/server/__pycache__/server.cpython-310.pyc differ diff --git a/server/server.py b/server/server.py new file mode 100644 index 0000000..380d670 --- /dev/null +++ b/server/server.py @@ -0,0 +1,8 @@ +import time +class Server(): + def __init__(self): + i = 0 + while True: + i += 1 + print(i) + time.sleep(1) \ No newline at end of file