diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2022-10-16 23:08:39 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-16 23:08:39 -0500 |
| commit | 0f88e05a0cfe43c910f130f8e70f51055d9f6fd2 (patch) | |
| tree | dd1b899c7b90ae80b13bb0c84b44615dde63c7b1 /bot | |
| parent | ab9e50b1307012b698d826a1f4d04b347ee2203f (diff) | |
| download | azalea-drasl-0f88e05a0cfe43c910f130f8e70f51055d9f6fd2.tar.xz | |
Add chat function (#28)
* add Client::chat
* make the default bot do chat
Diffstat (limited to 'bot')
| -rw-r--r-- | bot/src/main.rs | 12 |
1 files changed, 9 insertions, 3 deletions
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<Event>, _state: Arc<Mutex<State>>) -> anyhow::Result<()> { - if let Event::Tick = *event { - bot.jump(); + match *event { + Event::Login => { + bot.chat("Hello world").await?; + } + Event::Tick => { + bot.jump(); + } + _ => {} } Ok(()) |
