2025-10-06 21:25:14 -04:00
|
|
|
import discord
|
|
|
|
|
from discord.ext import commands
|
|
|
|
|
from discord.ext.commands import Context
|
2025-10-08 09:49:34 -04:00
|
|
|
import aiohttp
|
|
|
|
|
import io
|
2025-10-06 21:25:14 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def depart_command():
|
|
|
|
|
@commands.hybrid_command(
|
|
|
|
|
name="depart",
|
|
|
|
|
description="Show the departure meme",
|
|
|
|
|
)
|
|
|
|
|
async def depart(self, context):
|
|
|
|
|
gif_url = "https://yes.nighty.works/raw/Mp6YGV.gif"
|
2025-10-08 09:49:34 -04:00
|
|
|
|
|
|
|
|
async with aiohttp.ClientSession() as session:
|
|
|
|
|
async with session.get(gif_url) as resp:
|
|
|
|
|
data = await resp.read()
|
|
|
|
|
file = discord.File(io.BytesIO(data), filename="depart.gif")
|
|
|
|
|
|
2025-10-06 21:25:14 -04:00
|
|
|
if getattr(context, "interaction", None):
|
|
|
|
|
inter = context.interaction
|
|
|
|
|
if not inter.response.is_done():
|
2025-10-08 09:49:34 -04:00
|
|
|
await inter.response.send_message(file=file, ephemeral=False)
|
2025-10-06 21:25:14 -04:00
|
|
|
else:
|
2025-10-08 09:49:34 -04:00
|
|
|
await inter.followup.send(file=file, ephemeral=True)
|
2025-10-06 21:25:14 -04:00
|
|
|
else:
|
2025-10-08 09:49:34 -04:00
|
|
|
await context.send(file=file)
|
2025-11-02 23:32:52 -05:00
|
|
|
|
2025-10-06 21:25:14 -04:00
|
|
|
return depart
|