This commit is contained in:
Saahil 2025-02-18 19:04:31 -05:00 committed by GitHub
parent 3e591e4cf6
commit cc4325ffd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,22 +19,9 @@ export default class UserJoinEvent implements Command {
console.debug(event, "#userjoin");
//@ts-ignore
const { user, channel } = event;
if (!prod_channel_id) {
const channelInfo = await app.client.conversations.info({
channel: channel,
});
const channelName = channelInfo.channel.name;
//@ts-ignore
if (
event.channel !== dev_ch_id &&
channelName !== "u-cant-join-this-channel"
)
return;
prod_channel_id = channelInfo.channel.id;
} else {
if (event.channel !== prod_channel_id) return;
}
if (event.channel !== "C08ELF4UK96") return;
try {
//@ts-ignore
await app.client.conversations.kick({
@ -48,6 +35,16 @@ export default class UserJoinEvent implements Command {
//@ts-ignore
text: `You cant join <@${user}>`,
});
} catch (e) {
//@ts-ignore
await app.client.chat.postMessage({
//@ts-ignore
channel,
//@ts-ignore
text: `You are here for now <@${user}>`,
});
}
});
}
}