Skip to content

Commit baa875d

Browse files
committed
v5.1.1 Release
Hello! This is to make some changes. - Language support now added. - Upgrade version numbering - Update API to Netro Corporation API. - Change Copyright to Netro Corporation from TMC.
1 parent 7c4196d commit baa875d

19 files changed

Lines changed: 512 additions & 142 deletions

File tree

src/app/cfg/app.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const app = {
1414

1515
version: {
1616
major: 5,
17-
minor: 0,
18-
revision: 2,
17+
minor: 1,
18+
revision: 1,
1919
buildType: "R",
2020
toString: function() {
2121
var major = app.version.major,
@@ -166,7 +166,7 @@ const app = {
166166
const userSetting = await app.DBs.userSettings.create({
167167
userID: id,
168168
prefix: app.config.system.defaultPrefix,
169-
language: "English",
169+
language: app.config.system.defaultLanguage || "English (en_US)",
170170
acceptedEULA: false,
171171
executedCommands: 0,
172172
errorCommands: 0,
@@ -292,11 +292,13 @@ const app = {
292292
}, edit, true);
293293
},
294294
msgHandler: async function(message, options, action = 0, doReply = false, callback = null) { // action: 0 = Send, 1 = Edit
295+
var userSettings = (message.author) ? await app.DBs.userSettings.findOne({ where: { userID: message.author.id } }) : "English";
296+
295297
if (options.embeds) {
296298
if (options["author"] != null) {
297299
var author = options["author"];
298300
if (author.id)
299-
options.embeds[0]["author"] = { name: `Hello, ${author.tag}!`, icon_url: author.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) };
301+
options.embeds[0]["author"] = { name: `${(app.lang.getLine((userSettings) ? userSettings.get("language") : "English", "Hello"))}, ${author.tag}!`, icon_url: author.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) };
300302
delete options["author"];
301303
};
302304
if (!options.embeds[0]["footer"]) options.embeds[0]["footer"] = { text: app.config.system.footerText }; // Install branding.exe
@@ -365,7 +367,7 @@ const app = {
365367
var embedColor = (type == "error") ? app.config.system.embedColors.red : app.config.system.embedColors.yellow;
366368

367369
var data = {};
368-
if ((err.message) ? err.message.includes("Command not found") : err.includes("Command not found"))
370+
if ((err.message) ? err.message.includes(app.lang.getLine(userSettings.get("language"), "Command not found")) : err.includes(app.lang.getLine(userSettings.get("language"), "Command not found")))
369371
data = {
370372
embeds: [{
371373
title: embedTitle,
@@ -383,7 +385,7 @@ const app = {
383385
embeds: [{
384386
title: embedTitle,
385387
color: embedColor,
386-
description: `Failed to execute \`${((command.name) ? command.name : command)}\`!`,
388+
description: `${app.lang.getLine(userSettings.get("language"), "Failed to execute")} \`${((command.name) ? command.name : command)}\`!`,
387389
fields: [
388390
{ name: "Error Details", value: "```" + msg + "```" }
389391

src/app/cfg/system.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"footerText": "APPNAME, © TMC Software 2018-currYear.",
2+
"footerText": "APPNAME, © Netro Corporation 2018-currYear.",
33
"commandState": "Enabled",
44
"defaultPrefix": "tB/",
55
"rotatingStatus": {
@@ -138,7 +138,7 @@
138138
},
139139

140140
"logURL": "https://tcb.nekos.tech/bot/",
141-
"imgAPI": "https://api.themattchannel.com/v1/imgs/",
141+
"imgAPI": "https://api.netrocorp.net/v1/imgs/",
142142

143143

144144
"owners": [

src/app/cmds/Fun/8ball.js

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,28 @@ module.exports = {
88
cooldown: 2,
99
aliases: [],
1010
syntax: [" <Question>"],
11-
execute: async(app, message, args) => {
11+
execute: async(app, message, args, userSettings) => {
1212
let question = args.slice(0).join(" ");
1313

1414
if (!question) return app.functions.msgHandler(message, {
1515
embeds: [{
16-
title: `${app.config.system.emotes.error} Error`,
16+
title: `${app.config.system.emotes.error} ${app.lang.getLine(userSettings.get("language"), "Error")}`,
1717
color: app.config.system.embedColors.red,
1818
description: "You need to ask a question!"
1919
}]
2020
}, 0, true);
2121

22-
var responses = {
23-
"Yes!": "lime",
24-
"For sure": "lime",
25-
"Reach for the stars!": "lime",
26-
"Definitely!": "lime",
27-
"No.": "red",
28-
"Don't even think about it.": "red",
29-
"Why would you do that!?": "red",
30-
"Don't.": "red",
31-
"I actually don't know..": "purple",
32-
"Let me think about it": "purple",
33-
"Uhh...": "purple",
34-
"Just like the future, I'm uncertain on what to answer.": "purple"
35-
}
22+
var responses = app.lang.getLine(userSettings.get("language"), "8ballResponse");
3623
var responsePick = Object.keys(responses)[Math.floor(Math.random() * Object.keys(responses).length)];
3724

3825
app.functions.msgHandler(message, {
3926
embeds: [{
4027
title: ":8ball: 8Ball",
4128
color: app.config.system.embedColors[responses[responsePick]],
42-
description: "Some magic, please!",
29+
description: app.lang.getLine(userSettings.get("language"), "Some magic, please!"),
4330
fields: [
44-
{ name: "Question", value: question },
45-
{ name: "Answer", value: responsePick }
31+
{ name: app.lang.getLine(userSettings.get("language"), "Question"), value: question },
32+
{ name: app.lang.getLine(userSettings.get("language"), "Answer"), value: responsePick }
4633
]
4734
}]
4835
}, 0, true);

src/app/cmds/General/about.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,34 @@ module.exports = {
88
cooldown: 2,
99
aliases: ["botinfo", "aboutme"],
1010
syntax: [],
11-
execute: async(app, message, args) => {
11+
execute: async(app, message, args, userSettings) => {
1212
const os = app.modules["os"]; // Welcome to os(u)~!
1313
return app.functions.msgHandler(message, {
1414
embeds: [{
15-
title: app.config.system.emotes.information + ` All about your favorite bot, **${app.client.user.tag}**!`,
15+
title: `${app.config.system.emotes.information} ${app.lang.getLine(userSettings.get("language"), "All about your favorite bot")}, **${app.client.user.tag}**!`,
1616
color: app.config.system.embedColors.blue,
1717
thumbnail: { url: app.client.user.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) },
1818
fields: [
19-
{ name: "Bot Information", value: "** **" },
20-
{ name: "User Tag", value: `${app.client.user.tag}`, inline: true },
21-
{ name: "User ID", value: `${app.client.user.id}`, inline: true },
22-
{ name: "Bot Version", value: app.version.toFullString(), inline: true },
23-
{ name: "Bot Uptime", value: app.functions.TStoHR(app.client.uptime), inline: true },
24-
{ name: "Emote Count", value: `${Object.keys(app.config.system.emotes).length} total`, inline: true },
25-
{ name: "Embed Color Count", value: `${Object.keys(app.config.system.embedColors).length} total`, inline: true },
26-
{ name: "RPS Count", value: `${Object.keys(app.config.system.rotatingStatus.statuses).length} total`, inline: true },
27-
{ name: "Bot Memory Usage", value: (Math.round(process.memoryUsage().heapUsed / 1024 / 1024 * 100) / 100) + " MiB", inline: true },
28-
{ name: "Servers I'm In", value: app.client.guilds.cache.size + " total", inline: true },
29-
{ name: "Host System Information", value: "** **" },
30-
{ name: "NodeJS Version", value: `${process.version}`, inline: true },
31-
{ name: "NodeJS Uptime", value: app.functions.TStoHR(process.uptime() * 1000), inline: true },
32-
{ name: "NodeJS Execution Path", value: `${process.execPath}`, inline: true },
33-
{ name: "Process PID", value: `${process.pid}`, inline: true },
34-
{ name: "System Platform", value: `${process.platform}`, inline: true },
35-
{ name: ((process.platform == "linux") ? "Kernel Version" : "System Version"), value: os.version(), inline: true }
19+
{ name: app.lang.getLine(userSettings.get("language"), "Bot Information"), value: "** **" },
20+
{ name: app.lang.getLine(userSettings.get("language"), "User Tag"), value: `${app.client.user.tag}`, inline: true },
21+
{ name: app.lang.getLine(userSettings.get("language"), "User ID"), value: `${app.client.user.id}`, inline: true },
22+
{ name: app.lang.getLine(userSettings.get("language"), "Bot Version"), value: app.version.toFullString(), inline: true },
23+
{ name: app.lang.getLine(userSettings.get("language"), "Bot Uptime"), value: app.functions.TStoHR(app.client.uptime), inline: true },
24+
{ name: app.lang.getLine(userSettings.get("language"), "Emote Count"), value: `${Object.keys(app.config.system.emotes).length} total`, inline: true },
25+
{ name: app.lang.getLine(userSettings.get("language"), "Embed Color Count"), value: `${Object.keys(app.config.system.embedColors).length} total`, inline: true },
26+
{ name: app.lang.getLine(userSettings.get("language"), "RPS Count"), value: `${Object.keys(app.config.system.rotatingStatus.statuses).length} total`, inline: true },
27+
{ name: app.lang.getLine(userSettings.get("language"), "Bot Memory Usage"), value: (Math.round(process.memoryUsage().heapUsed / 1024 / 1024 * 100) / 100) + " MiB", inline: true },
28+
{ name: app.lang.getLine(userSettings.get("language"), "Servers I'm In"), value: app.client.guilds.cache.size + " total", inline: true },
29+
{ name: app.lang.getLine(userSettings.get("language"), "Host System Information"), value: "** **" },
30+
{ name: app.lang.getLine(userSettings.get("language"), "NodeJS Version"), value: `${process.version}`, inline: true },
31+
{ name: app.lang.getLine(userSettings.get("language"), "NodeJS Uptime"), value: app.functions.TStoHR(process.uptime() * 1000), inline: true },
32+
{ name: app.lang.getLine(userSettings.get("language"), "NodeJS Execution Path"), value: `${process.execPath}`, inline: true },
33+
{ name: app.lang.getLine(userSettings.get("language"), "Process PID"), value: `${process.pid}`, inline: true },
34+
{ name: app.lang.getLine(userSettings.get("language"), "System Platform"), value: `${process.platform}`, inline: true },
35+
{ name: app.lang.getLine(userSettings.get("language"), ((process.platform == "linux") ? "Kernel Version" : "System Version")), value: os.version(), inline: true }
3636
// I'd like to have this show the current CPU usage, I'm open to ideas on how to get it to work. - IDeletedSystem64
3737
]
3838
}]
3939
});
4040
}
41-
}
41+
}

src/app/cmds/General/afk.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ module.exports = {
88
cooldown: 10,
99
aliases: [],
1010
syntax: [],
11-
execute: async(app, message, args) => {
12-
var userSettings = await app.DBs.userSettings.findOne({ where: { userID: message.author.id } });
11+
execute: async(app, message, args, userSettings) => {
1312
if (!userSettings) return app.functions.msgHandler(message, { embeds: [{ color: app.config.system.embedColors.red, description: `${app.config.system.emotes.error} **Could not set to AFK due to missing User Settings.**` }] })
1413

1514
var reason = args.slice(0).join(" ") || "";
@@ -23,15 +22,15 @@ module.exports = {
2322
if (affectedRows.length > 0) {
2423
await app.functions.msgHandler(message, {
2524
embeds: [{
26-
title: `${app.config.system.emotes.success} You're now AFK${((reason != "" ? ": " + reason: "!"))}`,
25+
title: `${app.config.system.emotes.success} ${app.lang.getLine(userSettings.get("language"), "You're now AFK")}${((reason != "" ? ": " + reason: "!"))}`,
2726
color: app.config.system.embedColors.lime
2827
}],
2928
author: message.author
3029
}, 0, true, (async msg => {
3130
setTimeout(function() { msg.delete() }, 6000);
3231
}));
3332
} else {
34-
return app.functions.msgHandler(message, { embeds: [{ color: app.config.system.embedColors.red, description: `${app.config.system.emotes.error} **Could not set to AFK due to Database Error!**` }] })
33+
return app.functions.msgHandler(message, { embeds: [{ color: app.config.system.embedColors.red, description: `${app.config.system.emotes.error} **${app.lang.getLine(userSettings.get("language"), "Could not set to AFK due to Database Error!")}**` }] })
3534
};
3635
}
3736
};

src/app/cmds/General/help.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
cooldown: 2,
99
aliases: ["halp", "helpme"],
1010
syntax: [" [commandName/commandAlias]"],
11-
execute: async(app, message, args) => {
11+
execute: async(app, message, args, userSettings) => {
1212

1313
// Begin the functions for help.
1414

@@ -17,7 +17,7 @@ module.exports = {
1717
fields = [];
1818
app.commands.forEach(cmd => {
1919
if (app.functions.hasPermissions(message, cmd) || !cmd.hidden) {
20-
var category = cmd.category || "Uncategorized";
20+
var category = cmd.category || app.lang.getLine(userSettings.get("language"), "Uncategorized");
2121
if (cmds[category] == undefined) cmds[category] = [];
2222
cmds[category].push("`" + cmd.name + "`");
2323
};
@@ -29,7 +29,7 @@ module.exports = {
2929

3030
return app.functions.msgHandler(message, {
3131
embeds: [{
32-
title: `${app.config.system.emotes.information} ${app.name} Help`,
32+
title: `${app.config.system.emotes.information} ${app.name} ${app.lang.getLine(userSettings.get("language"), "Help")}`,
3333
color: app.config.system.embedColors.blue,
3434
description: ((temp) ? "The command or category '" + temp + "' is invalid." : `Yeaaah we got it! (Help! Help!)`),
3535
fields: fields
@@ -41,17 +41,17 @@ module.exports = {
4141
var commands = [],
4242
fields = [];
4343
app.commands.forEach(cmd => {
44-
var category = cmd.category || "Uncategorized";
45-
if (category == categoryName && app.functions.hasPermissions(message, cmd) && !cmd.hidden)
44+
var category = cmd.category || app.lang.getLine(userSettings.get("language"), "Uncategorized");
45+
if (category == categoryName && app.functions.hasPermissions(message, cmd))
4646
commands.push("`" + cmd.name + "`");
4747
});
48-
if (commands.length < 1) { return app.functions.missingPerms(message, 0, "view help on " + categoryName, command); };
48+
if (commands.length < 1) { return app.functions.missingPerms(message, 0, "view help on " + categoryName); };
4949

5050
fields.push({ name: categoryName, value: commands.join(", ") });
5151

5252
return app.functions.msgHandler(message, {
5353
embeds: [{
54-
title: `${app.config.system.emotes.information} ${app.name} Help`,
54+
title: `${app.config.system.emotes.information} ${app.name} ${app.lang.getLine(userSettings.get("language"), "Help")}`,
5555
color: app.config.system.embedColors.pink,
5656
description: `Showing commands for the '${categoryName}' category.`,
5757
fields: fields
@@ -64,19 +64,19 @@ module.exports = {
6464

6565
if (!app.functions.hasPermissions(message, command)) { return app.functions.missingPerms(message, 0, "view help on " + commandName, command); };
6666
var fields = [
67-
{ name: "Category", value: command.category || "Uncategorized", inline: true },
68-
{ name: "Server Only?", value: (command.guildOnly ? "Yes" : "No"), inline: true },
69-
{ name: "Permissions", value: ("`" + command.permissions.join("`, `") + "`"), inline: true },
70-
{ name: "Cooldown", value: `${command.cooldown}s`, inline: true },
71-
{ name: "Aliases", value: ((command.aliases.length > 0) ? "`" + command.aliases.join("`\n`") + "`" : "NONE"), inline: true },
72-
{ name: "Syntax", value: ("`" + commandName + command.syntax.join("`\n`" + commandName) + "`"), inline: true }
67+
{ name: app.lang.getLine(userSettings.get("language"), "Category"), value: command.category || app.lang.getLine(userSettings.get("language"), "Uncategorized"), inline: true },
68+
{ name: app.lang.getLine(userSettings.get("language"), "Server Only?"), value: (command.guildOnly ? "Yes" : "No"), inline: true },
69+
{ name: app.lang.getLine(userSettings.get("language"), "Permissions"), value: ("`" + command.permissions.join("`, `") + "`"), inline: true },
70+
{ name: app.lang.getLine(userSettings.get("language"), "Cooldown"), value: `${command.cooldown}s`, inline: true },
71+
{ name: app.lang.getLine(userSettings.get("language"), "Aliases"), value: ((command.aliases.length > 0) ? "`" + command.aliases.join("`\n`") + "`" : "NONE"), inline: true },
72+
{ name: app.lang.getLine(userSettings.get("language"), "Syntax"), value: ("`" + commandName + command.syntax.join("`\n`" + commandName) + "`"), inline: true }
7373
]
7474
if (/(<|>|\[|\])/i.test(command.syntax))
75-
fields.push({ name: "Heads up!", value: "`<>` = Required\n`[]` = Optional" });
75+
fields.push({ name: app.lang.getLine(userSettings.get("language"), "Heads up!"), value: "`<>` = " + app.lang.getLine(userSettings.get("language"), "Required") + "\n`[]` = " + app.lang.getLine(userSettings.get("language"), "Optional") });
7676

7777
return app.functions.msgHandler(message, {
7878
embeds: [{
79-
title: `${app.config.system.emotes.information} Help for ${commandName}`,
79+
title: `${app.config.system.emotes.information} ${app.lang.getLine(userSettings.get("language"), "Help for")} ${commandName}`,
8080
color: app.config.system.embedColors.lime,
8181
description: command.description,
8282
fields: fields

src/app/cmds/General/ping.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ module.exports = {
88
cooldown: 2,
99
aliases: [],
1010
syntax: [],
11-
execute: async(app, message, args) => {
12-
app.functions.msgHandler(message, `${app.config.system.emotes.wait} :ping_pong: **Pinging...**`, 0, true, (msg => {
11+
execute: async(app, message, args, userSettings) => {
12+
app.functions.msgHandler(message, `${app.config.system.emotes.wait} :ping_pong: **${app.lang.getLine(userSettings.get("language"), "Pinging...")}**`, 0, true, (msg => {
1313
app.functions.msgHandler(msg, {
1414
content: "** **",
1515
embeds: [{
16-
title: app.config.system.emotes.information + " **Latency Test**",
16+
title: `${app.config.system.emotes.information} **${app.lang.getLine(userSettings.get("language"), "Latency Test")}** `,
1717
color: app.config.system.embedColors.blue,
1818
fields: [
19-
{ name: "API", value: app.client.ws.ping + "ms", inline: true },
20-
{ name: "Messages", value: ((msg.createdTimestamp - message.createdTimestamp) + "ms"), inline: true }
19+
{ name: app.lang.getLine(userSettings.get("language"), "API"), value: app.client.ws.ping + "ms", inline: true },
20+
{ name: app.lang.getLine(userSettings.get("language"), "Messages"), value: ((msg.createdTimestamp - message.createdTimestamp) + "ms"), inline: true }
2121
]
2222
}]
2323
}, 1, true)

0 commit comments

Comments
 (0)