From c62594a59bba9166a579e9ee9d23b6d03cbc7578 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sat, 11 Nov 2023 19:06:20 +0100 Subject: [PATCH] Created the channel.ts --- controller/channel.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 controller/channel.ts diff --git a/controller/channel.ts b/controller/channel.ts new file mode 100644 index 0000000..04674e5 --- /dev/null +++ b/controller/channel.ts @@ -0,0 +1,13 @@ +import {Channel} from "../models/Channel"; + +/** + * Lists all global channels in a guild + * @param guildId The id of the guild + */ +export const listChannels = async (guildId: string) => Channel.findAll({where: {guildId: guildId}}); + +/** + * Gets a global channel by its id + * @param channelId The id of the channel + */ +export const getChannelById = async (channelId: string) => Channel.findOne({where: {channelId: channelId}}); \ No newline at end of file