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);
  }
}
