Add nsfw filter on message sending

This commit is contained in:
Zeva Rose 2022-05-02 13:41:48 -06:00
parent 82a8316a15
commit abbb02f07a

View file

@ -255,7 +255,8 @@ class RedditCog(Scale):
return return
embeds = await self.post_embeds(subreddit, post) 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") @reddit.subcommand(sub_cmd_name="top", sub_cmd_description="Get the top post of a subreddit")
@slash_option( @slash_option(
@ -325,7 +326,8 @@ class RedditCog(Scale):
return return
embeds = await self.post_embeds(subreddit, post) 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( @reddit.subcommand(
sub_cmd_name="rising", sub_cmd_description="Get a rising post of a subreddit" sub_cmd_name="rising", sub_cmd_description="Get a rising post of a subreddit"
@ -354,7 +356,8 @@ class RedditCog(Scale):
return return
embeds = await self.post_embeds(subreddit, post) 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: def setup(bot: Snake) -> None: