const Channel = ["channel1","channel2","ETC"]; // Your channel's username
const Vimm = require("vimm-chat-lib-new")
const chat = new Vimm.VimmChat({
token: "BOT TOKEN HERE",
debug: false // Outputs heartbeat logs if true.
})
function Connect(){
chat.connect(Channel).then(meta => {
chat.on("message", msg => {
if (msg.roles[0].bot == true) return
// msg displays the following when a message is said in chat.
//{
// roles: [{
// admins: false,
// developer: false,
// broadcaster: false,
// moderators: false,
// bot: false,
// subscriber: false,
// premiumT1: false,
// premiumT2: false,
// premiumT3: false,
// supporter: false
// }]
// mtype: 'message',
// message: 'test',
// chatter: 'username',
// channel: 'channelname',
// prefix: '[bot]'
//}
if (msg.message == "!hey") {
chat.sendMessage("YOURCHANNELNAME", `HELLO THERE, NICE MEET YOU!`)
}
// BOT MESSAGE LAYOUT
//{
// roles: [{
// admins: false,
// developer: false,
// broadcaster: false,
// moderators: false,
// bot: true,
// subscriber: false,
// premiumT1: false,
// premiumT2: false,
// premiumT3: false,
// supporter: false
// }]
// mtype: 'message',
// message: 'HELLO THERE, NICE MEET YOU!',
// chatter: 'BOTNAME',
// channel: 'YOURCHANNEL',
// prefix: '[bot]'
//}
})
chat.on("close", event => {
if(event){ // removed due to the bot not connecting - if(event == 1006)
chat.connect(Channel) // If Abnormal disconnect (1006), Vimm Bot reconnects.
}
})
})
}
Connect() // Initiates connection to Vimm's WS Server.
-
Notifications
You must be signed in to change notification settings - Fork 1
Fork of https://github.com/GlobalGamer2015/Glimesh-Chat-Lib but Built in VimmTV Chat WSS
License
MIT, GPL-3.0 licenses found
Licenses found
MIT
LICENSE
GPL-3.0
COPYING
NekoSuneVR/Vimm-Chat-Lib
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Fork of https://github.com/GlobalGamer2015/Glimesh-Chat-Lib but Built in VimmTV Chat WSS
Resources
License
MIT, GPL-3.0 licenses found
Licenses found
MIT
LICENSE
GPL-3.0
COPYING
Stars
Watchers
Forks
Packages 0
No packages published