rmtrollbot 1.0.4 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/index.mts +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,5 +22,18 @@ bot.onUserUpdate((data)=>{
|
|
|
22
22
|
console.log("user list updated!")
|
|
23
23
|
})
|
|
24
24
|
```
|
|
25
|
+
## New for v1.1.0!
|
|
26
|
+
You can now change the bot's name, and color!
|
|
27
|
+
```ts
|
|
28
|
+
bot.changeName("i clanker")
|
|
29
|
+
bot.changeColor("black")
|
|
30
|
+
bot.changeBack()
|
|
31
|
+
```
|
|
32
|
+
It also has anti-colorcrash
|
|
33
|
+
```ts
|
|
34
|
+
bot.changeColor("#272822") // NICE TRY!!
|
|
35
|
+
```
|
|
36
|
+
# Extensions
|
|
37
|
+
[rmtrollbot-decode](https://www.npmjs.com/package/rmtrollbot-decode?activeTab=readme): Decoder for rmtrollbot
|
|
25
38
|
# Bots using this package
|
|
26
39
|
None have been recorded, but please use this package
|
package/index.mts
CHANGED
|
@@ -82,4 +82,20 @@ export class TrollBot {
|
|
|
82
82
|
disconnect() {
|
|
83
83
|
this.socket.disconnect()
|
|
84
84
|
}
|
|
85
|
+
changeNick(newn: string) {
|
|
86
|
+
this.name = newn
|
|
87
|
+
this.socket.emit("user joined", this.name, this.color, "bot", "")
|
|
88
|
+
}
|
|
89
|
+
changeColor(newc: string) {
|
|
90
|
+
if (!newc.includes("272822")) {
|
|
91
|
+
this.color = newc
|
|
92
|
+
this.socket.emit("user joined", this.name, this.color, "bot", "")
|
|
93
|
+
} else {
|
|
94
|
+
this.socket.send("NICE TRY!!")
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
changeBack() {
|
|
98
|
+
[this.name, this.color] = [this.ogcolor, this.ogname]
|
|
99
|
+
this.socket.emit("user joined", this.name, this.color, "bot", "")
|
|
100
|
+
}
|
|
85
101
|
}
|