From abbb02f07ae712cc069a33407c5fe19581d8d7ec Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Mon, 2 May 2022 13:41:48 -0600 Subject: [PATCH] Add nsfw filter on message sending --- jarvis/cogs/reddit.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jarvis/cogs/reddit.py b/jarvis/cogs/reddit.py index cc51246..934d804 100644 --- a/jarvis/cogs/reddit.py +++ b/jarvis/cogs/reddit.py @@ -255,7 +255,8 @@ class RedditCog(Scale): return embeds = await self.post_embeds(subreddit, post) - await ctx.send(embeds=embeds) + ephemeral = post.over_18 and not ctx.channel.nsfw + await ctx.send(embeds=embeds, ephemeral=ephemeral) @reddit.subcommand(sub_cmd_name="top", sub_cmd_description="Get the top post of a subreddit") @slash_option( @@ -325,7 +326,8 @@ class RedditCog(Scale): return embeds = await self.post_embeds(subreddit, post) - await ctx.send(embeds=embeds) + ephemeral = post.over_18 and not ctx.channel.nsfw + await ctx.send(embeds=embeds, ephemeral=ephemeral) @reddit.subcommand( sub_cmd_name="rising", sub_cmd_description="Get a rising post of a subreddit" @@ -354,7 +356,8 @@ class RedditCog(Scale): return embeds = await self.post_embeds(subreddit, post) - await ctx.send(embeds=embeds) + ephemeral = post.over_18 and not ctx.channel.nsfw + await ctx.send(embeds=embeds, ephemeral=ephemeral) def setup(bot: Snake) -> None: