Fix YOTLD message

This commit is contained in:
Nexus 2023-05-04 14:32:01 +01:00
parent 908d2ed71a
commit c418f002ab
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -308,13 +308,13 @@ class Events(commands.Cog):
await message.reply("Unmute me >:(", file=discord.File(file)) await message.reply("Unmute me >:(", file=discord.File(file))
else: else:
def after(e): def after(err):
asyncio.run_coroutine_threadsafe( asyncio.run_coroutine_threadsafe(
_dc(voice), _dc(voice),
self.bot.loop self.bot.loop
) )
if e is not None: if err is not None:
console.log(f"Error playing audio: {e}") console.log(f"Error playing audio: {err}")
# noinspection PyTypeChecker # noinspection PyTypeChecker
src = discord.FFmpegPCMAudio(str(file.absolute()), stderr=subprocess.DEVNULL) src = discord.FFmpegPCMAudio(str(file.absolute()), stderr=subprocess.DEVNULL)
@ -398,6 +398,11 @@ class Events(commands.Cog):
except discord.HTTPException as e: except discord.HTTPException as e:
console.log("Failed to add gay reaction:", e) console.log("Failed to add gay reaction:", e)
if all(x in message.content.lower() for x in ("year", "linux", "desktop")):
date = discord.utils.utcnow()
# date = date.replace(year=date.year + 1)
return await message.reply(date.strftime("%Y") + " will be the year of the GNU+Linux desktop.")
if self.bot.user in message.mentions: if self.bot.user in message.mentions:
if message.content.startswith(self.bot.user.mention): if message.content.startswith(self.bot.user.mention):
if message.content.lower().endswith("bot"): if message.content.lower().endswith("bot"):
@ -418,16 +423,6 @@ class Events(commands.Cog):
text=f"Pos: {pos*100:.2f}% | Neutral: {neut*100:.2f}% | Neg: {neg*100:.2f}%" text=f"Pos: {pos*100:.2f}% | Neutral: {neut*100:.2f}% | Neg: {neg*100:.2f}%"
) )
return await message.reply(embed=embed) return await message.reply(embed=embed)
if message.content.lower().endswith(
(
"when is the year of the linux desktop?",
"year of the linux desktop?",
"year of the linux desktop",
)
):
date = discord.utils.utcnow()
# date = date.replace(year=date.year + 1)
return await message.reply(date.strftime("%Y") + " will be the year of the GNU+Linux desktop.")
if message.content.lower().endswith("fuck you"): if message.content.lower().endswith("fuck you"):
student = await get_or_none(Student, user_id=message.author.id) student = await get_or_none(Student, user_id=message.author.id)