Archived
1.1.3 - added JSDoc documentation
This commit is contained in:
1 parent
d1f094a09e
commit
7d9cdb508b
6 files changed
+73
-4
No files matched your search
@@ -21,6 +21,7 @@ class SystemMessageManager {
|
||||
ERROR: SystemMessageAppearance;
|
||||
NOT_FOUND: SystemMessageAppearance;
|
||||
deleteTimeout: number;
|
||||
|
||||
constructor(botName?: string) {
|
||||
this.PERMISSION = {
|
||||
title: '👮♂️ Insufficient permissions',
|
||||
@@ -44,6 +45,14 @@ class SystemMessageManager {
|
||||
}
|
||||
this.deleteTimeout = Infinity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates and sends a system message
|
||||
* @param {MessageType} type - 'ERROR' | 'PERMISSION' | 'NOT_FOUND'
|
||||
* @param {SystemMessageData} [data] - additional data to include in the message
|
||||
* @param {TextChannel | DMChannel | NewsChannel} [channel] - if specified, the generated message will be sent in this channel
|
||||
* @returns *Promise<MessageEmbed | Message | void>*
|
||||
*/
|
||||
async send(type: MessageType, data?: SystemMessageData, channel?: TextChannel | DMChannel | NewsChannel) : Promise<MessageEmbed | Message | void> {
|
||||
if(this[type]) {
|
||||
const embed = new MessageEmbed();
|
||||
|
||||
Reference in new issue
Block a user