bot#
The class to connect your application with the Discord API.
- class wyvern.GatewayBot(token: str, *, api_version: int = 10, intents: SupportsInt | Intents = 3178233)[source]#
Bases:
ImplementsEventDecos
The main bot class that interacts with the discord API through both REST and gateway paths.
- Parameters:
Example
import asyncio import wyvern bot = wyvern.GatewayBot( "BOT_TOKEN_HERE", intents=( wyvern.Intents.GUILD_MEMBERS | wyvern.Intents.GUILDS | wyvern.Intents.GUILD_MESSAGES | wyvern.Intents.DIRECT_MESSAGES ), ) asyncio.run(bot.start())
- event_handler: EventHandler#
The
EventHandler
attached to the instance.
- listener(event: type[Event], *, max_trigger: int | Undefined = <wyvern.utils.consts.Undefined object>) Callable[[types.EventListenerCallbackT], EventListener] [source]#
Adds a listener to the bot’s event handler
- Parameters:
- Returns:
listener – The event listener that was constructed.
- Return type:
- rest: RESTClientImpl#
The REST handler attached to the instance.