Skip to content

Commit

Permalink
Avoid HTTP fetch where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
tazz4843 committed Nov 14, 2024
1 parent 1f099ac commit 2359e3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions scripty_commands/src/cmds/automod/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ pub async fn automod_setup(
let target_permissions = {
let bot_id = ctx.framework().bot_id();
let bot_member = ctx
.http()
.get_member(ctx.guild_id().expect("asserted in guild"), bot_id)
.guild_id()
.expect("asserted in guild")
.member(&ctx, bot_id)
.await?;
ctx.guild()
.expect("asserted in guild")
Expand Down
5 changes: 3 additions & 2 deletions scripty_commands/src/cmds/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ pub async fn join(
let permissions = {
let bot_id = ctx.framework().bot_id();
let bot_member = ctx
.http()
.get_member(ctx.guild_id().expect("asserted in guild"), bot_id)
.guild_id()
.expect("asserted in guild")
.member(&ctx, bot_id)
.await?;
ctx.guild()
.expect("asserted in guild")
Expand Down

0 comments on commit 2359e3b

Please sign in to comment.