This section outlines the different types of events dispatched by discodo client.
Note
If you are using a standalone discodo node server while not using :pyDPYClient
, the events that you get will have something different. See this node_events
.
To listen an event, use :pyEventDispatcher
of the :pyDPYClient
import discord
import discodo
bot = discord.Client()
codo = discodo.DPYClient(bot)
# Using DPYClient.event
@codo.event("SOURCE_START")
async def start_event(VC, source):
print(f"{VC} is now playing {source}")
# Using DPYClient.dispatcher.on
async def stop_event(VC, source):
print(f"{VC} is stopped {source}")
codo.dispatcher.on("SOURCE_STOP", stop_event)
Called when the new voice client has successfully created. This is not the same as the client being fully connected.
Field | Type | Description |
---|---|---|
|
|
|
---------------- | --------------------- | ---------------------------------- |
|
|
|
Called when there is something changed in the queue of the voice client. If you are using :pyDPYClient
, Ignore this event.
Field | Type | Description |
---|---|---|
|
|
|
---------------- | --------------------- | ---------------------------------- |
|
|
|
---------------- | --------------------- | ---------------------------------- |
|
|
|
Called when the voice channel of the voice client is changed.
Field | Type | Description |
---|---|---|
|
|
|
---------------- | --------------------- | ----------------------------------- |
|
|
|
Called when some sources are put in the queue.
Field | Type | Description |
---|---|---|
|
|
|
---------------- | --------------------- | ----------------------------------- |
|
|
|
Called when some sources are searched and put in the queue.
Field | Type | Description |
---|---|---|
|
|
|
---------------- | ----------------------- | --------------------------------------- |
|
|
|
Called when the player needs next source to play. If you set autoplay
as True
, the related source will be put after this event.
Field | Type | Description |
---|---|---|
|
|
|
---------------- | ----------------------- | -------------------------------------------------- |
|
|
|
Called when the player starts to play the source.
Field | Type | Description |
---|---|---|
|
|
|
---------------- | ----------------------- | -------------------------------------------- |
|
|
|
Called when the player stops to play the source.
Field | Type | Description |
---|---|---|
|
|
|
---------------- | ----------------------- | -------------------------------------------- |
|
|
|
Called when the player gets some traceback while trying to send packets to discord server.
Field | Type | Description |
---|---|---|
|
|
|
---------------- | ------------------------------- | ---------------------------------------------------------------- |
|
|
|
Called when the player gets some traceback while trying to play the source. That source will be automatically removed from the queue.
Field | Type | Description |
---|---|---|
|
|
|
---------------- | ------------------------------- | ---------------------------------------------------------------- |
|
|
|
---------------- | ------------------------------- | ---------------------------------------------------------------- |
|
|
|