Skip to content

Conversation

AbdelMN
Copy link

@AbdelMN AbdelMN commented Feb 6, 2024

Add the quoi-feur feature in threads and allow thread owners to enable/disable the quoi-feur feature in their channels.

renovate bot and others added 3 commits January 5, 2024 13:13
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Peïo Thibault <[email protected]>
Comment on lines 68 to 73
const isOwner = (channel : Channel, user : User) => {
if(channel.type == ChannelType.PublicThread){
if(user.id == channel.ownerId) return true;
}
return;
}
Copy link
Contributor

@luca-montaigut luca-montaigut Feb 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const isOwner = (channel : Channel, user : User) => {
if(channel.type == ChannelType.PublicThread){
if(user.id == channel.ownerId) return true;
}
return;
}
const isThreadOwner = (channel : Channel, user : User) => channel.type === ChannelType.PublicThread && user.id === channel.ownerId

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I think it has to be moved in role.ts

export const addQuoiFeurToChannel = async (interaction: ChatInputCommandInteraction) => {
const { channel, memberPermissions, user } = interaction;

if (!memberPermissions || !channel || !channel.isTextBased() || (channel.type !== ChannelType.GuildText && channel.type !== ChannelType.PublicThread)) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!memberPermissions || !channel || !channel.isTextBased() || (channel.type !== ChannelType.GuildText && channel.type !== ChannelType.PublicThread)) return;
if (!memberPermissions || !channel || !channel.isTextBased() || ![ChannelType.GuildText, ChannelType.PublicThread].includes(channel.type)) return;


if (!memberPermissions || !channel || !channel.isTextBased() || (channel.type !== ChannelType.GuildText && channel.type !== ChannelType.PublicThread)) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

@AbdelMN AbdelMN changed the title feat(quoi-feur) : quoi-feur feat in threads feat(quoi-feur): quoi-feur feat in threads Feb 8, 2024
@AbdelMN AbdelMN closed this Feb 8, 2024
@AbdelMN AbdelMN reopened this Feb 8, 2024
@@ -1,11 +0,0 @@
# SETUP
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is delete ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants