enhancement(lint): Fix lint errors for src/commands/you_cant_join.ts

Co-authored-by: NeonGamerBot-QK <neon@saahild.com>
Signed-off-by: zeon-neon[bot] <136533918+zeon-neon[bot]@users.noreply.github.com>
This commit is contained in:
zeon-neon[bot] 2025-02-18 23:52:07 +00:00 committed by GitHub
parent 1a37bddcb5
commit bff48b5439
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,49 +2,52 @@
import { Command } from "../modules/BaseCommand";
import { ModifiedApp } from "../modules/slackapp";
const dev_ch_id = "C083C2ABX4K"
const dev_ch_id = "C083C2ABX4K";
export default class UserJoinEvent implements Command {
name: string;
description: string;
is_event?: boolean;
constructor() {
this.name = `member_joined_channel`;
this.description = `User no join channel `;
this.is_event = true;
}
run(app: ModifiedApp) {
let prod_channel_id = null;
// app.command()
app.event(this.name, async ({ event, say }) => {
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;
}
//@ts-ignore
await app.client.conversations.kick({
channel: channel,
users: user,
});
//@ts-ignore
await app.client.chat.postMessage({
//@ts-ignore
channel,
//@ts-ignore
text: `You cant join <@${user}>`
})
});
}
name: string;
description: string;
is_event?: boolean;
constructor() {
this.name = `member_joined_channel`;
this.description = `User no join channel `;
this.is_event = true;
}
run(app: ModifiedApp) {
let prod_channel_id = null;
// app.command()
app.event(this.name, async ({ event, say }) => {
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;
}
//@ts-ignore
await app.client.conversations.kick({
channel: channel,
users: user,
});
//@ts-ignore
await app.client.chat.postMessage({
//@ts-ignore
channel,
//@ts-ignore
text: `You cant join <@${user}>`,
});
});
}
}