diff --git a/cogs/5000.py b/cogs/5000.py index dd93009..604450b 100644 --- a/cogs/5000.py +++ b/cogs/5000.py @@ -1,6 +1,7 @@ import discord from discord.ext import commands from discord import app_commands +import urllib.parse class gosentyouen(commands.Cog): @@ -60,8 +61,9 @@ async def gosen( noalpha: str, rainbow: str, ): + embed = discord.Embed(title="5000兆円ほしい!!").set_image(url=f"https://gsapi.cbrx.io/image?top={urllib.parse.quote(top)}&bottom={urllib.parse.quote(bottom)}&type={urllib.parse.quote(type)}&q={urllib.parse.quote(quality)}&hoshii={urllib.parse.quote(hoshii)}&noalpha={urllib.parse.quote(noalpha)}&rainbow={urllib.parse.quote(rainbow)}") await i.response.send_message( - f"https://gsapi.cbrx.io/image?top={top}&bottom={bottom}&type={type}&q={quality}&hoshii={hoshii}&noalpha={noalpha}&rainbow={rainbow}" + embed=embed ) diff --git a/cogs/afk.py b/cogs/afk.py index f2e2eb2..97cef3c 100644 --- a/cogs/afk.py +++ b/cogs/afk.py @@ -2,7 +2,7 @@ from discord import app_commands from replit import db import discord - +from color import color def afk_set_db(key, data): db[f"afk_{key}"] = data @@ -21,17 +21,45 @@ def __init__(self, bot: commands.Bot) -> None: async def afks(self, i: discord.Interaction, reason: str): try: afk_set_db(int(i.user.id), reason) - await i.response.send_message("afkをセットしました!") + await i.response.send_message( + embed=discord.Embed( + title="<:check_mark:985366958537076766> : 成功", + description="afkをセットしました。", + color=color, + ), + ephemeral=True, + ) except: - await i.response.send_message("afkをセットできませんでした。", ephemeral=True) + await i.response.send_message( + embed=discord.Embed( + title="<:error_mark:985366305156767794> : 失敗", + description="何らかのエラーが発生しました。", + color=color, + ), + ephemeral=True, + ) @app_commands.command(name="afk_kaizyo", description="afkを解除します") async def afkk(self, i: discord.Interaction): try: afk_set_db(int(i.user.id), False) - await i.response.send_message("afkを解除しました!") + await i.response.send_message( + embed=discord.Embed( + title="<:check_mark:985366958537076766> : 成功", + description="afkを解除しました。", + color=color, + ), + ephemeral=True, + ) except: - await i.response.send_message("afkを解除できませんでした。", ephemeral=True) + await i.response.send_message( + embed=discord.Embed( + title="<:error_mark:985366305156767794> : 失敗", + description="何らかのエラーが発生しました。", + color=color, + ), + ephemeral=True, + ) @commands.Cog.listener(name="on_message") async def afk_msg(self, message: discord.Message): diff --git a/color.py b/color.py new file mode 100644 index 0000000..b83fa77 --- /dev/null +++ b/color.py @@ -0,0 +1 @@ +color = 0x3498DB \ No newline at end of file