From de49f346313e7739945fbf0058bdfb78c90237a6 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Wed, 17 Dec 2025 20:40:44 -0500 Subject: update poise to not use custom fork --- Cargo.lock | 16 +++++----------- Cargo.toml | 2 +- src/commands/mod.rs | 5 +++-- src/util/mod.rs | 42 ++++++++++++++++++------------------------ 4 files changed, 27 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec37269..8c71a1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -1763,25 +1763,25 @@ dependencies = [ [[package]] name = "poise" version = "0.6.1" -source = "git+https://pub.npry.dev/poise#f72f91ad0c11f403e9ceee5b4581a348c38b3bb6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1819d5a45e3590ef33754abce46432570c54a120798bdbf893112b4211fa09a6" dependencies = [ "async-trait", "derivative", "futures-util", - "indexmap", "parking_lot", "poise_macros", "regex", "serenity", "tokio", "tracing", - "trim-in-place", ] [[package]] name = "poise_macros" version = "0.6.1" -source = "git+https://pub.npry.dev/poise#f72f91ad0c11f403e9ceee5b4581a348c38b3bb6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fa2c123c961e78315cd3deac7663177f12be4460f5440dbf62a7ed37b1effea" dependencies = [ "darling", "proc-macro2", @@ -3347,12 +3347,6 @@ dependencies = [ "strength_reduce", ] -[[package]] -name = "trim-in-place" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343e926fc669bc8cde4fa3129ab681c63671bae288b1f1081ceee6d9d37904fc" - [[package]] name = "triomphe" version = "0.1.13" diff --git a/Cargo.toml b/Cargo.toml index d4f83de..0c9a5be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,7 +73,7 @@ tokio = { version = "1.37", features = ["full"] } songbird = { version = "0.4", features = ["builtin-queue"] } symphonia = { version = "0.5", features = ["all"] } -poise = { git = "https://pub.npry.dev/poise" } +poise = "0.6" diesel = { version = "2.1", features = ["chrono"], optional = true } diesel-async = { version = "0.4", optional = true, features = ["deadpool", "postgres"] } diff --git a/src/commands/mod.rs b/src/commands/mod.rs index a5ee1bd..97a1abe 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -1,4 +1,4 @@ -use poise::builtins::PrettyHelpConfiguration; +use poise::builtins::HelpConfiguration; use crate::{ PoiseContext, @@ -42,7 +42,8 @@ pub fn commands() -> Vec> { /// Print this help text. #[poise::command(prefix_command, aliases("halp"))] pub async fn help(ctx: PoiseContext<'_>, command: Option) -> anyhow::Result<()> { - poise::builtins::pretty_help(ctx, command.as_deref(), PrettyHelpConfiguration { + poise::builtins::help(ctx, command.as_deref(), HelpConfiguration { + include_description: true, ..Default::default() }) .await?; diff --git a/src/util/mod.rs b/src/util/mod.rs index 2035054..79ab2b5 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -1,15 +1,7 @@ -use std::{ - collections::HashMap, - process::Stdio, -}; - use chrono::Duration; use grate::tracing; use lazy_static::lazy_static; -use poise::{ - CreateReply, - FrameworkError, -}; +use poise::FrameworkError; use regex::{ Match, Regex, @@ -33,6 +25,10 @@ use serenity::{ permissions::Permissions, }, }; +use std::{ + collections::HashMap, + process::Stdio, +}; use tap::Pipe; use url::Url; @@ -92,10 +88,6 @@ pub fn err_msg<'a, U, E>(err: &'a FrameworkError) -> Option<&'a Message> { msg, .. } - | NonCommandMessage { - msg, - .. - } | DynamicPrefix { msg, .. @@ -140,17 +132,19 @@ pub async fn send( pub async fn reply( ctx: poise::Context<'_, U, E>, text: impl AsRef, -) -> Result, serenity::Error> { - let handle = poise::send_reply( - ctx, - CreateReply::default() - .tts(unwrap_tts(ctx)) - .content(text.as_ref()) - .allowed_mentions(Default::default()), - ) - .await?; - - Ok(handle) +) -> anyhow::Result<()> { + let msg = msg(ctx).ok_or_else(|| anyhow::anyhow!("couldn't find referenced message"))?; + + let reply = CreateMessage::new() + .reference_message(msg) + .tts(msg.tts) + .content(text.as_ref()) + .allowed_mentions(Default::default()); + + let channel = ctx.guild_channel().await.ok_or_else(|| anyhow::anyhow!("not in a guild"))?; + channel.send_message(ctx.http(), reply).await?; + + Ok(()) } #[inline] -- cgit v1.3.1