Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Commit

Permalink
Merge pull request #59 from FCCouncil/master
Browse files Browse the repository at this point in the history
AD DEV
  • Loading branch information
matthew119427 authored Sep 17, 2018
2 parents 4462aae + b1d39f3 commit b105ce4
Show file tree
Hide file tree
Showing 280 changed files with 62,802 additions and 142 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ config.json
config.js
data/
test.js
config.js.example

# Runtime data
pids
Expand Down
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- "iojs"
- "7"
40 changes: 40 additions & 0 deletions commands/channelinfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const Discord = require("discord.js");




exports.run = async (client, message) => {
const embed = new Discord.RichEmbed()
.setAuthor(message.guild.name, message.guild.iconURL)
.setTitle('Channel Information')
.addField('Name', `${message.channel.name}`, true)
.addField('Category', `${message.channel.parent.name}`, true)
.addField('Topic', `${message.channel.topic}`, true)
if (message.channel.topic != true) {
embed.addField('Topic', 'None', true)
}
else {
embed.addField('Topic', `${message.channel.topic}`, true)
}
embed.addField('Position', `${message.channel.calculatedPosition}`, true)
embed.addField('Overrides', `${message.channel.permissionOverwrites.size}`, true)
if (message.channel.nsfw === true) {
embed.addField('NSFW', 'Yes', true)
}
embed.setFooter(client.user.username, client.user.avatarURL)
message.channel.send(embed)
}

exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "Standard User"
};

exports.help = {
name: "channelinfo",
category: "Misc",
description: "Provides information for the channel.",
usage: "channel info"
};
28 changes: 28 additions & 0 deletions commands/doggo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const Discord = require("discord.js");
const superagent = require ("superagent");

module.exports.run = async (client, message) => {

const {body} = await superagent
.get ('https://random.dog/woof.json');

const dogembed = new Discord.RichEmbed()
.setColor("#f48c42")
.setTitle(":dog: Woof!")
.setImage(body.url);

message.channel.send(dogembed);
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "Standard User"
};

exports.help = {
name: "doggo",
category: "Fun",
description: "Provides a random picture of a dog.",
usage: "doggo"
};
1 change: 1 addition & 0 deletions commands/eval.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const os = require('os')
exports.run = async (client, message, args, level) => { // eslint-disable-line no-unused-vars
const code = args.join(" ");
try {
Expand Down
114 changes: 57 additions & 57 deletions commands/game.js
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
const Discord = require("discord.js");
const status = {
online: "Online",
idle: "Idle",
dnd: "Do Not Disturb",
offline: "Offline/Invisible"
online: "Online",
idle: "Idle",
dnd: "Do Not Disturb",
offline: "Offline/Invisible"
};
exports.run = async (client, message, args) => {
const msg = await message.channel.send("Loading...");
const botuser = message.mentions.users.first() ? message.guild.members.get(message.mentions.users.first().id) : message.member;


const msg = await message.channel.send("Loading...");
const botuser = message.mentions.users.first() ? message.guild.members.get(message.mentions.users.first().id) : message.member;
const embed = new Discord.RichEmbed()
.setColor(botuser.displayColor)
.setFooter(`${client.user.username} | ID ${botuser.id} | Alpha Development`);
.setFooter(`${client.user.username} | ID ${botuser.id} | Beta - Master`);

if (!botuser.user.presence.game) {
embed.setAuthor(botuser.displayName),
embed.addField("Playing", `This user is not playing anything.`, true);
} else {
const game = botuser.user.presence.game;

try {
embed.setAuthor(botuser.displayName, botuser.user.presence.game.assets.smallImageURL);
}
catch(err) {
embed.setAuthor(botuser.displayName, 'https://cdn.discordapp.com/avatars/460639060851949569/4f545d7d0ee4fb31a411035793c4aef8.png?size=2048');
}
embed.setAuthor(botuser.displayName, game.assets.smallImageURL);
} catch (err) {
embed.setAuthor(botuser.displayName, "https://cdn.discordapp.com/avatars/460639060851949569/4f545d7d0ee4fb31a411035793c4aef8.png?size=2048");
}
try {
embed.setThumbnail(botuser.user.presence.game.assets.largeImageURL);
embed.setThumbnail(game.assets.largeImageURL);
} catch (err) {
embed.setThumbnail("https://cdn.discordapp.com/avatars/460639060851949569/4f545d7d0ee4fb31a411035793c4aef8.png?size=2048");
}
catch(err) {
embed.setThumbnail('https://cdn.discordapp.com/avatars/460639060851949569/4f545d7d0ee4fb31a411035793c4aef8.png?size=2048');
}
try {
embed.addField("Status", `${status[botuser.user.presence.status]}`, true);
}
catch(err) {
embed.addField("Status", `None`, true);
try {
embed.addField("Status", `${status[botuser.user.presence.status]}`, true);
} catch (err) {
embed.addField("Status", "An error occured while getting the user's status.", true);
}
try {
embed.addField("Playing", `${botuser.user.presence.game ? `${botuser.user.presence.game.name}` : "Not playing anything"}`, true);
}
catch(err) {
embed.addField("Playing", `This user is not playing anything.`, true);
try {
embed.addField("Playing", `${game.name}`, true);
} catch (err) {
embed.addField("Playing", "An error occured while getting the game's name.", true);
}
if (botuser.user.presence.game.state == null) {
embed.addField("Details", `No details`, true);
}
else {
embed.addField("State", `No state`, true);
}
try {
embed.addField("State", `${botuser.user.presence.game.state}`, true);
}
catch(err) {
embed.addField("State", `No state`, true);
try {
embed.addField("Details", `${game.details}`, true)
}
try {
embed.addField("Started", `${botuser.user.presence.game.timestamps.start}`, true)
}
catch(err) {
embed.addField("Started", `None`, true)
catch (err) {
embed.addField("Details", `No Info`, true)
}
try {
embed.addField("State", `${game.state}`, true);
} catch (err) {
embed.addField("State", "No state", true);
}

try {
embed.addField("Started", `${game.timestamps.start}`, true);
} catch (err) {
embed.addField("Started", `None`, true);
}
}
msg.edit(embed);
};


exports.conf = {
enabled: true,
guildOnly: true,
aliases: ["g"],
permLevel: "Systems Alpha/Dev Tester"
};
exports.help = {
name: "game",
category: "Misc",
description: "Provides information on the user's game.",
usage: "game"
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ["g"],
permLevel: "Systems Alpha/Dev Tester"
};

exports.help = {
name: "game",
category: "Misc",
description: "Provides information on the user's game.",
usage: "game"
};
7 changes: 4 additions & 3 deletions commands/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ exports.run = async (client, message, args, level) => {
.setAuthor(`${client.user.username}`, `${client.user.avatarURL}`)
.setColor(message.member.displayColor)
.setDescription("This is a clone of the [Moonglow](https://github.com/FCCouncil/Moonglow) GitHub repo. Join us today, and help contribute!")
.addField("Version", "3.0.0", true)
.addField("Created At", `${client.user.createdAt}`, true)
.addField("Library", "[Discord.js](https://github.com/discordjs/discord.js)", true)
.addField("Language", "JavaScript", true)
.addField("Contributors", `NightRaven#2172, CoalSephos#7566, FlatBird#9461`, true)
.addField("Contributors", `NightRaven#2172, CoalSephos#7566, FlatBird#9461, TheSkele27#1337`, true)
.addField("Creator", `Matthew#0008`, true)
.setFooter(`${client.user.username} | Alpha Development`);
.setFooter(`${client.user.username} | Beta - Master`);



Expand All @@ -18,7 +19,7 @@ exports.run = async (client, message, args, level) => {

exports.conf = {
enabled: true,
guildOnly: true,
guildOnly: false,
aliases: ["about"],
permLevel: "Standard User"
};
Expand Down
27 changes: 20 additions & 7 deletions commands/invite.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
const Discord = require("discord.js");
exports.run = async (client, message, args, level) => {
exports.run = async (client, message) => {


const embed = new Discord.RichEmbed()
.setAuthor(`${client.user.username}`, `${client.user.avatarURL}`)
.setColor(message.member.displayColor)
.addField("Invite Link", "https://discordapp.com/api/oauth2/authorize?client_id=460639060851949569&permissions=8&scope=bot", true)
.setFooter("Alpha/Development | ShadowShard");
message.channel.send(embed);
};
.setFooter(`${client.user.username} | Beta - Master`);
message.member.user.createDM().then(channel => channel.send(embed))

const em1 = new Discord.RichEmbed()
.setAuthor(`${client.user.username}`, `${client.user.avatarURL}`)
.setColor(message.member.displayColor)
.setDescription("Invite link sent, check your DMs.")
.setFooter(`${client.user.username} | Beta - Master`);
message.channel.send(em1)
};





exports.conf = {
enabled: true,
guildOnly: true,
guildOnly: false,
aliases: ["get", "join"],
permLevel: "Systems Alpha/Dev Tester"
};

exports.help = {
name: "invite",
category: "Bot Information",
description: "Provides the invite link.",
description: "Provides the bot's invite link.",
usage: "invite"
};
};
7 changes: 6 additions & 1 deletion commands/kick.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
exports.run = (client, message, [mention, ...reason]) => {

if (message.mentions.members.size === 0)
try { if (message.mentions.members.size === 0)
return message.reply("Please mention a user to kick");

if (!message.guild.me.hasPermission("KICK_MEMBERS"))
Expand All @@ -11,6 +11,11 @@ exports.run = (client, message, [mention, ...reason]) => {
kickMember.kick(reason.join(" ")).then(member => {
message.reply(`${member.user.username} was succesfully kicked.`);
});
} catch (err) {
msg.edit("EXCPT*- " +
err);
}

};

exports.conf = {
Expand Down
1 change: 1 addition & 0 deletions commands/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ exports.run = async (client, message, args, level) => {
return message.channel.send(result);
}


exports.conf = {
enabled: true,
guildOnly: false,
Expand Down
19 changes: 15 additions & 4 deletions commands/ping.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
const Discord = require("discord.js");
exports.run = async (client, message, args, level) => { // eslint-disable-line no-unused-vars
const talkedRecently = new Set();
exports.run = async (client, message) => {
if (talkedRecently.has(message.author.id) && !message.member.roles.has("490364533550874644")) {

message.channel.send("You are being rate limited!" + message.author);
} else { // eslint-disable-line no-unused-vars
const msg = await message.channel.send("Ping?");
const embed = new Discord.RichEmbed()
.setAuthor(`${client.user.username}`, `${client.user.avatarURL}`)
.setAuthor(`${client.user.username}`, `${client.user.avatarURL}`)
.setColor(message.member.displayColor)
.addField("• Ping Latency", `${msg.createdTimestamp - message.createdTimestamp}ms`, true)
.addField("• API Latency", `${Math.round(client.ping)}ms`, true)
.setFooter(`${client.user.username} | Alpha Development`);
.setFooter(`${client.user.username} | Beta - Master`);
msg.edit(embed);
talkedRecently.add(message.author.id);
setTimeout(() => {
// Removes the user from the set after a minute
talkedRecently.delete(message.author.id);
}, 2000);
};
}

exports.conf = {
enabled: true,
Expand All @@ -20,6 +31,6 @@ exports.conf = {
exports.help = {
name: "ping",
category: "Misc",
description: "Pings the bot, responses with API and regular latencies.",
description: "Pings the bot, responds with API and regular latencies.",
usage: "ping"
};
22 changes: 22 additions & 0 deletions commands/roleinfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const Discord = require("discord.js");
exports.run = async (client, message) => {
const mRole = message.mentions.roles.first()
const embed = new Discord.RichEmbed()
.setAuthor(`${client.user.username}`, `${client.user.avatarURL}`)
.addField(`Test`, `${message.guild.roles.find(mRole).hexColor}`)
message.channel.send(embed)
}
exports.conf = {
enabled: false,
guildOnly: true,
aliases: [],
permLevel: "Standard User"
};

exports.help = {
name: "roleinfo",
category: "Misc",
description: "Provides info about the mentioned role.",
usage: "roleinfo [...rolename]"
};

Loading

0 comments on commit b105ce4

Please sign in to comment.