Move modlogset/bankset commands to core (#4486)

* Move bankset and modlogset to core commands

* Move prune over too

* Finish moving prune

* Move [p]economyset registeramount to [p]bankset registeramount

* style fix

* Fix circular import issue with another breaking change

* Apparently I missed a conflict and git still let me commit...

* Really git?

* Rename RawUserIds -> RawUserIdConverter, improve documentation

* Improve documentation of `is_owner_if_bank_global()`

* MENTION_REGEX -> USER_MENTION_REGEX

* Add 'bank.' prefix

* Fix command examples in docstrings

* Missing docstring change from `bankset prune`

* Missing changes for commands in modlogset

* Update docs

* Remove duplicated info in `economyset showsettings`

* Fix toctree in index.rst

* Add command group prefixes to names of functions for bankset/modlogset

* Remaining string updates due to command name changes

* Ensure that the bank folder is actually gone

Co-authored-by: palmtree5 <palmtree5+3577255@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
palmtree5
2021-11-25 00:06:30 -09:00
committed by GitHub
parent fc560db72d
commit 6acdcdeae9
58 changed files with 830 additions and 5046 deletions

View File

@@ -6,7 +6,7 @@ from typing import Dict, List, Optional, Tuple, Union
import discord
from redbot.core import commands, i18n, checks, modlog
from redbot.core.commands import UserInputOptional
from redbot.core.commands import UserInputOptional, RawUserIdConverter
from redbot.core.utils import AsyncIter
from redbot.core.utils.chat_formatting import (
pagify,
@@ -17,7 +17,6 @@ from redbot.core.utils.chat_formatting import (
)
from redbot.core.utils.mod import get_audit_reason
from .abc import MixinMeta
from .converters import RawUserIds
from .utils import is_allowed_by_hierarchy
log = logging.getLogger("red.mod")
@@ -371,7 +370,7 @@ class KickBanMixin(MixinMeta):
async def ban(
self,
ctx: commands.Context,
user: Union[discord.Member, RawUserIds],
user: Union[discord.Member, RawUserIdConverter],
days: Optional[int] = None,
*,
reason: str = None,
@@ -409,7 +408,7 @@ class KickBanMixin(MixinMeta):
async def massban(
self,
ctx: commands.Context,
user_ids: commands.Greedy[RawUserIds],
user_ids: commands.Greedy[RawUserIdConverter],
days: Optional[int] = None,
*,
reason: str = None,
@@ -892,7 +891,9 @@ class KickBanMixin(MixinMeta):
@commands.guild_only()
@commands.bot_has_permissions(ban_members=True)
@checks.admin_or_permissions(ban_members=True)
async def unban(self, ctx: commands.Context, user_id: RawUserIds, *, reason: str = None):
async def unban(
self, ctx: commands.Context, user_id: RawUserIdConverter, *, reason: str = None
):
"""Unban a user from this server.
Requires specifying the target user's ID. To find this, you may either: