This commit is contained in:
2023-04-15 22:06:35 +02:00
parent 8dd89f151e
commit 3d2022d1dd
21 changed files with 628 additions and 2 deletions

View File

@ -0,0 +1,12 @@
import { client } from "../.."
import { CustomError, errorCodes } from "../interfaces"
export async function sendFailureDM(creatorMessage: string, creatorId?: string): Promise<void> {
if (!creatorId) throw new CustomError('No creator ID present', errorCodes.no_creator_id)
const creator = await client.users.fetch(creatorId)
console.log(`Creator ${JSON.stringify(creator)}`)
if (creator)
if (!creator.dmChannel)
await creator.createDM()
await creator.dmChannel?.send(creatorMessage)
}