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
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;
|
||||
}
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue