aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Steele <[email protected]>2020-11-29 13:06:33 -0500
committerGravatar Steele <[email protected]>2020-11-29 13:06:33 -0500
commit525f132013da5bcfb6e987024bef1d71f4fca630 (patch)
tree7d77c067b076879005e24c9c5ec046f2618d5d22
parent`!close` removes role from claimant only, new method `unclaim_channel`. (diff)
parentMerge pull request #1310 from python-discord/mbaruh/infractions (diff)
Merge branch 'master' of https://github.com/python-discord/bot into Stelercus/close_command
-rw-r--r--bot/exts/moderation/infraction/infractions.py44
-rw-r--r--bot/exts/moderation/infraction/management.py4
-rw-r--r--bot/resources/tags/microsoft-build-tools.md15
3 files changed, 29 insertions, 34 deletions
diff --git a/bot/exts/moderation/infraction/infractions.py b/bot/exts/moderation/infraction/infractions.py
index 6056df1d2..18e937e87 100644
--- a/bot/exts/moderation/infraction/infractions.py
+++ b/bot/exts/moderation/infraction/infractions.py
@@ -10,7 +10,7 @@ from discord.ext.commands import Context, command
from bot import constants
from bot.bot import Bot
from bot.constants import Event
-from bot.converters import Expiry, FetchedMember
+from bot.converters import Duration, Expiry, FetchedMember
from bot.decorators import respect_role_hierarchy
from bot.exts.moderation.infraction import _utils
from bot.exts.moderation.infraction._scheduler import InfractionScheduler
@@ -98,7 +98,13 @@ class Infractions(InfractionScheduler, commands.Cog):
# region: Temporary infractions
@command(aliases=["mute"])
- async def tempmute(self, ctx: Context, user: Member, duration: Expiry, *, reason: t.Optional[str] = None) -> None:
+ async def tempmute(
+ self, ctx: Context,
+ user: Member,
+ duration: t.Optional[Expiry] = None,
+ *,
+ reason: t.Optional[str] = None
+ ) -> None:
"""
Temporarily mute a user for the given reason and duration.
@@ -113,7 +119,11 @@ class Infractions(InfractionScheduler, commands.Cog):
\u2003`s` - seconds
Alternatively, an ISO 8601 timestamp can be provided for the duration.
+
+ If no duration is given, a one hour duration is used by default.
"""
+ if duration is None:
+ duration = await Duration().convert(ctx, "1h")
await self.apply_mute(ctx, user, reason, expires_at=duration)
@command()
@@ -180,11 +190,6 @@ class Infractions(InfractionScheduler, commands.Cog):
await self.apply_infraction(ctx, infraction, user)
- @command(hidden=True, aliases=['shadowkick', 'skick'])
- async def shadow_kick(self, ctx: Context, user: Member, *, reason: t.Optional[str] = None) -> None:
- """Kick a user for the given reason without notifying the user."""
- await self.apply_kick(ctx, user, reason, hidden=True)
-
@command(hidden=True, aliases=['shadowban', 'sban'])
async def shadow_ban(self, ctx: Context, user: FetchedMember, *, reason: t.Optional[str] = None) -> None:
"""Permanently ban a user for the given reason without notifying the user."""
@@ -193,31 +198,6 @@ class Infractions(InfractionScheduler, commands.Cog):
# endregion
# region: Temporary shadow infractions
- @command(hidden=True, aliases=["shadowtempmute, stempmute", "shadowmute", "smute"])
- async def shadow_tempmute(
- self, ctx: Context,
- user: Member,
- duration: Expiry,
- *,
- reason: t.Optional[str] = None
- ) -> None:
- """
- Temporarily mute a user for the given reason and duration without notifying the user.
-
- A unit of time should be appended to the duration.
- Units (∗case-sensitive):
- \u2003`y` - years
- \u2003`m` - months∗
- \u2003`w` - weeks
- \u2003`d` - days
- \u2003`h` - hours
- \u2003`M` - minutes∗
- \u2003`s` - seconds
-
- Alternatively, an ISO 8601 timestamp can be provided for the duration.
- """
- await self.apply_mute(ctx, user, reason, expires_at=duration, hidden=True)
-
@command(hidden=True, aliases=["shadowtempban, stempban"])
async def shadow_tempban(
self,
diff --git a/bot/exts/moderation/infraction/management.py b/bot/exts/moderation/infraction/management.py
index 394f63da3..4cd7d15bf 100644
--- a/bot/exts/moderation/infraction/management.py
+++ b/bot/exts/moderation/infraction/management.py
@@ -40,12 +40,12 @@ class ModManagement(commands.Cog):
# region: Edit infraction commands
- @commands.group(name='infraction', aliases=('infr', 'infractions', 'inf'), invoke_without_command=True)
+ @commands.group(name='infraction', aliases=('infr', 'infractions', 'inf', 'i'), invoke_without_command=True)
async def infraction_group(self, ctx: Context) -> None:
"""Infraction manipulation commands."""
await ctx.send_help(ctx.command)
- @infraction_group.command(name='edit')
+ @infraction_group.command(name='edit', aliases=('e',))
async def infraction_edit(
self,
ctx: Context,
diff --git a/bot/resources/tags/microsoft-build-tools.md b/bot/resources/tags/microsoft-build-tools.md
new file mode 100644
index 000000000..7c702e296
--- /dev/null
+++ b/bot/resources/tags/microsoft-build-tools.md
@@ -0,0 +1,15 @@
+**Microsoft Visual C++ Build Tools**
+
+When you install a library through `pip` on Windows, sometimes you may encounter this error:
+
+```
+error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
+```
+
+This means the library you're installing has code written in other languages and needs additional tools to install. To install these tools, follow the following steps: (Requires 6GB+ disk space)
+
+**1.** Open [https://visualstudio.microsoft.com/visual-cpp-build-tools/](https://visualstudio.microsoft.com/visual-cpp-build-tools/).
+**2.** Click **`Download Build Tools >`**. A file named `vs_BuildTools` or `vs_BuildTools.exe` should start downloading. If no downloads start after a few seconds, click **`click here to retry`**.
+**3.** Run the downloaded file. Click **`Continue`** to proceed.
+**4.** Choose **C++ build tools** and press **`Install`**. You may need a reboot after the installation.
+**5.** Try installing the library via `pip` again.