diff --git a/cogs/miscellaneous/depart.py b/cogs/miscellaneous/depart.py index 105669a..8b5dc91 100644 --- a/cogs/miscellaneous/depart.py +++ b/cogs/miscellaneous/depart.py @@ -1,6 +1,8 @@ import discord from discord.ext import commands from discord.ext.commands import Context +import aiohttp +import io def depart_command(): @@ -10,20 +12,19 @@ def depart_command(): ) async def depart(self, context): gif_url = "https://yes.nighty.works/raw/Mp6YGV.gif" - - embed = discord.Embed( - color=0x7289DA, - ) - embed.set_author(name="Depart", icon_url="https://yes.nighty.works/raw/YxMC0r.png") - embed.set_image(url=gif_url) - + + 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") + if getattr(context, "interaction", None): inter = context.interaction if not inter.response.is_done(): - await inter.response.send_message(embed=embed, ephemeral=False) + await inter.response.send_message(file=file, ephemeral=False) else: - await inter.followup.send(embed=embed, ephemeral=True) + await inter.followup.send(file=file, ephemeral=True) else: - await context.send(embed=embed) + await context.send(file=file) return depart diff --git a/cogs/miscellaneous/dontasktoask.py b/cogs/miscellaneous/dontasktoask.py index d05589e..5d0aa7d 100644 --- a/cogs/miscellaneous/dontasktoask.py +++ b/cogs/miscellaneous/dontasktoask.py @@ -1,6 +1,8 @@ import discord from discord.ext import commands from discord.ext.commands import Context +import aiohttp +import io def dontasktoask_command(): @commands.hybrid_command( @@ -8,19 +10,20 @@ def dontasktoask_command(): description="Shows the 'Don't Ask to Ask' image." ) async def dontasktoask(self, context): - embed = discord.Embed( - color=0x7289DA - ) - embed.set_author(name="Don't Ask to Ask", icon_url="https://yes.nighty.works/raw/YxMC0r.png") - embed.set_image(url="https://yes.nighty.works/raw/KecbCr.jpg") + image_url = "https://yes.nighty.works/raw/KecbCr.jpg" + async with aiohttp.ClientSession() as session: + async with session.get(image_url) as resp: + data = await resp.read() + file = discord.File(io.BytesIO(data), filename="dontasktoask.jpg") + if getattr(context, "interaction", None): inter = context.interaction if not inter.response.is_done(): - await inter.response.send_message(embed=embed, ephemeral=False) + await inter.response.send_message(file=file, ephemeral=False) else: - await inter.followup.send(embed=embed, ephemeral=True) + await inter.followup.send(file=file, ephemeral=True) else: - await context.send(embed=embed) + await context.send(file=file) return dontasktoask diff --git a/cogs/miscellaneous/piracy.py b/cogs/miscellaneous/piracy.py index 9fe5b34..7cd30dd 100644 --- a/cogs/miscellaneous/piracy.py +++ b/cogs/miscellaneous/piracy.py @@ -1,6 +1,8 @@ import discord from discord.ext import commands from discord.ext.commands import Context +import aiohttp +import io def piracy_command(): @@ -9,20 +11,20 @@ def piracy_command(): description="FBI Anti Piracy Warning", ) async def piracy(self, context): - embed = discord.Embed( - color=0xE02B2B, - ) - embed.set_author(name="Piracy", icon_url="https://yes.nighty.works/raw/rVYXlf.png") - embed.set_image(url="https://yes.nighty.works/raw/lEhuWK.png") - embed.set_footer(text="FBI Anti Piracy Warning", icon_url="https://yes.nighty.works/raw/8qjzP3.png") - + image_url = "https://yes.nighty.works/raw/lEhuWK.png" + + async with aiohttp.ClientSession() as session: + async with session.get(image_url) as resp: + data = await resp.read() + file = discord.File(io.BytesIO(data), filename="piracy.png") + if getattr(context, "interaction", None): inter = context.interaction if not inter.response.is_done(): - await inter.response.send_message(embed=embed, ephemeral=False) + await inter.response.send_message(file=file, ephemeral=False) else: - await inter.followup.send(embed=embed, ephemeral=True) + await inter.followup.send(file=file, ephemeral=True) else: - await context.send(embed=embed) + await context.send(file=file) return piracy diff --git a/cogs/miscellaneous/rickroll.py b/cogs/miscellaneous/rickroll.py index fbf83ae..6579f10 100644 --- a/cogs/miscellaneous/rickroll.py +++ b/cogs/miscellaneous/rickroll.py @@ -1,6 +1,8 @@ import discord from discord.ext import commands from discord.ext.commands import Context +import aiohttp +import io def rr_command(): @@ -10,20 +12,19 @@ def rr_command(): ) async def rr(self, context): gif_url = "https://yes.nighty.works/raw/JzjMcs.gif" - - embed = discord.Embed( - color=0x7289DA, - ) - embed.set_author(name="Rickroll", icon_url="https://yes.nighty.works/raw/YxMC0r.png") - embed.set_image(url=gif_url) - + + 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="rickroll.gif") + if getattr(context, "interaction", None): inter = context.interaction if not inter.response.is_done(): - await inter.response.send_message(embed=embed, ephemeral=False) + await inter.response.send_message(file=file, ephemeral=False) else: - await inter.followup.send(embed=embed, ephemeral=True) + await inter.followup.send(file=file, ephemeral=True) else: - await context.send(embed=embed) + await context.send(file=file) return rr diff --git a/cogs/miscellaneous/support.py b/cogs/miscellaneous/support.py index 725bfd5..a171425 100644 --- a/cogs/miscellaneous/support.py +++ b/cogs/miscellaneous/support.py @@ -1,6 +1,8 @@ import discord from discord.ext import commands from discord.ext.commands import Context +import aiohttp +import io def support_command(): @commands.hybrid_command( @@ -8,19 +10,20 @@ def support_command(): description="Shows the support image." ) async def support(self, context): - embed = discord.Embed( - color=0x7289DA - ) - embed.set_author(name="Support", icon_url="https://yes.nighty.works/raw/YxMC0r.png") - embed.set_image(url="https://yes.nighty.works/raw/X8XeCV.png") + url = "https://yes.nighty.works/raw/wGzHIV.gif" + async with aiohttp.ClientSession() as session: + async with session.get(url) as resp: + data = await resp.read() + file = discord.File(io.BytesIO(data), filename="support.gif") + if getattr(context, "interaction", None): inter = context.interaction if not inter.response.is_done(): - await inter.response.send_message(embed=embed, ephemeral=False) + await inter.response.send_message(file=file, ephemeral=False) else: - await inter.followup.send(embed=embed, ephemeral=True) + await inter.followup.send(file=file, ephemeral=True) else: - await context.send(embed=embed) + await context.send(file=file) return support