Skip to content

Commit b0253b0

Browse files
committed
Fix panic when Message::author_permissions cannot find channel
1 parent 06fac58 commit b0253b0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/dispatch/permissions/prefix/cache.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ pub(in crate::dispatch::permissions) async fn get_author_and_bot_permissions<U,
1717
let author_permissions = if skip_author {
1818
None
1919
} else {
20-
let err_msg = "should only fail if the guild is not cached";
21-
Some(ctx.msg.author_permissions(ctx.cache()).expect(err_msg))
20+
Some(ctx.msg.author_permissions(ctx.cache())?)
2221
};
2322

2423
let bot_permissions = if skip_bot {

0 commit comments

Comments
 (0)