app/main.py

34 lines
865 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-28 17:16:12 -04:00
from cogs.victimization import Victimization
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-28 17:16:12 -04:00
import constants
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-28 17:16:12 -04:00
print("Logged in as bot")
await user.login(constants.USER_TOKEN)
print("Logged in as user")
2024-06-27 08:27:06 -04:00
await client.add_cog(DerangedCommands(client))
2024-06-27 17:07:10 -04:00
print("Loaded all cogs")
2024-06-27 08:11:23 -04:00
2024-06-28 17:16:12 -04:00
client.run(constants.TOKEN)