From 6b0e059b569ae334ef35732945b4a0e9293a63fc Mon Sep 17 00:00:00 2001 From: WahPlus Date: Fri, 1 May 2026 08:33:37 +0300 Subject: [PATCH] Fixed /say --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 314b11d..72c6fef 100644 --- a/main.py +++ b/main.py @@ -254,8 +254,11 @@ async def gamble(interaction: nextcord.Interaction, bet: float): @bot.slash_command() async def say(interaction: nextcord.Interaction, text: str = "", attachment: nextcord.Attachment = None): if interaction.user.id == 1043523548339241001: - data = await attachment.read() - await interaction.channel.send(text, file = nextcord.File(io.BytesIO(data), filename=attachment.filename)) + file = None + if attachment: + data = await attachment.read() + file = nextcord.File(io.BytesIO(data), filename=attachment.filename) + await interaction.channel.send(text, file = file) await interaction.send("OK", ephemeral=True) else: await interaction.send("Wrong guy", ephemeral=True)