Skip to content

Commit

Permalink
feat: guard on not register
Browse files Browse the repository at this point in the history
  • Loading branch information
peam1146 committed Aug 17, 2023
1 parent e7e57ae commit cda87ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/channel/channel.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ export class ChannelService {
packageName: string,
userId: string,
): Promise<void> {
const { channel_id: channelId } = await this.db
const guilds = await this.db
.selectFrom('guilds')
.where('guild_id', '=', guildId)
.select('channel_id')
.executeTakeFirst();

const channelId = guilds?.channel_id ?? null;
if (!channelId) {
throw new Error('Please set the channel first');
}
Expand Down

0 comments on commit cda87ff

Please sign in to comment.