Skip to content

Commit fbcec12

Browse files
committed
fix, update and improve typehints and documentation in a few place
1 parent 23644fe commit fbcec12

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

lavalink/lavalink.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ async def initialize(
3434
host,
3535
password,
3636
port: Optional[int] = None,
37-
timeout=30,
37+
timeout: float = 30,
3838
resume_key: Optional[str] = None,
39-
resume_timeout: int = 60,
39+
resume_timeout: float = 60,
4040
secured: bool = False,
4141
):
4242
"""
@@ -57,11 +57,11 @@ async def initialize(
5757
The password of the Lavalink node.
5858
port : Optional[int]
5959
The websocket port on the Lavalink Node.
60-
timeout : int
60+
timeout : float
6161
Amount of time to allow retries to occur, ``None`` is considered forever.
6262
resume_key : Optional[str]
6363
A resume key used for resuming a session upon re-establishing a WebSocket connection to Lavalink.
64-
resume_timeout : inr
64+
resume_timeout : float
6565
How long the node should wait for a connection while disconnected before clearing all players.
6666
secured: bool
6767
Whether to use the `wss://` and `https://` protocol.
@@ -106,7 +106,10 @@ async def connect(channel: discord.VoiceChannel, deafen: bool = False):
106106
107107
Parameters
108108
----------
109-
channel
109+
channel : discord.VoiceChannel
110+
The channel to connect to.
111+
deafen: bool
112+
Whether to deafen the bot user upon join.
110113
111114
Returns
112115
-------

lavalink/node.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def __repr__(self):
111111

112112
class Node:
113113

114-
_is_shutdown = False # type: bool
114+
_is_shutdown: bool = False
115115

116116
def __init__(
117117
self,
@@ -124,7 +124,7 @@ def __init__(
124124
num_shards: int,
125125
port: Optional[int] = None,
126126
resume_key: Optional[str] = None,
127-
resume_timeout: int = 60,
127+
resume_timeout: float = 60,
128128
bot: Bot = None,
129129
secured: bool = False,
130130
):
@@ -151,7 +151,7 @@ def __init__(
151151
Number of shards to which the bot is currently connected.
152152
resume_key : Optional[str]
153153
A resume key used for resuming a session upon re-establishing a WebSocket connection to Lavalink.
154-
resume_timeout : int
154+
resume_timeout : float
155155
How long the node should wait for a connection while disconnected before clearing all players.
156156
bot: AutoShardedBot
157157
The Bot object that connects to discord.
@@ -234,7 +234,7 @@ async def connect(self, timeout=None, *, shutdown=False):
234234
235235
Parameters
236236
----------
237-
timeout : int
237+
timeout : float
238238
Time after which to timeout on attempting to connect to the Lavalink websocket,
239239
``None`` is considered never, but the underlying code may stop trying past a
240240
certain point.

0 commit comments

Comments
 (0)