Skip to content

Commit

Permalink
Update ticket-system.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
chfuchte committed Aug 8, 2023
1 parent aaaaf5c commit 0997a1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/action/ticket-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import {
} from 'discord.js'
import { ILogger } from 'src/logger/logger'

export async function createTicket (client: Client, guild: Guild, memberId: string, logger: ILogger, name: string | undefined = undefined): Promise<TextChannel | string> {
export async function createTicket (client: Client, guild: Guild, memberId: string, logger: ILogger, name: string | undefined = undefined): Promise<TextChannel | null> {
if (name === undefined) name = nameGen()

const supporterRole = await guild.roles.fetch(process.env.TICKET_SUPPORTER ?? '')

if (supporterRole == null) {
logger.logSync('ERROR', 'Supporter-Rolle fehlt')
return 'Ticket konnte nicht erstellt werden.'
return null
}

const channel = await guild.channels.create({
Expand Down

0 comments on commit 0997a1b

Please sign in to comment.