mirror of
https://github.com/System-End/slack-end.git
synced 2026-04-20 00:25:23 +00:00
fix:a
This commit is contained in:
parent
3e591e4cf6
commit
cc4325ffd9
1 changed files with 13 additions and 16 deletions
|
|
@ -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}>`,
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue