From 0f88e05a0cfe43c910f130f8e70f51055d9f6fd2 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sun, 16 Oct 2022 23:08:39 -0500 Subject: Add chat function (#28) * add Client::chat * make the default bot do chat --- bot/src/main.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'bot/src') diff --git a/bot/src/main.rs b/bot/src/main.rs index 92786ce1..beed4320 100644 --- a/bot/src/main.rs +++ b/bot/src/main.rs @@ -10,7 +10,7 @@ struct State {} async fn main() -> anyhow::Result<()> { env_logger::init(); - let account = Account::microsoft("example2@example.com").await?; + let account = Account::microsoft("example@example.com").await?; azalea::start(azalea::Options { account, @@ -26,8 +26,14 @@ async fn main() -> anyhow::Result<()> { } async fn handle(bot: Client, event: Arc, _state: Arc>) -> anyhow::Result<()> { - if let Event::Tick = *event { - bot.jump(); + match *event { + Event::Login => { + bot.chat("Hello world").await?; + } + Event::Tick => { + bot.jump(); + } + _ => {} } Ok(()) -- cgit v1.2.3