Skip to content

Commit 2218eee

Browse files
committed
v5 Release Milestone 2 Fix 1*
* Fixed inviteinfo command for gifs. * Fixed eula with 'End-User License Agreement' being 'End-User Agreement' or 'End-User Agreement Agreement'. * Added userinfo command. * Up'd the cooldown for inviteinfo from 2 seconds to 5 seconds.
1 parent 3f79d72 commit 2218eee

3 files changed

Lines changed: 85 additions & 11 deletions

File tree

src/app/cmds/General/inviteinfo.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
authorizedGuilds: [],
66
hidden: false,
77
permissions: ["DEFAULT"],
8-
cooldown: 2,
8+
cooldown: 5,
99
aliases: [],
1010
syntax: [" <inviteURLorCode>"],
1111
execute: async(app, message, args) => {
@@ -23,7 +23,6 @@ module.exports = {
2323
var invite = await res.json(),
2424
embed = {},
2525
splashData = null;
26-
console.log(invite);
2726
if (invite["message"]) embed = {
2827
description: `${app.config.system.emotes.error} **${invite["message"]}**`,
2928
color: app.config.system.embedColors.red
@@ -48,11 +47,11 @@ module.exports = {
4847
};
4948

5049
if (invite.guild.icon != null)
51-
embed.thumbnail = { url: `https://cdn.discordapp.com/icons/${invite.guild.id}/${invite.guild.icon}.${app.functions.isAnimated(invite.guild.icon) ? "gif ": "png"}?size=1024` };
50+
embed.thumbnail = { url: `https://cdn.discordapp.com/icons/${invite.guild.id}/${invite.guild.icon}.${app.functions.isAnimated(invite.guild.icon) ? "gif": "png"}?size=1024` };
5251
if (invite.guild.splash != null)
53-
splashData = `https://cdn.discordapp.com/splashes/${invite.guild.id}/${invite.guild.splash}.${app.functions.isAnimated(invite.guild.splash) ? "gif ": "png"}?size=600`;
52+
splashData = `https://cdn.discordapp.com/splashes/${invite.guild.id}/${invite.guild.splash}.${app.functions.isAnimated(invite.guild.splash) ? "gif": "png"}?size=600`;
5453
if (invite.guild.banner != null)
55-
embed["image"] = { url: `https://cdn.discordapp.com/banners/${invite.guild.id}/${invite.guild.banner}.${app.functions.isAnimated(invite.guild.banner) ? "gif ": "png"}?size=600` };
54+
embed["image"] = { url: `https://cdn.discordapp.com/banners/${invite.guild.id}/${invite.guild.banner}.${app.functions.isAnimated(invite.guild.banner) ? "gif": "png"}?size=600` };
5655
};
5756

5857
var options = { embeds: [embed] };

src/app/cmds/General/userinfo.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
module.exports = {
2+
name: "userinfo",
3+
description: "User data, need info on da user...",
4+
guildOnly: false,
5+
authorizedGuilds: [],
6+
hidden: false,
7+
permissions: ["DEFAULT"],
8+
cooldown: 5,
9+
aliases: [],
10+
syntax: [" <@MentionOrUserID>"],
11+
execute: async(app, message, args) => {
12+
async function userInfo(userID) {
13+
var states = {
14+
"offline": app.config.system.emotes.discord.offline + " **Offline**",
15+
"idle": app.config.system.emotes.discord.idle + " **Idle**",
16+
"dnd": app.config.system.emotes.discord.dnd + " **Do Not Disturb**",
17+
"online": app.config.system.emotes.discord.online + " **Online**"
18+
};
19+
20+
function getJoinPosition(ID) {
21+
var memberJoins = message.guild.members.cache.map(member => member).sort((a, b) => a.joinedAt - b.joinedAt);
22+
for (var i = 0; i < memberJoins.length; i++) { if (memberJoins[i].id == ID) return i; };
23+
};
24+
25+
try {
26+
var user = await app.client.api.users(userID).get();
27+
if (!user)
28+
throw new Error("That user does not exist.");
29+
user.tag = `${user.username}#${user.discriminator}`; // Manually add this so it looks cool
30+
31+
var embed = {
32+
thumbnail: { url: `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.${app.functions.isAnimated(user.avatar) ? "gif": "png"}?size=1024` },
33+
title: `${app.config.system.emotes.information} **${user.tag} ${(user.bot ? "*[BOT]*" : "")}**`,
34+
color: (user["accent_color"]) ? user["accent_color"] : app.config.system.embedColors.blue,
35+
fields: [
36+
{ name: "Username", value: user.username, inline: true },
37+
{ name: "Discriminator", value: user.discriminator, inline: true },
38+
{ name: "Full Tag", value: user.tag, inline: true },
39+
{ name: "User ID", value: user.id, inline: false },
40+
]
41+
};
42+
43+
if (user.banner != null)
44+
embed["image"] = { url: `https://cdn.discordapp.com/banners/${user.id}/${user.banner}.${app.functions.isAnimated(user.banner) ? "gif": "png"}?size=600` };
45+
46+
if (message.guild) {
47+
var serverUser = await message.guild.members.cache.get(userID) || await message.guild.members.fetch(userID, true);
48+
embed.fields.push({ name: '\u200b', value: '\u200b', inline: false });
49+
if (serverUser.roles) {
50+
var roles = serverUser.roles.cache.map(role => role).filter(role => role.id != message.guild.id).sort((a, b) => a.comparePositionTo(b)).map(role => role);
51+
embed.fields.push({ name: `Roles (**${roles.length}**)`, value: roles.length > 0 ? roles.join(" ") : "No roles :(", inline: true })
52+
};
53+
if (serverUser.presence) embed.description = states[serverUser.presence.status];
54+
if (serverUser.nickname) {
55+
embed.fields.push({ name: `Nickname`, value: serverUser.nickname, inline: true });
56+
embed.fields.push({ name: '\u200b', value: '\u200b', inline: true });
57+
};
58+
embed.fields.push({ name: "Join Position", value: (getJoinPosition(userID) + 1).toString(), inline: true }, { name: "Joined", value: (app.functions.TStoHR(new Date().getTime() - new Date(serverUser.joinedTimestamp).getTime()) + " ago"), inline: true })
59+
};
60+
61+
app.functions.msgHandler(message, { embeds: [embed] })
62+
} catch (Ex) {
63+
return app.functions.msgHandler(message, {
64+
embeds: [{
65+
description: `${app.config.system.emotes.error} **${Ex.message}**`,
66+
color: app.config.system.embedColors.red,
67+
}]
68+
});
69+
};
70+
};
71+
if (!args[0]) return userInfo(message.author.id);
72+
else return userInfo(app.functions.getID(args[0]));
73+
74+
}
75+
};

src/app/evts/special/eula.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = async(app, message) => {
2626
if (affectedRows > 0) {
2727
await i.update({
2828
embeds: [{
29-
title: `${app.config.system.emotes.success} **End-User Agreement**`,
29+
title: `${app.config.system.emotes.success} **End-User License Agreement**`,
3030
color: app.config.system.embedColors.lime,
3131
description: "You successfully agreed to the EOA! Thank you and have fun!\n(You may need to rerun your command again.)",
3232
footer: { text: app.config.system.footerText }
@@ -39,7 +39,7 @@ module.exports = async(app, message) => {
3939
} else {
4040
await i.update({
4141
embeds: [{
42-
title: `${app.config.system.emotes.warning} **End-User Agreement**`,
42+
title: `${app.config.system.emotes.warning} **End-User License Agreement**`,
4343
color: app.config.system.embedColors.orange,
4444
description: "Could not save your acknowledgement. Please try again.",
4545
footer: { text: app.config.system.footerText }
@@ -53,7 +53,7 @@ module.exports = async(app, message) => {
5353
} else if (i.customId === 'disagree') {
5454
await i.update({
5555
embeds: [{
56-
title: `${app.config.system.emotes.error} **End-User Agreement**`,
56+
title: `${app.config.system.emotes.error} **End-User License Agreement**`,
5757
color: app.config.system.embedColors.red,
5858
description: "You denied the EOA.",
5959
footer: { text: app.config.system.footerText }
@@ -69,7 +69,7 @@ module.exports = async(app, message) => {
6969
if (collected.size < 1) {
7070
app.functions.msgHandler(msg, {
7171
embeds: [{
72-
title: `${app.config.system.emotes.error} **End-User Agreement**`,
72+
title: `${app.config.system.emotes.error} **End-User License Agreement**`,
7373
color: app.config.system.embedColors.red,
7474
description: "Operation timed out."
7575
}],
@@ -91,9 +91,9 @@ module.exports = async(app, message) => {
9191

9292
await app.functions.msgHandler(message, {
9393
embeds: [{
94-
title: `${app.config.system.emotes.question} **End-User Agreement Agreement**`,
94+
title: `${app.config.system.emotes.question} **End-User License Agreement**`,
9595
color: app.config.system.embedColors.purple,
96-
description: "Before continuing, you must agree to the bot's End-User Agreement.",
96+
description: "Before continuing, you must agree to the bot's End-User License Agreement.",
9797
fields: fields
9898
}],
9999
components: [row]

0 commit comments

Comments
 (0)