Skip to content

Commit

Permalink
Fix panic when Message::author_permissions cannot find channel
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev committed Nov 15, 2024
1 parent 06fac58 commit b0253b0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/dispatch/permissions/prefix/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ pub(in crate::dispatch::permissions) async fn get_author_and_bot_permissions<U,
let author_permissions = if skip_author {
None
} else {
let err_msg = "should only fail if the guild is not cached";
Some(ctx.msg.author_permissions(ctx.cache()).expect(err_msg))
Some(ctx.msg.author_permissions(ctx.cache())?)
};

let bot_permissions = if skip_bot {
Expand Down

0 comments on commit b0253b0

Please sign in to comment.