diff options
| author | 2021-03-28 15:15:35 -0400 | |
|---|---|---|
| committer | 2021-03-28 15:15:35 -0400 | |
| commit | 00dd501b99d31b8ca4e6b1edb1638e64abe95ae3 (patch) | |
| tree | aa9014bf4609a19c6a71a9cd213ff9c2459a5e27 | |
| parent | Merge pull request #1486 from python-discord/feat/dmrelay (diff) | |
Filter codeblick escapes and allow no mentions for !raw command
| -rw-r--r-- | bot/exts/info/information.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py index c54ca96bf..ce35df470 100644 --- a/bot/exts/info/information.py +++ b/bot/exts/info/information.py @@ -6,7 +6,7 @@ from collections import defaultdict from typing import Any, DefaultDict, Dict, Mapping, Optional, Tuple, Union import fuzzywuzzy -from discord import Colour, Embed, Guild, Message, Role +from discord import AllowedMentions, Colour, Embed, Guild, Message, Role from discord.ext.commands import BucketType, Cog, Context, Paginator, command, group, has_any_role from bot import constants @@ -447,9 +447,9 @@ class Information(Cog): def add_content(title: str, content: str) -> None: paginator.add_line(f'== {title} ==\n') - # replace backticks as it breaks out of code blocks. Spaces seemed to be the most reasonable solution. - # we hope it's not close to 2000 - paginator.add_line(content.replace('```', '`` `')) + # Replace backticks as it breaks out of code blocks. + # An invisble character seemed to be the most reasonable solution. We hope it's not close to 2000. + paginator.add_line(content.replace('`', '`\u200b')) paginator.close_page() if message.content: @@ -468,7 +468,7 @@ class Information(Cog): add_content(title, transformer(item)) for page in paginator.pages: - await ctx.send(page) + await ctx.send(page, allowed_mentions=AllowedMentions.none()) @raw.command() async def json(self, ctx: Context, message: Message) -> None: |