This commit is contained in:
Lamp 2018-07-13 16:29:48 -07:00
parent c7df1baddc
commit 084de94694
No known key found for this signature in database
GPG Key ID: 0F1F8704BEDE369E
4 changed files with 19 additions and 15 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
/local/
node_modules/
node_modules/
.DS_Store

View File

@ -1,25 +1,28 @@
module.exports = {
"testmode": false,
"testmode": new Boolean(process.env.TEST),
"token": process.env.DISCORD_TOKEN,
"webhooks": {
"console": process.env.TOKEN_WEBHOOK_CONSOLE,
"welcome": process.env.TOKEN_WEBHOOK_WELCOME,
"console": process.env.WEBHOOK_CONSOLE.split("/"),
"welcome": process.env.WEBHOOK_WELCOME.split("/"),
},
"opID": "281134216115257344",
"guildID": "321819041348190249",
"guildID": this.testmode ? "" : "321819041348190249",
"channels": {
"main": "321819041348190249"
"main": this.testmode ? "" : "321819041348190249"
},
"mppname": "[discord.gg/k44Eqha]",
"disabledRooms": [
"RP Room",
"Legends of Alorgon {RP Room}",
"Legends of Alorgon",
"Breastmilk ♥ 7:45 AM"
]
],
}

View File

@ -18,7 +18,7 @@ console.error = function(){
console.warn = console.error;
console.info = console.log;
var webhook = new Discord.WebhookClient('405445543536623627', config.webhooks.console);
var webhook = new Discord.WebhookClient(config.webhooks.console[0], config.webhooks.console[1]);
function log2discord(str){
str = Array.from(str);
str = str.map(require('util').inspect);

View File

@ -1,22 +1,22 @@
// join/leave
(function(){
var webhook = new Discord.WebhookClient('404736784354770958', config.webhooks.welcome);
dClient.on('guildMemberAdd', member => {
(async function(){
var webhook = new Discord.WebhookClient(config.webhooks.welcome[0], config.webhooks.welcome[1]);
dClient.on('guildMemberAdd', async member => {
webhook.send(`${member} joined.`, {username: member.user.username, avatarURL: member.user.displayAvatarURL(), disableEveryone:true});
});
dClient.on('guildMemberRemove', member => {
dClient.on('guildMemberRemove', async member => {
webhook.send(`${member.user.tag} left.`, {username: member.user.username, avatarURL: member.user.displayAvatarURL(), disableEveryone:true});
});
})();
// view deleted channels
(function(){
(async function(){
var vcid = '425060452129701889';
var rid = '425060792455397376';
dClient.on('voiceStateUpdate', (oldMember, newMember) => {
dClient.on('voiceStateUpdate', async (oldMember, newMember) => {
if (oldMember.voiceChannelID != vcid && newMember.voiceChannelID == vcid) {
// member joined the channel
newMember.roles.add(newMember.guild.roles.get(rid));