Skip to content

Commit

Permalink
minimal release
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorTrojan committed Oct 10, 2021
1 parent 977a105 commit 8dc221e
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Util/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Util {
const removeSleepList = [];
let flag = false;
this.sleepList.forEach((time, user) => {
if (Date.now() - time > (1000 * 6)) {
if (Date.now() - time > (1000 * 3)) {
removeSleepList.push(user);
return;
}
Expand Down
22 changes: 22 additions & 0 deletions src/commands/About.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const Base = require("./Command.js");
const Discord = require('discord.js');
const Util = require("../Util/Util.js");

class About extends Base {
constructor() {
super("About", "Information about the Bot", "misc");
}

async run(message, args) {
if (!message.guild) return;

const embed = Util.getEmbed(this.client);
embed.setTitle("💻 About")
.setThumbnail(this.client.user.avatarURL())
.setDescription("GlatzBot was developed to run on the Raspberry Pi 4. Main Feature is to show the Local-IP of the Pi because it can be quite a tedious task to find out")
.addField("Credits", `©RequestFX#1541, GLATZ`, false)
message.channel.send({ embeds: [embed] });
}
}

module.exports = About;
21 changes: 18 additions & 3 deletions src/commands/Help.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const Base = require("./Command.js");
const Util = require("../Util/Util.js");

class Help extends Base {
constructor() {
Expand All @@ -8,13 +9,27 @@ class Help extends Base {
async run(message, args) {
if (!message.guild) return;

var str = "";
let fun = "",
misc = "";

this.client.commands.forEach(command => {
str += `${command.getName()} : ${command.getDescription()}\n`;
switch (command.getCategory()) {

case "fun":
fun += `\`${command.getName()}\` `;
break;
case "misc":
misc += `\`${command.getName()}\` `;
break;
}
});

message.channel.send(str);
const embed = Util.getEmbed(this.client);
embed.setTitle("🔨 Help")

.addField("Misc", misc, false)
.addField("Fun", fun, false)
message.channel.send({ embeds: [embed] });
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/commands/WhatsMyIp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ const Util = require("../Util/Util.js");

class WhatsMyIp extends Base {
constructor() {
super("WhatsMyIp", "Tells you the IP of the DiscordBot Hoster", "fun");
super("WhatsMyIp", "Tells you the IP of the DiscordBot Hoster", "misc");
}

async run(message, args) {
const ips = NetworkUtil.getLocalIP();
if (ips == undefined) return;
var ipsFormatted = "";
for (var i in Object.keys(ips)) {
ipsFormatted += Object.keys(ips)[i] + " : " + Object.values(ips)[i] + "\n";
ipsFormatted += Object.keys(ips)[i] + ": " + Object.values(ips)[i] + "\n";
}

const embed = Util.getEmbed(this.client);
embed.setTitle("👨‍💻IPS")
embed.setTitle("👨‍💻 Local-IPS")
.setDescription(ipsFormatted);

message.channel.send({ embeds: [embed] });
Expand Down
2 changes: 1 addition & 1 deletion src/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"prefix": "!",
"token": "NzU3OTc0OTcyMjk4NjkwNjIy.X2oNMw.Q0eybe2rXkeQjKivtq1DPQmDDRU"
"token": "NzU3OTc0OTcyMjk4NjkwNjIy.X2oNMw.ga8ShbFaI8nZxgPivly6wVSN7VE"
}
2 changes: 1 addition & 1 deletion src/events/messageCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = (client, message) => {
return;

if (client.util.isUserInList(message.author.tag)) {
message.channel.send(`${message.author.toString()} Please don't spam!`);
message.channel.send(`${message.author.toString()} Please don't spam commands!`);
return;
}

Expand Down

0 comments on commit 8dc221e

Please sign in to comment.