first commit
This commit is contained in:
parent
78c466dc89
commit
51d38135dd
Binary file not shown.
|
@ -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'))
|
|
@ -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")
|
|
@ -0,0 +1,2 @@
|
||||||
|
discord.py==2.3.2
|
||||||
|
python-dotenv==1.0.1
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
||||||
|
import time
|
||||||
|
class Server():
|
||||||
|
def __init__(self):
|
||||||
|
i = 0
|
||||||
|
while True:
|
||||||
|
i += 1
|
||||||
|
print(i)
|
||||||
|
time.sleep(1)
|
Loading…
Reference in New Issue