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:
Natsu Kagami 2024-02-28 18:02:42 +00:00 committed by GitHub
parent 431f295b41
commit b4cf6ce94f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 91 additions and 21 deletions

View file

@ -289,7 +289,7 @@ pub async fn save(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult
pub async fn forcesave(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
let data = ctx.data.read().await;
let osu = data.get::<OsuClient>().unwrap();
let target = args.single::<serenity::model::id::UserId>()?;
let target = args.single::<UserId>()?.0;
let username = args.quoted().trimmed().single::<String>()?;
let user: Option<User> = osu