This commit is contained in:
VP 2021-12-27 10:33:42 +02:00
parent ab9acdb033
commit 5acc3625a0
3 changed files with 8 additions and 12 deletions

View File

@ -1,5 +1,6 @@
from discord import Client
from .pool import NodePool
from .utils import ClientType
class PomiceEvent:
@ -14,7 +15,7 @@ class PomiceEvent:
name = "event"
handler_args = ()
def dispatch(self, bot: ClientType):
def dispatch(self, bot: Client):
bot.dispatch(f"pomice_{self.name}", *self.handler_args)

View File

@ -4,14 +4,12 @@ import asyncio
import json
import random
import re
import time
from typing import Dict, Optional, TYPE_CHECKING
from urllib.parse import quote
from enum import Enum
import aiohttp
from discord import Client, VoiceRegion
from discord.ext import commands
from discord import VoiceRegion
from . import (
@ -30,7 +28,7 @@ from .exceptions import (
TrackLoadError
)
from .objects import Playlist, Track
from .utils import ClientType, ExponentialBackoff, NodeStats, Ping
from .utils import ExponentialBackoff, NodeStats, Ping
if TYPE_CHECKING:
from .player import Player
@ -60,7 +58,7 @@ class Node:
self,
*,
pool,
bot: ClientType,
bot: Client,
host: str,
port: int,
password: str,
@ -141,7 +139,7 @@ class Node:
return self._region
@property
def bot(self) -> ClientType:
def bot(self) -> Client:
"""Property which returns the discord.py client linked to this node"""
return self._bot
@ -518,7 +516,7 @@ class NodePool:
async def create_node(
cls,
*,
bot: ClientType,
bot: Client,
host: str,
port: str,
password: str,

View File

@ -9,13 +9,10 @@ from discord import AutoShardedClient, Client
from discord.ext.commands import AutoShardedBot, Bot
__all__ = [
"ClientType",
"ExponentialBackoff",
"NodeStats"
]
ClientType = Union[AutoShardedBot, AutoShardedClient, Bot, Client]
class ExponentialBackoff:
"""