add more to events

This commit is contained in:
Clxud 2023-02-28 18:50:37 +00:00
parent e5af15a237
commit f05df85dae
2 changed files with 18 additions and 7 deletions

View File

@ -36,6 +36,7 @@ release = '2.1.1'
extensions = [ extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.autodoc',
'sphinx.ext.autosummary', 'sphinx.ext.autosummary',
'sphinx.ext.linkcode',
'myst_parser' 'myst_parser'
] ]
@ -99,3 +100,11 @@ html_theme_options: Dict[str, Any] = {
"source_branch": "main", "source_branch": "main",
"source_directory": "docs/", "source_directory": "docs/",
} }
def linkcode_resolve(domain, info):
if domain != 'py':
return None
if not info['module']:
return None
filename = info['module'].replace('.', '/')
return f"https://github.com/cloudwithax/pomice/blob/main/pomice/{filename}.py"

View File

@ -29,7 +29,7 @@ your application. Here are all the definitions:
- `Event.TrackExceptionEvent()` -> `on_pomice_track_exception` - `Event.TrackExceptionEvent()` -> `on_pomice_track_exception`
- `Event.TrackStartEvent()` -> `on_pomice_track_start` - `Event.TrackStartEvent()` -> `on_pomice_track_start`
- `Event.TrackStuckEvent()` -> `on_pomice_track_stuck` - `Event.TrackStuckEvent()` -> `on_pomice_track_stuck`
- `Event.WebsoocketClosedEvent()` -> `on_pomice_websocket_closed` - `Event.WebsocketClosedEvent()` -> `on_pomice_websocket_closed`
- `Event.WebsocketOpenEvent()` -> `on_pomice_websocket_open` - `Event.WebsocketOpenEvent()` -> `on_pomice_websocket_open`
@ -38,13 +38,15 @@ and properties for further evaluation. They also carry a `Track` object so you c
`Event.TrackEndEvent()` carries the reason for the track ending. If the track ends suddenly, you can use the reason provided to determine a solution. `Event.TrackEndEvent()` carries the reason for the track ending. If the track ends suddenly, you can use the reason provided to determine a solution.
`Event.TrackExceptionEvent()` carries the exception, or reason why the track failed to play. The format for the exception is `REASON [SEVERITY]`. `Event.TrackExceptionEvent()` carries the exception, or reason why the track failed to play. The format for the exception is `REASON: [SEVERITY]`.
`Event.TrackStuckEvent()` carries the threshold, or amount of time Lavalink will wait before it discards the stuck track and stops it from playing. `Event.TrackStuckEvent()` carries the threshold, or amount of time Lavalink will wait before it discards the stuck track and stops it from playing.
`Event.WebsocketClosedEvent()` carries a payload object that contains a `Guild` object, the code number, the reason for disconnect and whether or not it was by the
remote, or the node.
`Event.WebsocketOpenEvent()` carries a target, which is usually the node IP, and the SSRC, a 32-bit integer uniquely identifying the source of the RTP packets sent from
Lavalink.