v 1.14 added announcements system, minor bug fixes
This commit is contained in:
parent
25e4065fef
commit
9e960c9288
3 changed files with 56 additions and 7 deletions
|
@ -17,6 +17,10 @@ clean up p/vileimagery, its horrendous
|
|||
|
||||
**_Note:_** _versions before this were not uploaded to the repo, this is not the first version._
|
||||
|
||||
1.14 - added announcement system, bug fixes
|
||||
|
||||
---
|
||||
|
||||
1.13 - new blacklist feature (for my own amusement,) random sound feature, tons of bug fixes
|
||||
1.13.1 - fixed longstanding issue with readme.md where discord server link was invalid
|
||||
|
||||
|
|
29
src/commands/pepperannouncement.js
Normal file
29
src/commands/pepperannouncement.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
const whitelist = ["440163494529073152"];
|
||||
import * as action from "../util/discordAction.js";
|
||||
import { default as log } from "../util/log.js";
|
||||
|
||||
const prefix = process.env.PREFIX;
|
||||
|
||||
export default {
|
||||
name: "pepperannouncement",
|
||||
description: "PEPPER ANNOUNCEMENT SYSTEM",
|
||||
arguments: "title, text",
|
||||
execute(message, args) {
|
||||
if (whitelist.includes(message.author.id)) {
|
||||
const title = args[0];
|
||||
const msgnoprefix = message.content.slice(
|
||||
prefix.length + this.name.length + title.length + 2
|
||||
);
|
||||
const msg = msgnoprefix.slice(0, 2000);
|
||||
const embed = action.createEmbed();
|
||||
|
||||
embed.setTitle(title);
|
||||
embed.setDescription(msg);
|
||||
action.sendMessage("1171660137946157146", { embeds: [embed] });
|
||||
action.messageDelete(message);
|
||||
} else {
|
||||
action.reply(message, "UNAUTHORIZED");
|
||||
return;
|
||||
}
|
||||
},
|
||||
};
|
|
@ -1,11 +1,27 @@
|
|||
import { default as log } from "../util/log.js";
|
||||
|
||||
export default function (message) {
|
||||
log(
|
||||
"deletedmessages.log",
|
||||
message,
|
||||
import.meta.url,
|
||||
`deleted message from ${message.author.username} (${message.author}) with: "${message.content}"`,
|
||||
true
|
||||
);
|
||||
try {
|
||||
log(
|
||||
"deletedmessages.log",
|
||||
message,
|
||||
import.meta.url,
|
||||
`deleted message from ${message.author.username} (${message.author}) with: "${message.content}"`,
|
||||
true
|
||||
);
|
||||
} catch {
|
||||
function sendError(message) {
|
||||
const channel = client.channels.cache.get("1148814162273763418");
|
||||
let msg;
|
||||
try {
|
||||
msg = channel.send(`**error:** ${message}`);
|
||||
} catch (err) {
|
||||
sendError(err.rawError.message);
|
||||
console.log(err);
|
||||
return undefined;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
sendError("undefined error");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue