mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 17:20:49 +00:00
Fix User/Role/Channel id parsing (#35)
* Import thiserror to make nicer errors * Create wrappers for id that exposes old parsing behavior (from mentions) * Use id wrappers when parsing parameters
This commit is contained in:
parent
431f295b41
commit
b4cf6ce94f
8 changed files with 91 additions and 21 deletions
|
@ -7,7 +7,7 @@ use serenity::{
|
|||
macros::{command, group},
|
||||
Args, CommandResult,
|
||||
},
|
||||
model::{channel::Message, id::UserId},
|
||||
model::channel::Message,
|
||||
utils::MessageBuilder,
|
||||
};
|
||||
use youmubot_prelude::*;
|
||||
|
@ -159,7 +159,7 @@ async fn name(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
|
|||
let user_id = if args.is_empty() {
|
||||
msg.author.id
|
||||
} else {
|
||||
args.single::<UserId>()?
|
||||
args.single::<UserId>()?.0
|
||||
};
|
||||
|
||||
let user_mention = if user_id == msg.author.id {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue