aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Perry <np@npry.dev>2025-12-17 20:40:44 -0500
committerNathan Perry <np@npry.dev>2025-12-17 21:13:46 -0500
commitde49f346313e7739945fbf0058bdfb78c90237a6 (patch)
tree99528908ff7ca5f5a39b1a727650bf3a1ccad721
parent13fcc8a263970e48999e7f9319876a6443a54ac5 (diff)
update poise to not use custom fork
-rw-r--r--Cargo.lock16
-rw-r--r--Cargo.toml2
-rw-r--r--src/commands/mod.rs5
-rw-r--r--src/util/mod.rs40
4 files changed, 26 insertions, 37 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",
@@ -3348,12 +3348,6 @@ dependencies = [
]
[[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"
source = "registry+https://github.com/rust-lang/crates.io-index"
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<poise::Command<crate::PoiseData, anyhow::Error>> {
/// Print this help text.
#[poise::command(prefix_command, aliases("halp"))]
pub async fn help(ctx: PoiseContext<'_>, command: Option<String>) -> 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<U, E>) -> Option<&'a Message> {
msg,
..
}
- | NonCommandMessage {
- msg,
- ..
- }
| DynamicPrefix {
msg,
..
@@ -140,17 +132,19 @@ pub async fn send(
pub async fn reply<U, E>(
ctx: poise::Context<'_, U, E>,
text: impl AsRef<str>,
-) -> Result<poise::ReplyHandle<'_>, serenity::Error> {
- let handle = poise::send_reply(
- ctx,
- CreateReply::default()
- .tts(unwrap_tts(ctx))
- .content(text.as_ref())
- .allowed_mentions(Default::default()),
- )
- .await?;
+) -> 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());
- Ok(handle)
+ let channel = ctx.guild_channel().await.ok_or_else(|| anyhow::anyhow!("not in a guild"))?;
+ channel.send_message(ctx.http(), reply).await?;
+
+ Ok(())
}
#[inline]