Feature/23 migrate to typescript #73

Merged
Vylpes merged 19 commits from feature/23-migrate-to-typescript into develop 2021-12-04 15:51:41 +00:00
2 changed files with 22 additions and 45 deletions
Showing only changes of commit bb433749f8 - Show all commits

View file

@ -1,45 +0,0 @@
// Required components
const { command } = require('vylbot-core');
const { MessageEmbed } = require('discord.js');
const embedColor = "0x3050ba";
// Command Class
class about extends command {
constructor() {
// Set execute method, description, and category
super("about");
super.description = "About the bot";
super.category = "General";
// Set required configs in the config.about json string.
// description: The bot description
// version: The bot version
// author: Bot author
// date: Date of build
super.requiredConfigs = "description";
super.requiredConfigs = "version";
super.requiredConfigs = "core-ver";
super.requiredConfigs = "author";
super.requiredConfigs = "date";
}
// The execution method
about(context) {
// Create an embed containing data about the bot
const embed = new MessageEmbed()
.setTitle("About")
.setColor(embedColor)
.setDescription(context.client.config.about.description)
.addField("Version", context.client.config.about.version, true)
.addField("VylBot Core", context.client.config.about['core-ver'], true)
.addField("Author", context.client.config.about.author)
.addField("Date", context.client.config.about.date);
// Send embed to the channel the command was sent in
context.message.channel.send(embed);
}
}
// Set the about class to be exported
module.exports = about;

22
src/commands/about.ts Normal file
View file

@ -0,0 +1,22 @@
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
import { Command, ICommandContext } from "vylbot-core";
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
import { MessageEmbed } from "discord.js";
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
export default class About extends Command {
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
constructor() {
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
super();
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
super._category = "General";
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
}
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
public override execute(context: ICommandContext) {
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
const embed = new MessageEmbed()
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
.setTitle("About")
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
.setColor(process.env.EMBED_COLOUR!)
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
.setDescription("About the bot")
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
.addField("Version", process.env.BOT_VER)
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
.addField("VylBot Core", process.env.CORE_VER)
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
.addField("Author", process.env.BOT_AUTHOR)
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
.addField("Date", process.env.BOT_DATE);
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
context.message.channel.send(embed);
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
}
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made
}
VylpesTester commented 2021-12-03 17:26:31 +00:00 (Migrated from github.com)
Review

This should use the PublicEmbed class you made

This should use the `PublicEmbed` class you made