An asynchronous Python Discord API library
So far we only have the following:
- Base Client Class
- Event Handler
- All Events
- Discord Models (Messages, Users, etc.)
- Commands
- Extensions/Addons
- Voice
import dispy
client = dispy.DiscordApp("TOKEN")
client.start()
import dispy
client = dispy.DiscordApp("TOKEN")
@client.listen(dispy.StartedEvent) # Listen to when the bot is started
async def started_event() -> None: # This event specifically has no data, so no parameters should be present
await client.logger.client_log("Bot started")
client.start()
import dispy
client = dispy.DiscordApp("TOKEN")
@client.command(dispy.PrefixCommand, "foo", prefix='!')
async def foo_prefix_command(ctx:dispy.PrefixContext) -> None:
await client.logger.client_log("bar")
client.start()
import dispy
client = dispy.DiscordApp("TOKEN")
@client.command(dispy.SlashCommand, "foo", "Messages you 'bar'")
async def foo_slash_command(ctx:dispy.SlashContext) -> None:
await client.logger.client_log("bar")
client.start()