Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: various small changes #387

Merged
merged 2 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions bot/discord/commands/staff/update.js
DEV-DIBSTER marked this conversation as resolved.
Show resolved Hide resolved
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
DEV-DIBSTER marked this conversation as resolved.
Show resolved Hide resolved
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
DEV-DIBSTER marked this conversation as resolved.
Show resolved Hide resolved

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
DEV-DIBSTER marked this conversation as resolved.
Show resolved Hide resolved
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
DEV-DIBSTER marked this conversation as resolved.
Show resolved Hide resolved
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
Loading