diff --git a/pomice/events.py b/pomice/events.py index 1cd7641..4cb5066 100644 --- a/pomice/events.py +++ b/pomice/events.py @@ -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) diff --git a/pomice/pool.py b/pomice/pool.py index f388560..2d4998d 100644 --- a/pomice/pool.py +++ b/pomice/pool.py @@ -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, diff --git a/pomice/utils.py b/pomice/utils.py index a26b721..329b14d 100644 --- a/pomice/utils.py +++ b/pomice/utils.py @@ -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: """