chatting
getting them
you can listen for chat messages with bot.on('chat', callback).
player is sometimes undefined because of MOD and SERVER messages, which is when a game dev or mod sends a chat message. if player is undefined, flags will either be 255 (for server) or 254 (for mod).
sending them
send chat messages with bot.emit('chat', message).
chat sending has quite a few limitations. if the bot is in a private game, messages can always be sent.
if the bot is in a public game, the bot's account must be aged (see isAged) or have a verified email. additionally, there is a requirement that the account has at least 1 lifetime kill.
for chatting in public games, there's also a ratelimit named chatLines:
- chatLines starts at 0
- every time you send a message, it increments by 1
- if it's >= 2, you can't send messages
- every 33ms,
Math.max(0, chatLines - 1 / (30 * 4))is run - if you unsuccessfully send a message, it doesn't increment
3960ms is the most optimized interval time if you're sending on a constant interval.