aboutsummaryrefslogtreecommitdiffstats
path: root/bot/bot.py
diff options
context:
space:
mode:
authorGravatar Matteo Bertucci <[email protected]>2021-08-31 15:10:01 +0200
committerGravatar Matteo Bertucci <[email protected]>2021-08-31 15:10:01 +0200
commit9c02adc04a7949b1ed8a979420e513531d46e384 (patch)
tree55a92322268dac080a707004e72488c0e89a4636 /bot/bot.py
parentMigrate to Discord.py 2.0a0 (diff)
Trigger the bot on mentions
Since it is the only way to add bots to threads, it would make sense to be able to execute that command.
Diffstat (limited to 'bot/bot.py')
-rw-r--r--bot/bot.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/bot.py b/bot/bot.py
index 8e82d0c4..b877233e 100644
--- a/bot/bot.py
+++ b/bot/bot.py
@@ -8,6 +8,7 @@ from aiohttp import AsyncResolver, ClientSession, TCPConnector
from async_rediscache import RedisSession
from discord import DiscordException, Embed
from discord.ext import commands
+from discord.ext.commands import when_mentioned_or
from bot import constants
@@ -203,7 +204,7 @@ loop.run_until_complete(redis_session.connect())
bot = Bot(
redis_session=redis_session,
- command_prefix=constants.Client.prefix,
+ command_prefix=when_mentioned_or(constants.Client.prefix),
activity=discord.Game(name=f"Commands: {constants.Client.prefix}help"),
allowed_mentions=discord.AllowedMentions(everyone=False, roles=_allowed_roles),
intents=_intents,