From e8fbebcbaa1a5af6026ef42b480966570dde8c7a Mon Sep 17 00:00:00 2001 From: osmarks Date: Wed, 25 Nov 2020 17:34:19 +0000 Subject: [PATCH] allowed mentions hotfix --- src/achievement.py | 3 ++- src/main.py | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/achievement.py b/src/achievement.py index ea8bb99..2f56403 100644 --- a/src/achievement.py +++ b/src/achievement.py @@ -23,6 +23,7 @@ achievements = { async def achieve(bot: commands.Bot, message: discord.Message, achievement): guild_conf = await bot.database.execute_fetchone("SELECT achievement_messages FROM guild_config WHERE id = ?", (message.guild.id,)) if guild_conf and guild_conf["achievement_messages"] == 0: return + channel = message.channel uid = message.author.id # ensure the user doesn't have achievements off @@ -38,7 +39,7 @@ async def achieve(bot: commands.Bot, message: discord.Message, achievement): description = f"Congratulations, {message.author.name}#{message.author.discriminator}! You achieved the achievement __{achievement_info.name}__.\n\n{achievement_info.description}\n*{achievement_info.condition}*" e = util.make_embed(description=description, title="Achievement achieved!", color=util.hashbow(achievement)) e.set_thumbnail(url=await util.get_asset(bot, f"achievements/{achievement}.png")) - await message.channel.send(embed=e) + await channel.send(embed=e) await bot.database.execute("INSERT INTO achievements VALUES (?, ?, ?)", (uid, achievement, util.timestamp())) await bot.database.commit() logging.info("awarded achievement %s to %s", message.author.name, achievement) diff --git a/src/main.py b/src/main.py index 2326e0d..05b4f7f 100644 --- a/src/main.py +++ b/src/main.py @@ -22,7 +22,8 @@ config = util.config logging.basicConfig(level=logging.INFO, format="%(levelname)s %(asctime)s %(message)s", datefmt="%H:%M:%S %d/%m/%Y") -bot = commands.Bot(command_prefix=config["prefix"], description="AutoBotRobot, the most useless bot in the known universe.", case_insensitive=True) +bot = commands.Bot(command_prefix=config["prefix"], description="AutoBotRobot, the most useless bot in the known universe.", + case_insensitive=True, allowed_mentions=discord.AllowedMentions(everyone=False, users=True, roles=True)) bot._skip_check = lambda x, y: False @@ -162,9 +163,9 @@ You can also invite it to your server: