1
Fork 0
mirror of https://github.com/allthingslinux/tux.git synced 2024-10-02 16:43:12 +00:00

fix: Linting and formatting via Ruff

This commit is contained in:
rm-rf-tux 2024-09-22 09:56:06 +00:00 committed by github-actions[bot]
parent 5f5ed7d28c
commit 11bd345c44
2 changed files with 3 additions and 4 deletions

View file

@ -110,12 +110,10 @@ class GifLimiter(commands.Cog):
current_time: int = int(time())
for channel_id, timestamps in self.recent_gifs_by_channel.items():
self.recent_gifs_by_channel[channel_id] = (
[t for t in timestamps if current_time - t < self.recent_gif_age])
self.recent_gifs_by_channel[channel_id] = [t for t in timestamps if current_time - t < self.recent_gif_age]
for user_id, timestamps in self.recent_gifs_by_user.items():
self.recent_gifs_by_user[user_id] = (
[t for t in timestamps if current_time - t < self.recent_gif_age])
self.recent_gifs_by_user[user_id] = [t for t in timestamps if current_time - t < self.recent_gif_age]
# Delete user key if no GIF has recently been sent by them
if len(self.recent_gifs_by_user[user_id]) == 0:

View file

@ -6,6 +6,7 @@ from tux.database.controllers import DatabaseController
from tux.ui.embeds import EmbedCreator, EmbedType
from tux.utils.functions import is_harmful, strip_formatting
class EventHandler(commands.Cog):
def __init__(self, bot: Tux) -> None:
self.bot = bot