Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

Commit

Permalink
4.0.1-ex
Browse files Browse the repository at this point in the history
Release 4.0.1
  • Loading branch information
Gilbert142 committed Jun 2, 2017
2 parents 0c369c8 + 9fce421 commit 30a3ea1
Show file tree
Hide file tree
Showing 168 changed files with 5,705 additions and 1,880 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Configuration/config.json
Configuration/auth.json
Extensions/
48 changes: 44 additions & 4 deletions Commands/PM/afk.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,30 @@ module.exports = (bot, db, config, winston, userDocument, msg, suffix, commandDa
if(suffix) {
if(suffix==".") {
userDocument.afk_message = null;
msg.channel.createMessage("Welcome back! 🎊 I removed your AFK message");
msg.channel.createMessage({
embed: {
author: {
name: bot.user.username,
icon_url: bot.user.avatarURL,
url: "https://github.com/GilbertGobbels/GAwesomeBot"
},
color: 0x9ECDF2,
description: "Welcome back! 🎊\nI removed your AFK message"
}
});
} else {
userDocument.afk_message = suffix;
msg.channel.createMessage(`Alright, I'll show that when someone mentions you on a server. πŸ‘Œ Use \`${commandData.name} .\` to remove it`);
msg.channel.createMessage({
embed: {
author: {
name: bot.user.username,
icon_url: bot.user.avatarURL,
url: "https://github.com/GilbertGobbels/GAwesomeBot"
},
color: 0x9ECDF2,
description: `Alright, I'll show that when someone mentions you on a server. πŸ‘Œ\nUse \`${commandData.name} .\` to remove it`
}
});
}
userDocument.save(err => {
if(err) {
Expand All @@ -14,9 +34,29 @@ module.exports = (bot, db, config, winston, userDocument, msg, suffix, commandDa
});
} else {
if(userDocument.afk_message) {
msg.channel.createMessage(`You have the AFK message \`${userDocument.afk_message}\` set right now πŸ’­`);
msg.channel.createMessage({
embed: {
author: {
name: bot.user.username,
icon_url: bot.user.avatarURL,
url: "https://github.com/GilbertGobbels/GAwesomeBot"
},
color: 0x9ECDF2,
description: `You have the AFK message \`${userDocument.afk_message}\` set right now πŸ’­`
}
});
} else {
msg.channel.createMessage("You don't have an AFK message set right now ⌨️");
msg.channel.createMessage({
embed: {
author: {
name: bot.user.username,
icon_url: bot.user.avatarURL,
url: "https://github.com/GilbertGobbels/GAwesomeBot"
},
color: 0x00FF00,
description: "You don't have an AFK message set right now ⌨️"
}
});
}
}
};
78 changes: 72 additions & 6 deletions Commands/PM/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,31 @@ module.exports = (bot, db, config, winston, userDocument, msg, suffix) => {
// Maintainer console for overall bot things
if(config.maintainers.indexOf(msg.author.id)>-1 && !suffix) {
if(config.hosting_url) {
msg.channel.createMessage(`🌎 ${config.hosting_url}dashboard/overview?svrid=maintainer`);
msg.channel.createMessage({
embed: {
author: {
name: bot.user.username,
icon_url: bot.user.avatarURL,
url: "https://github.com/GilbertGobbels/GAwesomeBot"
},
title: "Here's the link for the Maintainer Console:",
description: `${config.hosting_url}dashboard/overview?svrid=maintainer`,
color: 0x9ECDF2
}
});
} else {
msg.channel.createMessage("**Limited mode:** You have not provided a hosting URL in the bot config, so the maintainer console is not available.");
msg.channel.createMessage({
embed: {
author: {
name: bot.user.username,
icon_url: bot.user.avatarURL,
url: "https://github.com/GilbertGobbels/GAwesomeBot"
},
title: "Warning! Bot is running in __Limited Mode__",
description: "You have not provided a hosting URL in the bot config, so the maintainer console is not available.",
color: 0xFF0000
}
});
}
}

Expand All @@ -14,20 +36,64 @@ module.exports = (bot, db, config, winston, userDocument, msg, suffix) => {
const svr = bot.serverSearch(suffix, msg.author, userDocument);
// Check if specified server exists
if(!svr) {
msg.channel.createMessage("Sorry, invalid server. πŸ™ Try again?");
msg.channel.createMessage({
embed: {
author: {
name: bot.user.username,
icon_url: bot.user.avatarURL,
url: "https://github.com/GilbertGobbels/GAwesomeBot"
},
color: 0xFF0000,
title: "Error",
description: "Sorry, but the server name you entered is invalid. πŸ™ Try again?"
}
});
// Check if sender is an admin of the specified server
} else {
const member = svr.members.get(msg.author.id);
// Get server data
db.servers.findOne({_id: svr.id}, (err, serverDocument) => {
if(!err && member && serverDocument && serverDocument.config.blocked.indexOf(msg.author.id)==-1) {
if(bot.getUserBotAdmin(svr, serverDocument, member)>=3) {
msg.channel.createMessage(`🌎 ${config.hosting_url}dashboard/overview?svrid=${svr.id}`);
msg.channel.createMessage({
embed: {
author: {
name: bot.user.username,
icon_url: bot.user.avatarURL,
url: "https://github.com/GilbertGobbels/GAwesomeBot"
},
color: 0x00FF00,
title: "Here's the link to the requested Admin Panel",
description: `${config.hosting_url}dashboard/overview?svrid=${svr.id}`
}
});
} else {
msg.channel.createMessage("You are not an admin for that server.");
msg.channel.createMessage({
embed: {
author: {
name: bot.user.username,
icon_url: bot.user.avatarURL,
url: "https://github.com/GilbertGobbels/GAwesomeBot"
},
color: 0xFF0000,
title: "Error",
description: "You are not an admin for that server\nIf you think this was a mistake, please contact the server owner!"
}
});
}
} else {
msg.channel.createMessage("Sorry, invalid server. πŸ™ Try again?");
msg.channel.createMessage({
embed: {
author: {
name: bot.user.username,
icon_url: bot.user.avatarURL,
url: "https://github.com/GilbertGobbels/GAwesomeBot"
},
color: 0x9ECDF2,
title: "Error",
description: "Sorry, but the server name you entered is invalid. πŸ™ Try again?"
}
});
}
});
}
Expand Down
Loading

0 comments on commit 30a3ea1

Please sign in to comment.