Make broadcasts persistent, fix Postgres database upgrades, fix image slash commands with text not working in DMs

This commit is contained in:
Essem 2022-10-25 12:37:55 -05:00
parent 089b750838
commit 5d679dbb7a
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
8 changed files with 37 additions and 9 deletions

View file

@ -1,4 +1,5 @@
import Command from "../../classes/command.js";
import database from "../../utils/database.js";
import { endBroadcast, startBroadcast } from "../../utils/misc.js";
class BroadcastCommand extends Command {
@ -10,6 +11,7 @@ class BroadcastCommand extends Command {
}
const message = this.options.message ?? this.args.join(" ");
if (message?.trim()) {
await database.setBroadcast(message);
startBroadcast(this.client, message);
if (process.env.PM2_USAGE) {
process.send({
@ -22,6 +24,7 @@ class BroadcastCommand extends Command {
}
return "Started broadcast.";
} else {
await database.setBroadcast(null);
endBroadcast(this.client);
if (process.env.PM2_USAGE) {
process.send({