app/main.py

32 lines
842 B
Python
Raw Normal View History

2024-06-27 08:11:23 -04:00
import discord
import os
from discord import app_commands
2024-06-27 08:27:06 -04:00
from discord.ext import commands
from cogs.deranged_commands import DerangedCommands
2024-06-27 17:07:10 -04:00
from cogs.support_helper import SupportHelper
2024-06-27 08:11:23 -04:00
from dotenv import load_dotenv
2024-06-27 17:07:10 -04:00
import selfcord
2024-06-27 08:11:23 -04:00
load_dotenv()
2024-06-27 08:27:06 -04:00
client = commands.Bot(intents=discord.Intents.all(), command_prefix=".")
2024-06-27 17:07:10 -04:00
user = selfcord.Client()
2024-06-27 08:11:23 -04:00
@client.event
async def on_message(message):
if message.author.id != 886685857560539176:
return
if message.content.startswith('.sync'):
2024-06-27 08:27:06 -04:00
await client.tree.sync()
2024-06-27 08:11:23 -04:00
await message.channel.send('Synced commands')
2024-06-27 17:07:10 -04:00
2024-06-27 08:11:23 -04:00
2024-06-27 08:27:06 -04:00
@client.event
async def on_ready():
2024-06-27 17:07:10 -04:00
await user.login(os.getenv("USER_TOKEN"))
2024-06-27 08:27:06 -04:00
await client.add_cog(DerangedCommands(client))
2024-06-27 17:07:10 -04:00
await client.add_cog(SupportHelper(client))
print("Loaded all cogs")
2024-06-27 08:11:23 -04:00
client.run(os.getenv("TOKEN"))