Created the channel.ts

This commit is contained in:
Mathias Wagner 2023-11-11 19:06:20 +01:00
parent 174dcc9223
commit c62594a59b
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

13
controller/channel.ts Normal file
View File

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