()
| 5 | |
| 6 | class InfoCommand extends Command { |
| 7 | async run() { |
| 8 | if (!this.permissions.has("EMBED_LINKS")) { |
| 9 | this.success = false; |
| 10 | return this.getString("permissions.noEmbedLinks"); |
| 11 | } |
| 12 | const owners = process.env.OWNER?.split(",") ?? []; |
| 13 | let owner; |
| 14 | if (owners.length !== 0) { |
| 15 | owner = this.client.users.get(owners[0]); |
| 16 | if (!owner) owner = await this.client.rest.users.get(owners[0]); |
| 17 | } |
| 18 | const servers = await getServers(this.client); |
| 19 | await this.acknowledge(); |
| 20 | return { |
| 21 | embeds: [ |
| 22 | { |
| 23 | color: 0xff0000, |
| 24 | author: { |
| 25 | name: "esmBot Info/Credits", |
| 26 | iconURL: this.client.user.avatarURL(), |
| 27 | }, |
| 28 | description: this.getString("managedBy", { params: { owner: owner?.username ?? "N/A" } }), |
| 29 | fields: [ |
| 30 | { |
| 31 | name: `ℹ️ ${this.getString("commands.responses.info.version")}`, |
| 32 | value: `v${packageJson.version}${process.env.NODE_ENV === "development" ? `-dev (${process.env.GIT_REV})` : ""}`, |
| 33 | }, |
| 34 | { |
| 35 | name: `📝 ${this.getString("commands.responses.info.creditsHeader")}`, |
| 36 | value: this.getString("commands.responses.info.credits"), |
| 37 | }, |
| 38 | { |
| 39 | name: `💬 ${this.getString("commands.responses.info.totalServers")}`, |
| 40 | value: servers |
| 41 | ? servers.toString() |
| 42 | : this.getString("commands.responses.info.processOnly", { |
| 43 | params: { count: this.client.guilds.size.toString() }, |
| 44 | }), |
| 45 | }, |
| 46 | { |
| 47 | name: `✅ ${this.getString("commands.responses.info.officialServer")}`, |
| 48 | value: `[${this.getString("commands.responses.info.clickHere")}](https://esmbot.net/support)`, |
| 49 | }, |
| 50 | { |
| 51 | name: `💻 ${this.getString("commands.responses.info.sourceCode")}`, |
| 52 | value: `[${this.getString("commands.responses.info.clickHere")}](https://github.com/esmBot/esmBot)`, |
| 53 | }, |
| 54 | { |
| 55 | name: `🌐 ${this.getString("commands.responses.info.translate")}`, |
| 56 | value: `[${this.getString("commands.responses.info.clickHere")}](https://translate.codeberg.org/projects/esmbot/esmbot/)`, |
| 57 | }, |
| 58 | { |
| 59 | name: `🛡️ ${this.getString("commands.responses.info.privacyPolicy")}`, |
| 60 | value: `[${this.getString("commands.responses.info.clickHere")}](https://esmbot.net/privacy.html)`, |
| 61 | }, |
| 62 | { |
| 63 | name: "🐘 Mastodon:", |
| 64 | value: `[${this.getString("commands.responses.info.clickHere")}](https://wetdry.world/@esmBot)`, |
nothing calls this directly
no test coverage detected