about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2023-02-17 02:06:49 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2023-02-17 02:06:49 +0100
commitc611c0df87eb507515e1f5f52bfb8c7e177ed64b (patch)
treef7db43e38651badf370b579405387f959e619db5
parentBot: Use async functions for handling events (diff)
download2bored2walk-c611c0df87eb507515e1f5f52bfb8c7e177ed64b.tar.gz
2bored2walk-c611c0df87eb507515e1f5f52bfb8c7e177ed64b.tar.bz2
2bored2walk-c611c0df87eb507515e1f5f52bfb8c7e177ed64b.zip
Bot: Send message to discord on goal_reached
-rw-r--r--src/main.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.ts b/src/main.ts
index 226fa74..2a9d3fb 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -76,6 +76,10 @@ bot.once('spawn', async () => {
   }, 2000);
 })
 
+bot.on('goal_reached', async () => {
+  sendMessageToChannel(`Reached goal (${goal}) with ${bot.username}\n\tCoords: ${bot.entity?.position}\n\tDim: ${bot.game.dimension}\n\tHP: ${bot.health}`)
+})
+
 bot.on('entityMoved', async (entity: any) => {
   if (entity.player === null || entity.username === undefined) return
   if (entity.username === bot.username) return