refactor!: move dirs outside of src/ (#2032)

This commit is contained in:
Skillz4Killz
2022-02-11 04:49:53 -05:00
committed by GitHub
parent 471ef5cb6c
commit 8aaea9f339
594 changed files with 84 additions and 66 deletions
+13
View File
@@ -0,0 +1,13 @@
import type { Channel } from "../../types/channels/channel.ts";
import type { Bot } from "../../bot.ts";
/** Get a user's dm channel. This is required in order to send a DM. */
export async function getDmChannel(bot: Bot, userId: bigint) {
if (userId === bot.id) throw new Error(bot.constants.Errors.YOU_CAN_NOT_DM_THE_BOT_ITSELF);
const dmChannelData = await bot.rest.runMethod<Channel>(bot.rest, "post", bot.constants.endpoints.USER_DM, {
recipient_id: userId.toString(),
});
return bot.transformers.channel(bot, { channel: dmChannelData });
}