Skip to content

Commit

Permalink
fix: check for message history permission
Browse files Browse the repository at this point in the history
  • Loading branch information
sebm253 committed Jul 24, 2024
1 parent 4ce05f7 commit 5e9983f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func messageListener(ev *events.GenericGuildMessage, bot *internal.Bot) {
permissions := caches.MemberPermissionsInChannel(channel, selfMember)
debugLogger.Debug("dearrow: permissions in channel", slog.Any("channel.id", ev.ChannelID), slog.Any("permissions", permissions))

if permissions.Missing(discord.PermissionSendMessages, discord.PermissionManageMessages, discord.PermissionEmbedLinks) {
if permissions.Missing(discord.PermissionSendMessages, discord.PermissionManageMessages, discord.PermissionEmbedLinks, discord.PermissionReadMessageHistory) {
debugLogger.Debug("dearrow: ignoring message due to missing permissions",
slog.Any("channel.id", ev.ChannelID),
slog.Any("message.id", ev.MessageID),
Expand Down

0 comments on commit 5e9983f

Please sign in to comment.