This repository has been archived by the owner on Sep 29, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f615e0e
commit add99bd
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}\`` }) | ||
} | ||
} | ||
} |