Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
Create lvsv.js
Browse files Browse the repository at this point in the history
  • Loading branch information
HELLSNAKES committed Nov 2, 2021
1 parent f615e0e commit add99bd
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions commands/Bot/lvsv.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require("dotenv").config()
module.exports = {
name: "lvsv",
description: "leaveserver |adminbot only",
options: [
{
name: "id",
description: "id server",
type: 3,
required: true
}
],
run: async (interaction, client) => {
const id = interaction.options.getString("id")
const guild = client.guilds.cache.get(id)
try {
if (interaction.member.id !== process.env.Admin) {
return interaction.reply({ content: "AdminBot Only" })
}
if (!guild) {
return interaction.reply({ content: "No guild ID was specified. Please specify a guild ID" })
}

await guild.leave()
interaction.reply({ content: `Left **${guild.name}** with \`${guild.memberCount}\` members.` })
} catch (err) {
interaction.reply({ content: `An error occurred while leaving the server: \`${err.message}\`` })
}
}
}

0 comments on commit add99bd

Please sign in to comment.