feat: variable skilled bot username

This commit is contained in:
TresAbhi committed 2023-04-28 13:52:31 +00:00
1 parent a3b2a34d7f
commit 8749c21010
5 files changed
+15 -10

No files matched your search

+5 -5
View File
@@ -2,6 +2,10 @@
Executes specific tasks in the Skilled Discord server. Executes specific tasks in the Skilled Discord server.
## Invite the Bot
Join the [Skilled Discord server](https://discord.gg/ZPvcEG7DS8), click on the bot's profile, and click "Add to Server".
## Using ## Using
### Installing dependencies ### Installing dependencies
@@ -10,12 +14,8 @@ Executes specific tasks in the Skilled Discord server.
yarn yarn
``` ```
### Configuring
Add an `.env` file to the root of the project with your `DISCORD_TOKEN` and `WARGAMING_APPLICATION_ID`
### Running ### Running
```bash ```bash
yarn start yarn start discord-token=<token> wargaming-application-id=<id>
``` ```
+1 -1
View File
@@ -17,7 +17,7 @@ function handleError(error: Error, client: Client) {
).send({ ).send({
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setTitle('Skilled Bot ran into a catastrophic error') .setTitle(`${client.user?.username} ran into a catastrophic error`)
.setColor(NEGATIVE_COLOR) .setColor(NEGATIVE_COLOR)
.setDescription( .setDescription(
`\`\`\`${error.name}\n${error.message}\n${error.stack}\n${error.cause}\`\`\``, `\`\`\`${error.name}\n${error.message}\n${error.stack}\n${error.cause}\`\`\``,
+2 -1
View File
@@ -4,6 +4,7 @@ import { CommandRegistry } from '../behaviors/interactionCreate.js';
import { SKILLED_COLOR } from '../constants/colors.js'; import { SKILLED_COLOR } from '../constants/colors.js';
import getClientId from '../utilities/getClientId.js'; import getClientId from '../utilities/getClientId.js';
import { tankopedia } from '../utilities/tankopedia.js'; import { tankopedia } from '../utilities/tankopedia.js';
import { client } from '../index.js';
const executionStart = new Date().getTime(); const executionStart = new Date().getTime();
@@ -23,7 +24,7 @@ export default {
await interaction.reply({ await interaction.reply({
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setTitle('Skilled Bot debug information') .setTitle(`${client.user?.username} debug information`)
.setColor(SKILLED_COLOR) .setColor(SKILLED_COLOR)
.setDescription( .setDescription(
`**Version**: ${packageJSON.version}\n**Uptime**: ${Math.floor( `**Version**: ${packageJSON.version}\n**Uptime**: ${Math.floor(
+5 -2
View File
@@ -6,6 +6,7 @@ import {
publicCommands, publicCommands,
} from '../behaviors/interactionCreate.js'; } from '../behaviors/interactionCreate.js';
import { SKILLED_COLOR } from '../constants/colors.js'; import { SKILLED_COLOR } from '../constants/colors.js';
import { client } from '../index.js';
export default { export default {
inProduction: true, inProduction: true,
@@ -20,10 +21,12 @@ export default {
await interaction.reply({ await interaction.reply({
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setTitle('Skilled Bot help') .setTitle(`${client.user?.username} help`)
.setColor(SKILLED_COLOR) .setColor(SKILLED_COLOR)
.setDescription( .setDescription(
`**About**\nSkilled Bot automates many mundane tasks and provide statistics in numerous flexible ways.\n\nMade by TresAbhi from the Skilled [SKLLD] clan.\nGitHub: https://github.com/sklld/bot\nSkilled: https://discord.gg/ZPvcEG7DS8\n\n**Commands**\n${(interaction.guildId === `**About**\n${
client.user?.username
} automates many mundane tasks and provide statistics in numerous flexible ways.\n\nMade by TresAbhi from the Skilled [SKLLD] clan.\nGitHub: https://github.com/sklld/bot\nSkilled: https://discord.gg/ZPvcEG7DS8\n\n**Commands**\n${(interaction.guildId ===
discord.guild_id discord.guild_id
? [...guildCommands, ...publicCommands] ? [...guildCommands, ...publicCommands]
: publicCommands : publicCommands
+2 -1
View File
@@ -4,6 +4,7 @@ import {
EmbedBuilder, EmbedBuilder,
} from 'discord.js'; } from 'discord.js';
import { NEGATIVE_COLOR } from '../constants/colors.js'; import { NEGATIVE_COLOR } from '../constants/colors.js';
import { client } from '../index.js';
export default async function wargamingError( export default async function wargamingError(
interaction: ChatInputCommandInteraction<CacheType>, interaction: ChatInputCommandInteraction<CacheType>,
@@ -12,7 +13,7 @@ export default async function wargamingError(
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setColor(NEGATIVE_COLOR) .setColor(NEGATIVE_COLOR)
.setTitle('Skilled Bot ran into an issue') .setTitle(`${client.user?.username} ran into an issue`)
.setDescription('Wargaming returned an error. Please try again later.'), .setDescription('Wargaming returned an error. Please try again later.'),
], ],
}); });