Red-DiscordBot/redbot/cogs/mod/converters.py
Michael H c7608aeb17 [V3 Mod] Use a composite class for mod (#2501)
* [V3 Mod] Use a composite class for mod

This turns mod.py into acomposite class

I've split things in this up based on purpose, including `movetocore`

`movetocore` is a set of things which likely belong in the core bot and
not relying on mod being loaded.

This is part of #2500

Per discussion in discord, this should be the first thing in #2500
merged

* Move this back,
mod was importable,
and this was intended as non-breaking

* Prevent fix from being lost if merged before this.

see Cog-Creators/Red-DiscordBot#2510

* Move case creation to before sending

see #2515

* fix failed merge done in web
2019-04-01 03:34:27 -08:00

17 lines
602 B
Python

from redbot.core.commands import Converter, BadArgument
from redbot.core.i18n import Translator
_ = Translator("Mod", __file__)
class RawUserIds(Converter):
async def convert(self, ctx, argument):
# This is for the hackban command, where we receive IDs that
# are most likely not in the guild.
# As long as it's numeric and long enough, it makes a good candidate
# to attempt a ban on
if argument.isnumeric() and len(argument) >= 17:
return int(argument)
raise BadArgument(_("{} doesn't look like a valid user ID.").format(argument))