Skip to content

Commit

Permalink
add kick feature
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-flip committed Mar 4, 2024
1 parent 8a82142 commit 97705f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions functions/ENGINE/checkin/COMPONENT/button/deny.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { EmbedBuilder } = require('discord.js');

const embed = new EmbedBuilder()
.setTitle('Check-in declined')
.setDescription('It seems like your check-in got declined. Please get in touch with the team.')
.setDescription('It seems like your check-in got declined or you exceed your stay with not replying back.')
.setColor('Red');

module.exports.run = async (interaction) => {
Expand All @@ -11,10 +11,12 @@ module.exports.run = async (interaction) => {

const checkinChannel = interaction.channel;
const userID = checkinChannel.name;
const user = await client.users.fetch(userID);
const user = await interaction.guild.members.fetch(userID);
user.send({ embeds: [embed] }).catch((e) => null);

await client.functions.get('ENGINE_checkin_transcriptChannel').run(checkinChannel);

await user.kick('Checkin Denied');
// delete channel
await checkinChannel.delete();
};
Expand Down

0 comments on commit 97705f4

Please sign in to comment.