aboutsummaryrefslogtreecommitdiff
path: root/azalea
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-03-19 04:12:20 -0100
committermat <git@matdoes.dev>2026-03-19 04:12:20 -0100
commitb03d2942e1bef98e13acadde5cbb8856a3f8c74d (patch)
treef1be3cd3151c3194677001d520aedf2ad18f92b8 /azalea
parent176907fa8bc2c03f245b837f09a80d073856d4dd (diff)
downloadazalea-drasl-b03d2942e1bef98e13acadde5cbb8856a3f8c74d.tar.xz
implement speed effect
Diffstat (limited to 'azalea')
-rw-r--r--azalea/examples/testbot/commands.rs3
-rw-r--r--azalea/examples/testbot/commands/debug.rs8
-rw-r--r--azalea/examples/testbot/main.rs2
-rw-r--r--azalea/src/client_impl/chat.rs2
4 files changed, 13 insertions, 2 deletions
diff --git a/azalea/examples/testbot/commands.rs b/azalea/examples/testbot/commands.rs
index 930f41ca..4c0e7235 100644
--- a/azalea/examples/testbot/commands.rs
+++ b/azalea/examples/testbot/commands.rs
@@ -23,8 +23,9 @@ impl CommandSource {
pub fn reply(&self, message: impl Into<String>) {
let message = message.into();
if self.chat.is_whisper() {
+ // /msg instead of /w for compat with custom servers
self.bot
- .chat(format!("/w {} {message}", self.chat.sender().unwrap()));
+ .chat(format!("/msg {} {message}", self.chat.sender().unwrap()));
} else {
self.bot.chat(message);
}
diff --git a/azalea/examples/testbot/commands/debug.rs b/azalea/examples/testbot/commands/debug.rs
index 12f6d362..cd487abb 100644
--- a/azalea/examples/testbot/commands/debug.rs
+++ b/azalea/examples/testbot/commands/debug.rs
@@ -29,6 +29,14 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) {
source.reply("pong!");
1
}));
+ commands.register(
+ literal("say").then(argument("message", greedy_string()).executes(|ctx: &Ctx| {
+ let source = ctx.source.lock();
+ let message = get_string(ctx, "message").unwrap();
+ source.bot.chat(message);
+ 1
+ })),
+ );
commands.register(literal("disconnect").executes(|ctx: &Ctx| {
let source = ctx.source.lock();
diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs
index 63d83c8a..f5f6c096 100644
--- a/azalea/examples/testbot/main.rs
+++ b/azalea/examples/testbot/main.rs
@@ -120,7 +120,7 @@ pub struct State {
impl State {
fn new() -> Self {
Self {
- killaura: true,
+ killaura: false,
task: Arc::new(Mutex::new(BotTask::None)),
}
}
diff --git a/azalea/src/client_impl/chat.rs b/azalea/src/client_impl/chat.rs
index e71a208f..1a7359f7 100644
--- a/azalea/src/client_impl/chat.rs
+++ b/azalea/src/client_impl/chat.rs
@@ -33,6 +33,8 @@ impl Client {
/// Send a message in chat.
///
+ /// If the content starts with a `/`, a command is sent.
+ ///
/// ```rust,no_run
/// # use azalea::Client;
/// # async fn example(bot: Client) -> anyhow::Result<()> {