mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 02:16:09 -05:00
[Mutes] Add ability to send DMs on mute/unmute (#4563)
* handle manual mutes/unmutes Doing this in the Web-Editor is painful. Let's switch to VSC. * embed version * non embed * config stuff * testing done * wow black * Few things before I start local testing * Fix new lines * Make messages not depend on modlog * Yay voicemutes * black+import * what is your ducking problem vscode * adress review * this is driving me mad * Check the config in `_send_dm_notification` to avoid code repetition * Fix incorrect type hints * Remove no longer needed line changes * Remove unused function * Update the type hints from commit 946299 in the MixinMeta too * Fixed wrong variable being passed to the method and ensure DMs aren't sent when we couldn't get the member object * They call me dumb for a reason * Stop overriding variable with duration + various formatting tweaks * :( * We need to differ between voice and text in two places, interesting... * Show info about no reason provided in embed * Apparently, the `reason` can also be an empty string :| * Update redbot/cogs/mutes/mutes.py Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import List, Tuple, Optional, Dict
|
||||
from typing import List, Tuple, Optional, Dict, Union
|
||||
from datetime import datetime
|
||||
|
||||
import discord
|
||||
@@ -25,3 +25,15 @@ class MixinMeta(ABC):
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user