Examples: Fix serenity-next cache accesses (#99)
Serenity's cache design has changed, this (finally) prevents the examples from failing to compile on CI.
This commit is contained in:
@@ -179,7 +179,7 @@ async fn join(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
|
||||
},
|
||||
};
|
||||
|
||||
let guild = msg.guild(&ctx.cache).await.unwrap();
|
||||
let guild = msg.guild(&ctx.cache).unwrap();
|
||||
let guild_id = guild.id;
|
||||
|
||||
let manager = songbird::get(ctx).await
|
||||
@@ -227,7 +227,7 @@ async fn join(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
|
||||
#[command]
|
||||
#[only_in(guilds)]
|
||||
async fn leave(ctx: &Context, msg: &Message) -> CommandResult {
|
||||
let guild = msg.guild(&ctx.cache).await.unwrap();
|
||||
let guild = msg.guild(&ctx.cache).unwrap();
|
||||
let guild_id = guild.id;
|
||||
|
||||
let manager = songbird::get(ctx).await
|
||||
|
||||
Reference in New Issue
Block a user