aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-04-29 00:40:47 -0500
committermat <github@matdoes.dev>2022-04-29 00:40:47 -0500
commit3bd32cfa00e8b50b47267ab75a4ff8892ae89d54 (patch)
treeb159bc4e7a4f27b7ffd25505d081e5dd12b285de /README.md
parentb6fb96429c4530530f46e5deb5998f2249e5124e (diff)
downloadazalea-drasl-3bd32cfa00e8b50b47267ab75a4ff8892ae89d54.tar.xz
how do i do this
Diffstat (limited to 'README.md')
-rwxr-xr-xREADME.md18
1 files changed, 9 insertions, 9 deletions
diff --git a/README.md b/README.md
index 6502b0ae..10e94325 100755
--- a/README.md
+++ b/README.md
@@ -17,15 +17,15 @@ I named this Azalea because it sounds like a cool word and this is a cool librar
Note that this doesn't work yet, it's just how I want the API to look.
```rs
-use azalea::{Bot, Event};
+use azalea::{Account, Event};
-let bot = Bot::offline("bot");
-// or let bot = azalea::Bot::microsoft("access token").await;
+let account = Account::offline("bot");
+// or let account = azalea::Account::microsoft("access token").await;
-bot.join("localhost".try_into().unwrap()).await.unwrap();
+let bot = account.join("localhost".try_into().unwrap()).await.unwrap();
loop {
- match bot.recv().await {
+ match bot.next().await {
Event::Message(m) {
if m.username == bot.username { return };
bot.chat(m.message).await;
@@ -42,17 +42,17 @@ loop {
You can use the `azalea::Bots` struct to control many bots as one unit.
```rs
-use azalea::{Bot, Bots, Event, pathfinder};
+use azalea::{Account, Accounts, Event, pathfinder};
#[tokio::main]
async fn main() {
- let bots = Bots::new();
+ let accounts = Accounts::new();
for i in 0..10 {
- bots.add(Bot::offline(format!("bot{}", i)));
+ accounts.add(Account::offline(format!("bot{}", i)));
}
- bots.join("localhost".try_into().unwrap()).await.unwrap();
+ let bots = accounts.join("localhost".try_into().unwrap()).await.unwrap();
bots.goto(pathfinder::GotoGoal(azalea::BlockCoord(0, 70, 0))).await;