system messages implementation

This commit is contained in:
mmacierzanka committed 2021-06-21 18:22:15 +02:00
1 parent 83cf65c3b8
commit 15be754d3c
3 files changed
+18 -7

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
import { ColorResolvable, GuildMember, MessageEmbed, TextChannel, User } from 'discord.js';
import { ColorResolvable, DMChannel, GuildMember, MessageEmbed, NewsChannel, TextChannel, User } from 'discord.js';
import { Command, PermissionsError } from './Command.js';
type MessageType = 'PERMISSION' | 'ERROR' | 'NOT_FOUND';
@@ -42,7 +42,7 @@ class SystemMessageManager {
}
this.deleteTimeout = Infinity;
}
async send(type: MessageType, data?: SystemMessageData, channel?: TextChannel) : Promise<MessageEmbed | void> {
async send(type: MessageType, data?: SystemMessageData, channel?: TextChannel | DMChannel | NewsChannel) : Promise<MessageEmbed | void> {
if(this[type]) {
const embed = new MessageEmbed();
embed.setTitle(this[type].title);