Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ducks don't timeout anymore #1141

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions techsupport_bot/commands/duck.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import datetime
import functools
import random
from datetime import timedelta
from typing import TYPE_CHECKING, Self

import discord
Expand Down Expand Up @@ -380,17 +379,7 @@ def message_check(
f"seconds. Time would have been {duration_exact} seconds"
)
)
# Only attempt timeout if we know we can do it
if (
channel.guild.me.top_role > message.author.top_role
and channel.guild.me.guild_permissions.moderate_members
):
asyncio.create_task(
message.author.timeout(
timedelta(seconds=config.extensions.duck.cooldown.value),
reason="Missed a duck",
)
)

asyncio.create_task(
message.channel.send(
content=message.author.mention,
Expand Down
Loading