From 5c0c04548622360a5f9baf14182a2bba4faa644e Mon Sep 17 00:00:00 2001 From: nitsuga5124 Date: Sun, 13 Sep 2020 12:21:32 +0200 Subject: [PATCH] Fix example 5's retrieval of owners when the bot belongs to a team (#960) --- examples/e05_command_framework/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/e05_command_framework/src/main.rs b/examples/e05_command_framework/src/main.rs index e30eecac262..0ece65cc122 100644 --- a/examples/e05_command_framework/src/main.rs +++ b/examples/e05_command_framework/src/main.rs @@ -201,7 +201,11 @@ async fn main() { let (owners, bot_id) = match http.get_current_application_info().await { Ok(info) => { let mut owners = HashSet::new(); - owners.insert(info.owner.id); + if let Some(team) = info.team { + owners.insert(team.owner_user_id); + } else { + owners.insert(info.owner.id); + } (owners, info.id) },