I am new to rust and i try to remake a discord bot that i had made in python to help me learn some basics. I see in the serenity documentation that there is a event called when a user joins the server. I use the default_channel variable stored in the new_member with a match statement but it always return None and i can’t find why.
async fn guild_member_addition(&self, ctx: Context, new_member: Member) {
//Get the default channel ID
//let default_channel_id = 718229675473633341;
match new_member.default_channel(&ctx.cache){
Some(default_channel) => {
println!("channel {:?}", default_channel);
},
None => {
println!("Couldn't retrieve channel");
}
}
}
I tried the bot in multiple servers, but none worked. I also doubled checked that the bot had all the necessary permissions.
New contributor
user24637847 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.