Skip to content

Commit

Permalink
🚨 fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Helloyunho committed Oct 11, 2022
1 parent 7611659 commit b4926f3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/rest/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ The `emoji` must be [URL Encoded](https://en.wikipedia.org/wiki/Percent-encoding
channelId: string,
payload: CreateThreadPayload
): Promise<ThreadChannelPayload> {
return this.startThreadWithoutMessage(channelId, payload)
return await this.startThreadWithoutMessage(channelId, payload)
}

/**
Expand Down
15 changes: 8 additions & 7 deletions src/structures/guildForumChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class GuildForumTag {
this.readFromData(data)
}

readFromData(data: GuildForumTagPayload) {
readFromData(data: GuildForumTagPayload): void {
this.id = data.id ?? this.id
this.name = data.name ?? this.name
this.moderated = data.moderated ?? this.moderated
Expand All @@ -63,12 +63,13 @@ export class GuildForumChannel extends GuildThreadAvailableChannel {
this.availableTags =
data.available_tags?.map((tag) => new GuildForumTag(tag)) ??
this.availableTags
this.defaultReactionEmoji = data.default_reaction_emoji
? new Emoji(this.client, {
id: data.default_reaction_emoji.emoji_id,
name: data.default_reaction_emoji.emoji_name
})
: this.defaultReactionEmoji
this.defaultReactionEmoji =
data.default_reaction_emoji !== null
? new Emoji(this.client, {
id: data.default_reaction_emoji.emoji_id,
name: data.default_reaction_emoji.emoji_name
})
: this.defaultReactionEmoji
this.defaultSortOrder = data.default_sort_order ?? this.defaultSortOrder
}

Expand Down
1 change: 0 additions & 1 deletion src/structures/guildThreadAvailableChannel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { AllMessageOptions } from '../../mod.ts'
import { Client } from '../client/client.ts'
import { ChannelThreadsManager } from '../managers/channelThreads.ts'
import {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ export class Permissions extends BitField {

any(permission: PermissionResolvable, checkAdmin = true): boolean {
return (
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
(checkAdmin && super.has(this.flags().ADMINISTRATOR)) ||
super.any(permission)
)
}

has(permission: PermissionResolvable, checkAdmin = true): boolean {
return (
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
(checkAdmin && super.has(this.flags().ADMINISTRATOR)) ||
super.has(permission)
)
Expand Down
4 changes: 2 additions & 2 deletions test/forum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const client = new Client()

client.on('ready', async () => {
const guild = await client.guilds.resolve('GUILD_ID')
if (guild) {
if (guild !== undefined) {
console.log('found guild')
const channel = await guild.channels.resolve('CHANNEL_ID')
if (channel && channel instanceof GuildForumChannel) {
if (channel !== undefined && channel instanceof GuildForumChannel) {
console.log('found channel')
const threads = await channel.threads.array()
console.log(threads)
Expand Down

0 comments on commit b4926f3

Please sign in to comment.