-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
1 changed file
with
26 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,26 @@ | ||
const { client } = require('../client') | ||
const { prefix } = require('#config').get('prefix', 'home_server') | ||
|
||
const { respond, reply } = require('../utils') | ||
|
||
module.exports = { | ||
name: 'leave', | ||
unlisted: true, | ||
needsArgs: true, | ||
permissions: ['owner'], | ||
description: 'leave a specific guild', | ||
usage: `Usage: \`${prefix}leave <guild id>\``, | ||
examples: { | ||
valid: [`${prefix}leave <guild id>`], | ||
}, | ||
|
||
async execute(message, args) { | ||
const guild = await client.guilds.fetch(args[0]) | ||
if (!guild) | ||
return reply(message, `Could not find guild with id \`${args[0]}\``) | ||
|
||
guild.leave() | ||
|
||
respond(message, `Left guild \`${guild.name}\` with id \`${args[0]}\``) | ||
}, | ||
} |