Skip to content

Commit

Permalink
make thread pinger work for all types
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Mar 31, 2024
1 parent 046b73b commit 3b37a8a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,7 @@ client.once(Events.ClientReady, async () => {

client.on(Events.ThreadCreate, async (channel) => {
try {
if (
channel.type === ChannelType.PublicThread &&
channel.parent &&
channel.parent.name === 'support' &&
channel.guild
) {
if (channel.type === ChannelType.PublicThread && channel.guild) {
const pingRole = channel.guild.roles.cache.find(
(r) => r.name === 'Moderator'
)!;
Expand All @@ -101,9 +96,14 @@ client.on(Events.ThreadCreate, async (channel) => {
'Bringing mods into this thread so they can see it!'
);
await message.edit(`${pingRole}`);
await message.edit(
`Hello <@!${channel.ownerId}>! Someone will help you shortly, please do not ping moderators or other people and just wait for someone to come help.`
);

if (channel.parent && channel.parent.name === 'support') {
await message.edit(
`Hello <@!${channel.ownerId}>! Someone will help you shortly, please do not ping moderators or other people and just wait for someone to come help.`
);
} else {
await message.delete()
}
}
} catch (error) {
console.error('Error handling ThreadCreate', error);
Expand Down

0 comments on commit 3b37a8a

Please sign in to comment.