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

Pyright wants *exact* types - no inference

This causes issue when discord.py allows a channel to have 10 types
Maybe it is a skill issue, *maybe*, but I have the feeling it could be a bit easier...
This commit is contained in:
rm-rf-omega 2024-09-22 01:04:08 +02:00
parent 1ef9ee6637
commit 538d9577f6

View file

@ -1,7 +1,7 @@
import asyncio
from collections import defaultdict
from time import time
from typing import DefaultDict
from typing import defaultdict
from tux.utils.constants import Constants as CONST
from tux.bot import Tux
@ -56,9 +56,11 @@ class GifLimiter(commands.Cog):
# Deletes the message passed as an argument, and creates a self-deleting message explaining the reason
async def delete_message(self, message: discord.Message, epilogue: str) -> None:
channel: discord.MessageableChannel = message.channel
channel: Union[TextChannel, StageChannel, VoiceChannel, Thread, DMChannel, GroupChannel, PartialMessageable]
= message.channel
await message.delete()
sent_message = await channel.send("-# GIF ratelimit exceeded " + epilogue)
sent_message: discord.Message = await channel.send("-# GIF ratelimit exceeded " + epilogue)
await asyncio.sleep(3)
await sent_message.delete()