Skip to content

Commit

Permalink
added a command for leaving a guild
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarmerer committed Sep 29, 2021
1 parent 924cf80 commit ab72525
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/commands/leave.js
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]}\``)
},
}

0 comments on commit ab72525

Please sign in to comment.