mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 09:52:30 -05:00
Audio changes (#5593)
* Squash tested commits * remove the code jack is concerned about * Apply suggestions from code review * more log lines * more log lines * format * formatting * style(Rename Xms and Xmx mentions): Rename Xms and Xmx to more use friendly names - Change Xms to "Initial Heapsize" - Change Xmx to "Max Heapsize" Signed-off-by: Draper <27962761+Drapersniper@users.noreply.github.com>
This commit is contained in:
@@ -6,7 +6,18 @@ import datetime
|
||||
from abc import ABC, abstractmethod
|
||||
from collections import Counter, defaultdict
|
||||
from pathlib import Path
|
||||
from typing import Set, TYPE_CHECKING, Any, List, Mapping, MutableMapping, Optional, Tuple, Union
|
||||
from typing import (
|
||||
Set,
|
||||
TYPE_CHECKING,
|
||||
Any,
|
||||
List,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
Optional,
|
||||
Tuple,
|
||||
Union,
|
||||
Dict,
|
||||
)
|
||||
|
||||
import aiohttp
|
||||
import discord
|
||||
@@ -15,6 +26,7 @@ import lavalink
|
||||
from redbot.core import Config, commands
|
||||
from redbot.core.bot import Red
|
||||
from redbot.core.commands import Context
|
||||
from redbot.core.utils.antispam import AntiSpam
|
||||
from redbot.core.utils.dbtools import APSWConnectionWrapper
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@@ -35,11 +47,13 @@ class MixinMeta(ABC):
|
||||
bot: Red
|
||||
config: Config
|
||||
api_interface: Optional["AudioAPIInterface"]
|
||||
player_manager: Optional["ServerManager"]
|
||||
managed_node_controller: Optional["ServerManager"]
|
||||
playlist_api: Optional["PlaylistWrapper"]
|
||||
local_folder_current_path: Optional[Path]
|
||||
db_conn: Optional[APSWConnectionWrapper]
|
||||
session: aiohttp.ClientSession
|
||||
antispam: Dict[int, Dict[str, AntiSpam]]
|
||||
llset_captcha_intervals: List[Tuple[datetime.timedelta, int]]
|
||||
|
||||
skip_votes: MutableMapping[int, Set[int]]
|
||||
play_lock: MutableMapping[int, bool]
|
||||
@@ -64,17 +78,21 @@ class MixinMeta(ABC):
|
||||
cog_ready_event: asyncio.Event
|
||||
_ws_resume: defaultdict[Any, asyncio.Event]
|
||||
_ws_op_codes: defaultdict[int, asyncio.LifoQueue]
|
||||
_default_lavalink_settings: Mapping
|
||||
permission_cache = discord.Permissions
|
||||
|
||||
_last_ll_update: datetime.datetime
|
||||
_ll_guild_updates: Set[int]
|
||||
_diconnected_shard: Set[int]
|
||||
_disconnected_shard: Set[int]
|
||||
|
||||
@abstractmethod
|
||||
async def command_llsetup(self, ctx: commands.Context):
|
||||
raise NotImplementedError()
|
||||
|
||||
@commands.command()
|
||||
@abstractmethod
|
||||
async def command_audioset_restart(self, ctx: commands.Context):
|
||||
raise NotImplementedError()
|
||||
|
||||
@abstractmethod
|
||||
async def maybe_reset_error_counter(self, player: lavalink.Player) -> None:
|
||||
raise NotImplementedError()
|
||||
@@ -112,7 +130,7 @@ class MixinMeta(ABC):
|
||||
raise NotImplementedError()
|
||||
|
||||
@abstractmethod
|
||||
def lavalink_restart_connect(self) -> None:
|
||||
def lavalink_restart_connect(self, manual: bool = False) -> None:
|
||||
raise NotImplementedError()
|
||||
|
||||
@abstractmethod
|
||||
|
||||
Reference in New Issue
Block a user