-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d04240b
commit 9795b0c
Showing
25 changed files
with
1,757 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless | ||
|
||
# FuseBox cache | ||
.fusebox/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,110 +1,15 @@ | ||
//Shared Dependancies | ||
const config = require('./config'); | ||
const prefix = config.prefix; | ||
const colors = require('colors/safe') | ||
|
||
//Twitch Bot Dependancies | ||
const tmi = require("tmi.js"); | ||
|
||
//Discord Bot Dependancies | ||
const Discord = require('discord.js'); | ||
const Enmap = require("enmap"); | ||
const fs = require("fs"); | ||
|
||
const HypnoticDiscord = require('./discord') | ||
HypnoticDiscord() | ||
|
||
const HypnoticTwitch = require('./twitch') | ||
HypnoticTwitch() | ||
|
||
//Discord Bot Start | ||
const client = new Discord.Client(); | ||
client.commands = new Enmap(); | ||
|
||
//Logging | ||
client.on('messageDelete', async message => { | ||
const log = client.channels.cache.get(config.DiscordLogs); | ||
var embed = new Discord.MessageEmbed().setColor(`${config.embedColor}`).setAuthor('Message Deleted', message.guild.iconURL).addField('User', message.author.tag).addField('Message', message.content).addField('Channel', message.channel).setTimestamp() | ||
if (message.author == client.user.id) return; | ||
else return log.send(embed) | ||
}); | ||
|
||
client.on("messageUpdate", function(oldMessage, newMessage) { | ||
const log = client.channels.cache.get(config.DiscordLogs); | ||
var embed = new Discord.MessageEmbed().setColor(`${config.embedColor}`).setAuthor(`Message Edited`).setDescription(`**User:** \n${oldMessage.author.tag}\n\n**Old Message:** \n${oldMessage.content}\n\n**New Message:** \n${newMessage.content}`).addField('Channel', `${oldMessage.channel}`).setTimestamp() | ||
if (oldMessage.author == client.user.id) return; | ||
else return log.send(embed) | ||
}); | ||
|
||
//Event Handler | ||
fs.readdir("./events/", (err, files) => { | ||
if (err) return console.error(err); | ||
files.forEach(file => { | ||
const event = require(`./events/${file}`); | ||
let eventName = file.split(".")[0]; | ||
client.on(eventName, event.bind(null, client)); | ||
console.log(colors.green(`${eventName} Event ✅`)); | ||
}); | ||
}); | ||
console.clear() | ||
const figlet = require('figlet'); | ||
const colors = require('colors/safe') | ||
|
||
//Command Handler | ||
fs.readdir("./commands/", (err, files) => { | ||
figlet(`Discord x Twitch`, function(err, data) { | ||
if (err) return console.error(err); | ||
files.forEach(file => { | ||
if (!file.endsWith(".js")) return; | ||
let props = require(`./commands/${file}`); | ||
let commandName = file.split(".")[0]; | ||
console.log(colors.green(`${commandName} Command ✅`)); | ||
client.commands.set(commandName, props); | ||
}); | ||
}); | ||
client.login(config.token); | ||
//Discord Bot Finish | ||
|
||
|
||
|
||
//Twitch Bot Start | ||
const identityconfig = { | ||
options: { | ||
debug: true | ||
}, | ||
connection: { | ||
cluster: "aws", | ||
reconnect: true | ||
}, | ||
identity: { | ||
username: config.username, | ||
password: config.oauth | ||
}, | ||
channels: config.channels | ||
} | ||
|
||
//Login/Connect Twitch | ||
var twitchclient = new tmi.client(identityconfig) | ||
twitchclient.connect(); | ||
twitchclient.on("connected", (address, port) => { | ||
console.log(colors.green(`Twitch Bot Online ✅`)) | ||
}) | ||
|
||
//Set Logging Level | ||
twitchclient.log.setLevel('warn') | ||
|
||
//Main Function/Handler | ||
twitchclient.on("chat", async(channel, user, message, self) => { | ||
if (self) return; | ||
const args = message.slice(prefix.length).trim().split(/ +/g); | ||
const cmd = args.shift().toLowerCase(); | ||
//Command Handler | ||
try { | ||
let commandFile = require(`./twitch_cmds/${cmd}.js`) | ||
commandFile.run(twitchclient, message, args, user, channel, self) | ||
} catch (err) {} | ||
|
||
//Chat Logger | ||
const log = client.channels.cache.get(config.TwitchLogs); | ||
const ChatEmbed = new Discord.MessageEmbed() | ||
.setAuthor(`Message Sent by ${user.username}`) | ||
.setTitle(`New Message on ${channel}'s Channel`) | ||
.addField('Message Content:', `${message}`) | ||
.setFooter('Message Sent') | ||
.setColor(config.embedColor) | ||
.setTimestamp(); | ||
return log.send(ChatEmbed) | ||
}) | ||
//Twitch Bot End | ||
console.log(colors.cyan(data)); | ||
console.log('Created by ' + colors.brightCyan(`HypnoticSiege - https://hypnoticsiege.net`)) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,33 @@ | ||
module.exports = { | ||
//Twitch Bot Configuration | ||
username: 'hypnoticsiege', | ||
//Get yours at https://twitchapps.com/tmi/ | ||
oauth: 'oauth:YOURTOKEN', | ||
channels: ['hypnoticsiege'], | ||
discord: { | ||
token: "NzgxMTY0MjE4NjYxMzM5MTc2.X75p3w.GStgV70ZV98-lz5QTK7qBQbvJJo", //Get yours at https://discord.com/developers/applications/ | ||
|
||
//Discord Configuration | ||
//Get yours at https://discord.com/developers/applications/ | ||
token: "YOUR_TOKEN_HERE", | ||
DiscordLogs: "829169768703459338", | ||
TwitchLogs: "829169768703459338", | ||
logs: { | ||
discord: { | ||
enabled: true, | ||
channel: '909654880669560902' | ||
}, | ||
|
||
//Shared Configuration | ||
prefix: '!', | ||
embedColor: 'BLUE', | ||
twitch: { | ||
enabled: true, | ||
channel: '924332370860052541' | ||
} | ||
}, | ||
|
||
embed: { | ||
color: 'BLUE', | ||
footer: 'Hypnotic Development', | ||
logo: 'https://hypnoticsiege.net/images/uploads/logo.png' | ||
} | ||
}, | ||
|
||
twitch: { | ||
oauth: 'oauth:1sy6feu1mdrs3mktj7b6vqvx5o9x9n', //Get yours at https://twitchapps.com/tmi/ | ||
channels: ['hypnoticsiege'], | ||
username: 'hypnoticsiege' | ||
}, | ||
|
||
shared: { | ||
prefix: '!', | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
events/guildMemberRemove.js → discord/events/guildMemberRemove.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = async client => { | ||
client.user.setActivity(client.config.twitch.channels[0], { | ||
type: "WATCHING", | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
events/voiceStateUpdate.js → discord/events/voiceStateUpdate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.