app/main.py
2024-06-27 08:11:23 -04:00

30 lines
906 B
Python

import discord
import os
from discord import app_commands
from dotenv import load_dotenv
load_dotenv()
client = discord.Client(intents=discord.Intents.all())
tree = app_commands.CommandTree(client)
@tree.command(name="get-token", description="Get my token :3")
@app_commands.allowed_installs(guilds=False, users=True)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def token(interaction: discord.Interaction) -> None:
embed = discord.Embed()
embed.title = "My token"
embed.description = os.getenv("TOKEN")
embed.color = 0x00EAFF
await interaction.response.send_message(embed=embed)
@client.event
async def on_message(message):
if message.author.id != 886685857560539176:
return
if message.content.startswith('.sync'):
await tree.sync()
await message.channel.send('Synced commands')
client.run(os.getenv("TOKEN"))