const ESMCommand = require("../esm_command"); module.exports = class ESMCommand_ID extends ESMCommand { constructor(bot) { super(bot); this.permissions = { text_only: true }; this.information = { name: "id", category: "system", help: "Displays the current community's ID. This only works in a community's text channels" }; } async fromDiscord() { let guild = this.message.guild; if (guild == null || !guild.available) return; let communityID = await this.db.getCommunityID(guild.id); if (communityID == null) { return this.ESMBot.send(this.message.channel, this.errors.format(this.message.author, "FAILED_TO_FIND_COMMUNITY")); } this.ESMBot.send(this.message.channel, `**${guild.name}'s** community ID is: \`${communityID}\`\nFor a list of servers, use \`!servers ${communityID}\``); } }