#Get rid of non-nullish operator

1 messages · Page 1 of 1 (latest)

strong cedar

How to remove the need of non-nullish operator in this code?

  if (
      !guild.members
        .me!.permissionsIn(interaction.channel as GuildChannelResolvable)
        .has('CreatePublicThreads')
    ) {
      return interaction.editReply(...);
    }

I am using interaction.inCachedGuild() typeguard also but still this issue happens