mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
Add .gitattributes to ensure project consistent line endings (#4037)
- Renormalized as well
This commit is contained in:
parent
31bb43ca38
commit
d869410d36
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
* text eol=lf
|
||||||
|
|
||||||
|
# binary file excludsions
|
||||||
|
*.png binary
|
||||||
@ -1,41 +1,41 @@
|
|||||||
import re
|
import re
|
||||||
from .abc import MixinMeta
|
from .abc import MixinMeta
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from redbot.core import commands, i18n, checks
|
from redbot.core import commands, i18n, checks
|
||||||
from redbot.core.utils.chat_formatting import humanize_timedelta
|
from redbot.core.utils.chat_formatting import humanize_timedelta
|
||||||
|
|
||||||
_ = i18n.Translator("Mod", __file__)
|
_ = i18n.Translator("Mod", __file__)
|
||||||
|
|
||||||
|
|
||||||
class Slowmode(MixinMeta):
|
class Slowmode(MixinMeta):
|
||||||
"""
|
"""
|
||||||
Commands regarding channel slowmode management.
|
Commands regarding channel slowmode management.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
@commands.bot_has_permissions(manage_channels=True)
|
@commands.bot_has_permissions(manage_channels=True)
|
||||||
@checks.admin_or_permissions(manage_channels=True)
|
@checks.admin_or_permissions(manage_channels=True)
|
||||||
async def slowmode(
|
async def slowmode(
|
||||||
self,
|
self,
|
||||||
ctx,
|
ctx,
|
||||||
*,
|
*,
|
||||||
interval: commands.TimedeltaConverter(
|
interval: commands.TimedeltaConverter(
|
||||||
minimum=timedelta(seconds=0), maximum=timedelta(hours=6), default_unit="seconds"
|
minimum=timedelta(seconds=0), maximum=timedelta(hours=6), default_unit="seconds"
|
||||||
) = timedelta(seconds=0),
|
) = timedelta(seconds=0),
|
||||||
):
|
):
|
||||||
"""Changes channel's slowmode setting.
|
"""Changes channel's slowmode setting.
|
||||||
|
|
||||||
Interval can be anything from 0 seconds to 6 hours.
|
Interval can be anything from 0 seconds to 6 hours.
|
||||||
Use without parameters to disable.
|
Use without parameters to disable.
|
||||||
"""
|
"""
|
||||||
seconds = interval.total_seconds()
|
seconds = interval.total_seconds()
|
||||||
await ctx.channel.edit(slowmode_delay=seconds)
|
await ctx.channel.edit(slowmode_delay=seconds)
|
||||||
if seconds > 0:
|
if seconds > 0:
|
||||||
await ctx.send(
|
await ctx.send(
|
||||||
_("Slowmode interval is now {interval}.").format(
|
_("Slowmode interval is now {interval}.").format(
|
||||||
interval=humanize_timedelta(timedelta=interval)
|
interval=humanize_timedelta(timedelta=interval)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
await ctx.send(_("Slowmode has been disabled."))
|
await ctx.send(_("Slowmode has been disabled."))
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user