add message util class
parent
5e8a6c8837
commit
1422cdfc9a
|
@ -0,0 +1,10 @@
|
|||
import type { MessageContent } from 'eris';
|
||||
import type { Client } from '../class';
|
||||
|
||||
export default class MessageUtil {
|
||||
static async sendDirectMessage(content: MessageContent, userID: string, client: Client) {
|
||||
const dmChannel = await client.getDMChannel(userID);
|
||||
if (!dmChannel) throw new Error(`DM Channel for user ${userID} doesn't exist.`);
|
||||
return dmChannel.createMessage(content);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue