Add `CustomContext`
@@ -53,6 +53,15 @@ cogs = [
]
+class CustomContext(commands.Context):
+ async def safe_send(self, content, **kwargs):
+ """Same as send except it escapes mentions.
+
+ Note: This does not escape channel mentions"""
+ content = discord.utils.escape_mentions(content)
+ return await self.send(content, **kwargs)
+
+
class Kurisu(commands.Bot):
"""Its him!!."""
def __init__(self, command_prefix, description):
@@ -126,6 +135,9 @@ class Kurisu(commands.Bot):
os.makedirs("data", exist_ok=True)
os.makedirs("data/ninupdates", exist_ok=True)
+ async def get_context(self, message, *, cls=CustomContext):
+ return await super().get_context(message, cls=cls)
+
def load_cogs(self):
for extension in cogs:
try:
