From 5b208ddb786fa62ddacd48bffb39efd50d5a3b0f Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 2 Jun 2021 23:30:58 -0500 Subject: [PATCH] discord: fix /posts command inside DMs Fix a bug where the /posts command failed when used in a DM channel, because we were trying to fetch a `nsfw` key that didn't exist. --- app/logical/discord_slash_command/post_embed.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/logical/discord_slash_command/post_embed.rb b/app/logical/discord_slash_command/post_embed.rb index e6570c409..e19c26236 100644 --- a/app/logical/discord_slash_command/post_embed.rb +++ b/app/logical/discord_slash_command/post_embed.rb @@ -61,7 +61,7 @@ class DiscordSlashCommand end def is_nsfw_channel? - command.channel.fetch("nsfw") + command.channel.fetch("nsfw", false) end end end