mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
* revert the revert the revert git is hard... * and remove old mutes * make voicemutes less yelly * fix error when no args present in mute commands * update docstrings * address review * black * oops * fix voicemutes * remove mutes.py file * Remove _voice_perm_check from mod since it's now in mutes cog * remove naive datetimes prevent muting the bot prevent muting yourself fix error message when lots of channels are present * change alias for channelunmute Be more verbose for creating default mute role * add `[p]activemutes` to show current mutes in the server and time remaining on the mutes * improve resolution of unmute time * black * Show indefinite mutes in activemutes and only show the current servers mutes in activemutes * replace message.created_at with timezone aware timezone * remove "server" from activemutes to clean up look since channelmutes will show channel * better cache management, add tracking for manual muted role removal in the cache and modlog cases * Fix keyerror in mutes command when unsuccessful mutes * add typing indicator and improve config settings * flake8 issue * add one time message when attempting to mute without a role set, consume rate limits across channels for overwrite mutes * Don't clear the whole guilds settings when a mute is finished. Optimize server mutes to better handle migration to API method later. Fix typehints. * Utilize usage to make converter make more sense * remove decorator permission checks and fix doc strings * handle role changes better * More sanely handle channel mutes return and improve failed mutes dialogue. Re-enable task cleaner. Reduce wait time to improve resolution of mute time. * Handle re-mute on leave properly * fix unbound error in overwrites mute * revert the revert the revert git is hard... * and remove old mutes * make voicemutes less yelly * fix error when no args present in mute commands * update docstrings * address review * black * oops * fix voicemutes * Remove _voice_perm_check from mod since it's now in mutes cog * remove naive datetimes prevent muting the bot prevent muting yourself fix error message when lots of channels are present * change alias for channelunmute Be more verbose for creating default mute role * add `[p]activemutes` to show current mutes in the server and time remaining on the mutes * improve resolution of unmute time * black * Show indefinite mutes in activemutes and only show the current servers mutes in activemutes * replace message.created_at with timezone aware timezone * remove "server" from activemutes to clean up look since channelmutes will show channel * better cache management, add tracking for manual muted role removal in the cache and modlog cases * Fix keyerror in mutes command when unsuccessful mutes * add typing indicator and improve config settings * flake8 issue * add one time message when attempting to mute without a role set, consume rate limits across channels for overwrite mutes * Don't clear the whole guilds settings when a mute is finished. Optimize server mutes to better handle migration to API method later. Fix typehints. * Utilize usage to make converter make more sense * remove decorator permission checks and fix doc strings * handle role changes better * More sanely handle channel mutes return and improve failed mutes dialogue. Re-enable task cleaner. Reduce wait time to improve resolution of mute time. * Handle re-mute on leave properly * fix unbound error in overwrites mute * remove mutes.pt * remove reliance on mods is_allowed_by_hierarchy since we don't have a setting to control that anyways inside this. * black * fix hierarchy check * wtf * Cache mute roles for large bots * fix lint * fix this error * Address review 1 * lint * fix string i18n issue * remove unused typing.Coroutine import and fix i18n again * missed this docstring * Put voiceban and voiceunban back in mod where it's more appropriate * Address review 2 electric boogaloo * Make voicemutes use same methods as channel mute * black * handle humanize_list doesn't accept generators * update voicemutes docstrings * make voiceperm check consistent with rest of error handling * bleh * fix modlog case spam when overrides are in place * <a:pandaexplode:639975629793787922> * bleck * use total_seconds() instead of a dict, sorry everyone already using this lmao * <:excited:474074780887285776> This should be everything * black * fix the things * bleh * more cleanup * lmao hang on * fix voice mutes thingy * Title Case Permissions * oh I see * I'm running out of funny one-liners for commit messages * oof * ugh * let's try this * voicemutes manage_permissions * Cleanup mutes if they expire when member is not present * black * linters go brr Co-authored-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
28 lines
774 B
Python
28 lines
774 B
Python
from abc import ABC, abstractmethod
|
|
from typing import List, Tuple, Optional, Dict
|
|
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()
|