Update 'node/boto.js'

This commit is contained in:
Sarimoko 2022-02-12 22:32:41 +00:00
parent 60c472fedd
commit a29808a470
1 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ const rp = require('request-promise');
function getChatters(channelName, _attemptCount = 0) {
return rp({
uri: `https://tmi.twitch.tv/group/user/sarimoko/chatters`,
uri: `https://tmi.twitch.tv/group/user/${channelName}/chatters`,
json: true
})
.then(data => {
@ -85,11 +85,11 @@ client.on('message', (channel, tags, message, self) => {
getRandomChatter(chan, { skipList: [ userstate.username ] })
.then(user => {
if(user === null) {
client.send(chan, `${userstate.username}, there was no one to choose.`);
client.send(channel, `${userstate.username}, there was no one to choose.`);
}
else {
let { name, type } = user;
client.send(chan, `${userstate.username}, I chose "${name}" with type ${type}!`);
client.send(channel, `${userstate.username}, I chose "${name}" with type ${type}!`);
}
})
.catch(err => console.log('[ERR]', err));