Quickstart¶
Important
This guide expects you already have the installed in your environment.
Prerequisites¶
Create your
.envfile
Your .env file should contain the following keys:
APPLICATION_TOKEN: The bot token of your application. You can get this in the Bot tab of your application’s Developer Portal.
Steps¶
Import modules
from discord import Client
from discord.flags import GatewayIntent
Configure client
intents = GatewayIntents.default()
client = Client(intents = intents)
Register event listeners
@client.event_listener("READY")
async def _(event: ReadyEvent) -> None:
print("Client is ready!")
See also
Connect to Discord API
client.connect()