Skip to content

Commit

Permalink
Merge pull request #387 from DanBot-Hosting/small-changes
Browse files Browse the repository at this point in the history
chore: various small changes
  • Loading branch information
DEV-DIBSTER authored Aug 23, 2023
2 parents dc516e4 + d636fbd commit 4bf92f4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 43 deletions.
8 changes: 2 additions & 6 deletions bot/discord/commands/staff/update.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const cap = require("../../util/cap");
const exec = require("child_process").exec;

exports.run = async (client, message, args) => {
Expand All @@ -12,12 +13,7 @@ exports.run = async (client, message, args) => {
} else {
client.channels.cache
.get("898041843902742548")
.send(
"**[AUTOMATIC]** \nNew update on GitHub. Pulling Files. \n\nLogs: \n```" +
response +
"```" +
"\n\n\n**Restarting Discord Bot.**"
);
.send(`<t:${Date.now().toString().slice(0, -3)} Update requested by <@${message.author.id}>, pulling files.\n\`\`\`${cap(response, 1900)}\`\`\``);

message.reply("Pulling files from GitHub.");
setTimeout(() => {
Expand Down
4 changes: 1 addition & 3 deletions bot/discord/events/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ module.exports = async (client, message) => {

// Channel checker
if (
(blacklisted.includes(message.channel.id) ||
(message.channel.id == "754441222424363088" && command != "snipe")) &&
blacklisted.includes(message.channel.id) &&
message.member.roles.cache.find((x) => x.id === "898041751099539497") == null &&
message.member.roles.cache.find((x) => x.id === "898041743566594049") == null &&
!(message.channel.id === "898041853096628267" && command === "info")
Expand Down Expand Up @@ -95,7 +94,6 @@ module.exports = async (client, message) => {
command === "server" ||
command === "user" ||
command === "staff" ||
command === "dan" ||
command === "ticket"
) {
//Cooldown setting
Expand Down
26 changes: 0 additions & 26 deletions bot/discord/events/messageUpdate.js

This file was deleted.

8 changes: 2 additions & 6 deletions bot/discord/events/ready.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const cap = require("../util/cap");
const exec = require("child_process").exec;
const nstatus = require("../serverStatus");

Expand Down Expand Up @@ -35,12 +36,7 @@ module.exports = async (client) => {
} else {
client.channels.cache
.get("898041843902742548")
.send(
"**[AUTOMATIC]** \nNew update on GitHub. Pulling Files. \n\nLogs: \n```" +
response +
"```" +
"\n\n\n**Restarting Discord Bot.**"
);
.send(`<t:${Date.now().toString().slice(0, -3)}:f> Automatic update from GitHub, pulling files.\n\`\`\`${cap(response, 1900)}\`\`\``);
setTimeout(() => {
process.exit();
}, 1000);
Expand Down
5 changes: 5 additions & 0 deletions bot/discord/util/cap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = function (str, length) {
if(str == null || str?.length <= length) return str;

return str.substr(0, length - 1) + "**\u2026**";
}
2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ global.fs = require("fs");
global.chalk = require("chalk");
const nodemailer = require("nodemailer");
global.axios = require("axios");
global.pretty = require("prettysize");
global.transport = nodemailer.createTransport({
host: config.Email.Host,
port: config.Email.Port,
Expand All @@ -34,7 +33,6 @@ require("./nodestatsChecker");
//Discord Bot
let db = require("quick.db");
global.Discord = require("discord.js");
global.tcpp = require("tcp-ping");

global.messageSnipes = new Discord.Collection();
global.fs = require("fs");
Expand Down

0 comments on commit 4bf92f4

Please sign in to comment.