socket.send sends a message slowly
Closed this issue · 2 comments
josiauh commented
I try to use this, but it has slow message cooldowns.
tb = require("trollbox-bot")
tb.connect("FunkBot (funk!)","#00FFFF","funk!","Welcome Funkers")
tb.onconnect = function(socket) {
//commands here
tb.setcommand("help",function(data, socket) {
socket.send("Hello, I am FunkBot! Use any command prefixed funk! and here they are! help: the current command you run XD, funfact: Get A Fact!, beep: beep bop skbeep?, dev: Developer of FunkBot! V1 of FunkBot, Beep?")
})
tb.setcommand("dev",function(data, socket) {
socket.send("I was developed by Josiah! He comes around!")
})
tb.setcommand("funfact",function(data, socket) {
socket.send("Tryna develop, by the way, here are some things about the command!")
socket.send("Gets a FNF fact.")
socket.send("10 facts for you!")
socket.send("Web Facts included!")
})
tb.setcommand("beep",function(data, socket) {
socket.send("skbeep debop ebop!")
})
}
It's like a minute or a second, or even a day!
codingMASTER398 commented
This is not an issue with the code, more likely trollbox.
You can only send 1 message per second in trollbox, this applies to your bot as well.
Try this instead of calling it so many times.
socket.send(`Tryna develop, by the way, here are some things about the command!
Gets a FNF fact.
10 facts for you!
Web Facts included!`)
btw can you credit me in the developer section
Your welcome!
josiauh commented
This is not an issue with the code, more likely trollbox.
You can only send 1 message per second in trollbox, this applies to your bot as well.
Try this instead of calling it so many times.socket.send(`Tryna develop, by the way, here are some things about the command! Gets a FNF fact. 10 facts for you! Web Facts included!`)btw can you credit me in the developer section
Your welcome!
Nvm, I found out I can use \n
to make breaks, but I would prefer that