-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathabc.py
39 lines (32 loc) · 1.09 KB
/
abc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from abc import ABC, abstractmethod
from typing import List, Tuple, Optional, Dict, Union
from datetime import datetime
import discord
from redbot.core import Config, commands
from redbot.core.bot import Red
class MixinMeta(ABC):
"""
Base class for well behaved type hint detection with composite class.
Basically, to keep developers sane when not all attributes are defined in each mixin.
"""
def __init__(self, *_args):
self.config: Config
self.bot: Red
self._mutes_cache: Dict[int, Dict[int, Optional[datetime]]]
@staticmethod
@abstractmethod
async def _voice_perm_check(
ctx: commands.Context, user_voice_state: Optional[discord.VoiceState], **perms: bool
) -> bool:
raise NotImplementedError()
@abstractmethod
async def _send_dm_notification(
self,
user: Union[discord.User, discord.Member],
moderator: Optional[Union[discord.User, discord.Member]],
guild: discord.Guild,
mute_type: str,
reason: Optional[str],
duration=None,
):
raise NotImplementedError()