Skip to content

Commit

Permalink
detect moderators discord|twitch
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoDornelles committed Oct 16, 2020
1 parent cfe8435 commit 1f87ca8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ twitch.on("raw_message", (messageCloned, message) => {
}

// preparar para executar comandos
let is_moderator = message.tags["badges"].indexOf("moderator") != -1;
let is_highlight = message.tags["msg-id"] == 'highlighted-message';
let channel = message.params[0];
let params = message.params[1].slice(1).split(' ');
Expand All @@ -52,6 +53,7 @@ twitch.on("raw_message", (messageCloned, message) => {
commands.emit(command, params, {
is_twitch: true,
is_discord: false,
is_moderator: is_moderator,
send: (text) => {
twitch.say (channel, text);
}
Expand All @@ -67,15 +69,18 @@ discord.on('message', (message) => {
if (message.content[0] != "!") {
return;
}
console.log(message.author);

// preparar para executar comandos
let is_moderator = message.member.roles.cache.has("763399481332334683");
let params = message.content.slice(1).split(' ');
let command = params.shift().toLowerCase();

// chamar evento
commands.emit(command, params, {
is_twitch: false,
is_discord: true,
is_moderator: is_moderator,
send: (text) => {
message.reply(text);
}
Expand Down

0 comments on commit 1f87ca8

Please sign in to comment.