diff options
| author | 2020-07-28 16:04:10 +0800 | |
|---|---|---|
| committer | 2020-07-28 16:04:10 +0800 | |
| commit | 1c6e2f23a9b75be5e2a7e410c70fadfbf6c6b090 (patch) | |
| tree | b3a63e01edf95679488e929254d8ef08db7029c1 | |
| parent | Update IDs of Code Jam roles (diff) | |
Allow specifying a channel to send !embed embeds
| -rw-r--r-- | bot/cogs/bot.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bot/cogs/bot.py b/bot/cogs/bot.py index a79b37d25..79510739c 100644 --- a/bot/cogs/bot.py +++ b/bot/cogs/bot.py @@ -72,10 +72,14 @@ class BotCog(Cog, name="Bot"): @command(name='embed') @with_role(*MODERATION_ROLES) - async def embed_command(self, ctx: Context, *, text: str) -> None: - """Send the input within an embed to the current channel.""" + async def embed_command(self, ctx: Context, channel: Optional[TextChannel], *, text: str) -> None: + """Send the input within an embed to either a specified channel or the current channel.""" embed = Embed(description=text) - await ctx.send(embed=embed) + + if channel is None: + await ctx.send(embed=embed) + else: + await channel.send(embed=embed) def codeblock_stripping(self, msg: str, bad_ticks: bool) -> Optional[Tuple[Tuple[str, ...], str]]: """ |