vylbot-app/tests/client/client.test.ts

129 lines
4.2 KiB
TypeScript
Raw Normal View History

2024-03-20 18:30:58 +00:00
import { Partials, Client } from "discord.js";
import { CoreClient } from "../../src/client/client";
import * as dotenv from "dotenv";
import AppDataSource from "../../src/database/dataSources/appDataSource";
import { Util } from "../../src/client/util";
import { Command } from "../../src/type/command";
import { EventType } from "../../src/constants/EventType";
import { ButtonEvent } from "../../src/type/buttonEvent";
jest.mock("dotenv");
beforeEach(() => {
jest.clearAllMocks();
process.env = {};
});
2024-02-03 19:29:28 +00:00
describe('constructor', () => {
2024-03-20 18:30:58 +00:00
test("EXPECT properties to be set", () => {
const client = new CoreClient([1, 2, 3], [Partials.User]);
expect(dotenv.config).toHaveBeenCalledTimes(1);
expect(client).toBeDefined();
expect(CoreClient.commandItems).toEqual([]);
expect(CoreClient.eventItems).toEqual([]);
expect(CoreClient.buttonEvents).toEqual([]);
expect(client).toHaveProperty("_events");
expect(client).toHaveProperty("_util");
});
v3.0 (#145) * Change rules.txt to rules.json (#31) * Migrate to yarn * Add role configs to config template * Install packges and setup typescript * Migrate entry point * Migrate about command * Migrate ban command * Migrate clear command * Migrate kick command * Migrate mute command * Migrate poll command * Migrate bunny command * Update required roles checker * Migrate role command * Migrate unmute command * Migrate warn command * Migrate eval command * Migrate help command * Migrate rules command * Migrate events to typescript * Update about command to use the PublicEmbed class * Update ErrorMessage to ChannelNotFound * Update messageDelete event to ignore bots * Feature/74 merge vylbot core (#80) * Merge VylBot-Core * Update commands to new system * Fix issue where events would not load * Feature/12 create tests (#102) * Fix tests * Update coverage * Remove unrequired mock files * Add about command test * Update about tests * Ban command tests * eval command tests * Start help command tests * Add help command tests * Add kick command tests * Mute command tests * Poll command tests * Add role command tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add rules command tests * Add unmute command tests * Add warn command tests * Add MemberEvents tests * Add GuildMemberUpdate tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add MessageEvents tests * Add StringTools test Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add embed tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add GitHub Actions Signed-off-by: Ethan Lane <ethan@vylpes.com> * Move to tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove linting script Signed-off-by: Ethan Lane <ethan@vylpes.com> * Update rules with blog website and event spoilers rule" (#106) Signed-off-by: Ethan Lane <ethan@vylpes.com> * Containerise bot (#107) * Add moderator names to audit reason (#108) * Feature/48 database (#114) * Add database and default values * Add ability to save a setting to the database * Get commands and events to use database * Setup and config command * Update commands to check roles per server * Different rules per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Different prefix per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add verification system Signed-off-by: Ethan Lane <ethan@vylpes.com> * Disabled commands per server * Add devmode for default prefix * Update embeds * Fix broken tests * Feature/66 add different commands per server (#122) * Add ability for server exclusive commands * Add MankBot server-exclusive commands * Add lobby entity to database * Add documentation * Add setup command for lobby (#123) * Update bot to discord.js v13 (#125) * Update bot to discord.js v13 * Remove debug code * 110 commandshelp about command errors which causes command to not run (#126) * Change onMessage to onMessageCreate * Fix help command * Add override for bot owner and server owner (#135) * Change help command so exclusive commands can only be seen for the server they're assigned to (#136) * Change parsing to not crash if invalid (#142) * 137 role command cannot read properties of undefined (#141) * Fix issue with bot crashing * Fix server prefix not showing * Add easy way to configure role command * Move help text to its own directory * Make role config command to use role id * Get lobby command to use IDs instead of names (#144) Co-authored-by: Vylpes <getgravitysoftware@gmail.com>
2022-04-24 14:46:37 +01:00
});
2024-02-03 19:29:28 +00:00
describe('start', () => {
2024-03-20 18:30:58 +00:00
test("EXPECT bot to start", async () => {
process.env.BOT_TOKEN = "token";
console.error = jest.fn();
AppDataSource.initialize = jest.fn().mockResolvedValue(undefined);
const client = new CoreClient([1, 2, 3], [Partials.User]);
const loadSlashCommands = jest.spyOn(Util.prototype, "loadSlashCommands").mockImplementation();
const loadEvents = jest.spyOn(Util.prototype, "loadEvents").mockImplementation();
Client.prototype.login = jest.fn();
Client.prototype.on = jest.fn();
await client.start();
expect(AppDataSource.initialize).toHaveBeenCalledTimes(1);
expect(console.error).not.toHaveBeenCalled();
expect(client.login).toHaveBeenCalledTimes(1);
expect(client.login).toHaveBeenCalledWith("token");
v3.0 (#145) * Change rules.txt to rules.json (#31) * Migrate to yarn * Add role configs to config template * Install packges and setup typescript * Migrate entry point * Migrate about command * Migrate ban command * Migrate clear command * Migrate kick command * Migrate mute command * Migrate poll command * Migrate bunny command * Update required roles checker * Migrate role command * Migrate unmute command * Migrate warn command * Migrate eval command * Migrate help command * Migrate rules command * Migrate events to typescript * Update about command to use the PublicEmbed class * Update ErrorMessage to ChannelNotFound * Update messageDelete event to ignore bots * Feature/74 merge vylbot core (#80) * Merge VylBot-Core * Update commands to new system * Fix issue where events would not load * Feature/12 create tests (#102) * Fix tests * Update coverage * Remove unrequired mock files * Add about command test * Update about tests * Ban command tests * eval command tests * Start help command tests * Add help command tests * Add kick command tests * Mute command tests * Poll command tests * Add role command tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add rules command tests * Add unmute command tests * Add warn command tests * Add MemberEvents tests * Add GuildMemberUpdate tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add MessageEvents tests * Add StringTools test Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add embed tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add GitHub Actions Signed-off-by: Ethan Lane <ethan@vylpes.com> * Move to tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove linting script Signed-off-by: Ethan Lane <ethan@vylpes.com> * Update rules with blog website and event spoilers rule" (#106) Signed-off-by: Ethan Lane <ethan@vylpes.com> * Containerise bot (#107) * Add moderator names to audit reason (#108) * Feature/48 database (#114) * Add database and default values * Add ability to save a setting to the database * Get commands and events to use database * Setup and config command * Update commands to check roles per server * Different rules per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Different prefix per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add verification system Signed-off-by: Ethan Lane <ethan@vylpes.com> * Disabled commands per server * Add devmode for default prefix * Update embeds * Fix broken tests * Feature/66 add different commands per server (#122) * Add ability for server exclusive commands * Add MankBot server-exclusive commands * Add lobby entity to database * Add documentation * Add setup command for lobby (#123) * Update bot to discord.js v13 (#125) * Update bot to discord.js v13 * Remove debug code * 110 commandshelp about command errors which causes command to not run (#126) * Change onMessage to onMessageCreate * Fix help command * Add override for bot owner and server owner (#135) * Change help command so exclusive commands can only be seen for the server they're assigned to (#136) * Change parsing to not crash if invalid (#142) * 137 role command cannot read properties of undefined (#141) * Fix issue with bot crashing * Fix server prefix not showing * Add easy way to configure role command * Move help text to its own directory * Make role config command to use role id * Get lobby command to use IDs instead of names (#144) Co-authored-by: Vylpes <getgravitysoftware@gmail.com>
2022-04-24 14:46:37 +01:00
2024-03-20 18:30:58 +00:00
expect(client.on).toHaveBeenCalledTimes(2);
expect(client.on).toHaveBeenCalledWith("interactionCreate", expect.any(Function));
expect(client.on).toHaveBeenCalledWith("ready", expect.any(Function))
v3.0 (#145) * Change rules.txt to rules.json (#31) * Migrate to yarn * Add role configs to config template * Install packges and setup typescript * Migrate entry point * Migrate about command * Migrate ban command * Migrate clear command * Migrate kick command * Migrate mute command * Migrate poll command * Migrate bunny command * Update required roles checker * Migrate role command * Migrate unmute command * Migrate warn command * Migrate eval command * Migrate help command * Migrate rules command * Migrate events to typescript * Update about command to use the PublicEmbed class * Update ErrorMessage to ChannelNotFound * Update messageDelete event to ignore bots * Feature/74 merge vylbot core (#80) * Merge VylBot-Core * Update commands to new system * Fix issue where events would not load * Feature/12 create tests (#102) * Fix tests * Update coverage * Remove unrequired mock files * Add about command test * Update about tests * Ban command tests * eval command tests * Start help command tests * Add help command tests * Add kick command tests * Mute command tests * Poll command tests * Add role command tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add rules command tests * Add unmute command tests * Add warn command tests * Add MemberEvents tests * Add GuildMemberUpdate tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add MessageEvents tests * Add StringTools test Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add embed tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add GitHub Actions Signed-off-by: Ethan Lane <ethan@vylpes.com> * Move to tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove linting script Signed-off-by: Ethan Lane <ethan@vylpes.com> * Update rules with blog website and event spoilers rule" (#106) Signed-off-by: Ethan Lane <ethan@vylpes.com> * Containerise bot (#107) * Add moderator names to audit reason (#108) * Feature/48 database (#114) * Add database and default values * Add ability to save a setting to the database * Get commands and events to use database * Setup and config command * Update commands to check roles per server * Different rules per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Different prefix per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add verification system Signed-off-by: Ethan Lane <ethan@vylpes.com> * Disabled commands per server * Add devmode for default prefix * Update embeds * Fix broken tests * Feature/66 add different commands per server (#122) * Add ability for server exclusive commands * Add MankBot server-exclusive commands * Add lobby entity to database * Add documentation * Add setup command for lobby (#123) * Update bot to discord.js v13 (#125) * Update bot to discord.js v13 * Remove debug code * 110 commandshelp about command errors which causes command to not run (#126) * Change onMessage to onMessageCreate * Fix help command * Add override for bot owner and server owner (#135) * Change help command so exclusive commands can only be seen for the server they're assigned to (#136) * Change parsing to not crash if invalid (#142) * 137 role command cannot read properties of undefined (#141) * Fix issue with bot crashing * Fix server prefix not showing * Add easy way to configure role command * Move help text to its own directory * Make role config command to use role id * Get lobby command to use IDs instead of names (#144) Co-authored-by: Vylpes <getgravitysoftware@gmail.com>
2022-04-24 14:46:37 +01:00
2024-03-20 18:30:58 +00:00
expect(loadSlashCommands).toHaveBeenCalledTimes(1);
expect(loadSlashCommands).toHaveBeenCalledWith(client);
expect(loadEvents).toHaveBeenCalledTimes(1);
expect(loadEvents).toHaveBeenCalledWith(client, []);
});
test("GIVEN BOT_TOKEN is not in env var, EXPECT error", async () => {
console.error = jest.fn();
const client = new CoreClient([1, 2, 3], [ Partials.User ]);
await client.start();
expect(console.error).toHaveBeenCalledWith("BOT_TOKEN is not defined in .env");
});
test("GIVEN database connection can not be initialised, EXPECT error", async () => {
process.env.BOT_TOKEN = "token";
console.log = jest.fn();
console.error = jest.fn();
AppDataSource.initialize = jest.fn().mockRejectedValue("error");
const client = new CoreClient([1, 2, 3], [Partials.User]);
await client.start();
expect(console.log).not.toHaveBeenCalled();
expect(console.error).toHaveBeenCalledWith("Error Initialising Data Source", "error");
});
v3.0 (#145) * Change rules.txt to rules.json (#31) * Migrate to yarn * Add role configs to config template * Install packges and setup typescript * Migrate entry point * Migrate about command * Migrate ban command * Migrate clear command * Migrate kick command * Migrate mute command * Migrate poll command * Migrate bunny command * Update required roles checker * Migrate role command * Migrate unmute command * Migrate warn command * Migrate eval command * Migrate help command * Migrate rules command * Migrate events to typescript * Update about command to use the PublicEmbed class * Update ErrorMessage to ChannelNotFound * Update messageDelete event to ignore bots * Feature/74 merge vylbot core (#80) * Merge VylBot-Core * Update commands to new system * Fix issue where events would not load * Feature/12 create tests (#102) * Fix tests * Update coverage * Remove unrequired mock files * Add about command test * Update about tests * Ban command tests * eval command tests * Start help command tests * Add help command tests * Add kick command tests * Mute command tests * Poll command tests * Add role command tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add rules command tests * Add unmute command tests * Add warn command tests * Add MemberEvents tests * Add GuildMemberUpdate tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add MessageEvents tests * Add StringTools test Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add embed tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add GitHub Actions Signed-off-by: Ethan Lane <ethan@vylpes.com> * Move to tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove linting script Signed-off-by: Ethan Lane <ethan@vylpes.com> * Update rules with blog website and event spoilers rule" (#106) Signed-off-by: Ethan Lane <ethan@vylpes.com> * Containerise bot (#107) * Add moderator names to audit reason (#108) * Feature/48 database (#114) * Add database and default values * Add ability to save a setting to the database * Get commands and events to use database * Setup and config command * Update commands to check roles per server * Different rules per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Different prefix per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add verification system Signed-off-by: Ethan Lane <ethan@vylpes.com> * Disabled commands per server * Add devmode for default prefix * Update embeds * Fix broken tests * Feature/66 add different commands per server (#122) * Add ability for server exclusive commands * Add MankBot server-exclusive commands * Add lobby entity to database * Add documentation * Add setup command for lobby (#123) * Update bot to discord.js v13 (#125) * Update bot to discord.js v13 * Remove debug code * 110 commandshelp about command errors which causes command to not run (#126) * Change onMessage to onMessageCreate * Fix help command * Add override for bot owner and server owner (#135) * Change help command so exclusive commands can only be seen for the server they're assigned to (#136) * Change parsing to not crash if invalid (#142) * 137 role command cannot read properties of undefined (#141) * Fix issue with bot crashing * Fix server prefix not showing * Add easy way to configure role command * Move help text to its own directory * Make role config command to use role id * Get lobby command to use IDs instead of names (#144) Co-authored-by: Vylpes <getgravitysoftware@gmail.com>
2022-04-24 14:46:37 +01:00
});
describe('RegisterCommand', () => {
2024-03-20 18:30:58 +00:00
test("EXPECT command to be added to list", () => {
CoreClient.RegisterCommand("name", {} as Command, "serverId");
expect(CoreClient.commandItems).toStrictEqual([
{
Name: "name",
Command: {},
ServerId: "serverId",
}
])
});
v3.0 (#145) * Change rules.txt to rules.json (#31) * Migrate to yarn * Add role configs to config template * Install packges and setup typescript * Migrate entry point * Migrate about command * Migrate ban command * Migrate clear command * Migrate kick command * Migrate mute command * Migrate poll command * Migrate bunny command * Update required roles checker * Migrate role command * Migrate unmute command * Migrate warn command * Migrate eval command * Migrate help command * Migrate rules command * Migrate events to typescript * Update about command to use the PublicEmbed class * Update ErrorMessage to ChannelNotFound * Update messageDelete event to ignore bots * Feature/74 merge vylbot core (#80) * Merge VylBot-Core * Update commands to new system * Fix issue where events would not load * Feature/12 create tests (#102) * Fix tests * Update coverage * Remove unrequired mock files * Add about command test * Update about tests * Ban command tests * eval command tests * Start help command tests * Add help command tests * Add kick command tests * Mute command tests * Poll command tests * Add role command tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add rules command tests * Add unmute command tests * Add warn command tests * Add MemberEvents tests * Add GuildMemberUpdate tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add MessageEvents tests * Add StringTools test Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add embed tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add GitHub Actions Signed-off-by: Ethan Lane <ethan@vylpes.com> * Move to tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove linting script Signed-off-by: Ethan Lane <ethan@vylpes.com> * Update rules with blog website and event spoilers rule" (#106) Signed-off-by: Ethan Lane <ethan@vylpes.com> * Containerise bot (#107) * Add moderator names to audit reason (#108) * Feature/48 database (#114) * Add database and default values * Add ability to save a setting to the database * Get commands and events to use database * Setup and config command * Update commands to check roles per server * Different rules per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Different prefix per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add verification system Signed-off-by: Ethan Lane <ethan@vylpes.com> * Disabled commands per server * Add devmode for default prefix * Update embeds * Fix broken tests * Feature/66 add different commands per server (#122) * Add ability for server exclusive commands * Add MankBot server-exclusive commands * Add lobby entity to database * Add documentation * Add setup command for lobby (#123) * Update bot to discord.js v13 (#125) * Update bot to discord.js v13 * Remove debug code * 110 commandshelp about command errors which causes command to not run (#126) * Change onMessage to onMessageCreate * Fix help command * Add override for bot owner and server owner (#135) * Change help command so exclusive commands can only be seen for the server they're assigned to (#136) * Change parsing to not crash if invalid (#142) * 137 role command cannot read properties of undefined (#141) * Fix issue with bot crashing * Fix server prefix not showing * Add easy way to configure role command * Move help text to its own directory * Make role config command to use role id * Get lobby command to use IDs instead of names (#144) Co-authored-by: Vylpes <getgravitysoftware@gmail.com>
2022-04-24 14:46:37 +01:00
});
2024-02-03 19:29:28 +00:00
describe("RegisterEvent", () => {
2024-03-20 18:30:58 +00:00
test("EXPECT event to be added to list", () => {
CoreClient.RegisterEvent(EventType.ChannelCreate, () => {});
expect(CoreClient.eventItems).toStrictEqual([
{
EventType: EventType.ChannelCreate,
ExecutionFunction: expect.any(Function),
}
]);
});
2024-02-03 19:29:28 +00:00
});
v3.0 (#145) * Change rules.txt to rules.json (#31) * Migrate to yarn * Add role configs to config template * Install packges and setup typescript * Migrate entry point * Migrate about command * Migrate ban command * Migrate clear command * Migrate kick command * Migrate mute command * Migrate poll command * Migrate bunny command * Update required roles checker * Migrate role command * Migrate unmute command * Migrate warn command * Migrate eval command * Migrate help command * Migrate rules command * Migrate events to typescript * Update about command to use the PublicEmbed class * Update ErrorMessage to ChannelNotFound * Update messageDelete event to ignore bots * Feature/74 merge vylbot core (#80) * Merge VylBot-Core * Update commands to new system * Fix issue where events would not load * Feature/12 create tests (#102) * Fix tests * Update coverage * Remove unrequired mock files * Add about command test * Update about tests * Ban command tests * eval command tests * Start help command tests * Add help command tests * Add kick command tests * Mute command tests * Poll command tests * Add role command tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add rules command tests * Add unmute command tests * Add warn command tests * Add MemberEvents tests * Add GuildMemberUpdate tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add MessageEvents tests * Add StringTools test Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add embed tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add GitHub Actions Signed-off-by: Ethan Lane <ethan@vylpes.com> * Move to tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove linting script Signed-off-by: Ethan Lane <ethan@vylpes.com> * Update rules with blog website and event spoilers rule" (#106) Signed-off-by: Ethan Lane <ethan@vylpes.com> * Containerise bot (#107) * Add moderator names to audit reason (#108) * Feature/48 database (#114) * Add database and default values * Add ability to save a setting to the database * Get commands and events to use database * Setup and config command * Update commands to check roles per server * Different rules per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Different prefix per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add verification system Signed-off-by: Ethan Lane <ethan@vylpes.com> * Disabled commands per server * Add devmode for default prefix * Update embeds * Fix broken tests * Feature/66 add different commands per server (#122) * Add ability for server exclusive commands * Add MankBot server-exclusive commands * Add lobby entity to database * Add documentation * Add setup command for lobby (#123) * Update bot to discord.js v13 (#125) * Update bot to discord.js v13 * Remove debug code * 110 commandshelp about command errors which causes command to not run (#126) * Change onMessage to onMessageCreate * Fix help command * Add override for bot owner and server owner (#135) * Change help command so exclusive commands can only be seen for the server they're assigned to (#136) * Change parsing to not crash if invalid (#142) * 137 role command cannot read properties of undefined (#141) * Fix issue with bot crashing * Fix server prefix not showing * Add easy way to configure role command * Move help text to its own directory * Make role config command to use role id * Get lobby command to use IDs instead of names (#144) Co-authored-by: Vylpes <getgravitysoftware@gmail.com>
2022-04-24 14:46:37 +01:00
2024-02-03 19:29:28 +00:00
describe("RegisterButtonEvent", () => {
2024-03-20 18:30:58 +00:00
test("EXPECT button event to be added to list", () => {
CoreClient.RegisterButtonEvent("buttonId", {} as ButtonEvent);
expect(CoreClient.buttonEvents).toStrictEqual([
{
ButtonId: "buttonId",
Event: {},
}
])
});
v3.0 (#145) * Change rules.txt to rules.json (#31) * Migrate to yarn * Add role configs to config template * Install packges and setup typescript * Migrate entry point * Migrate about command * Migrate ban command * Migrate clear command * Migrate kick command * Migrate mute command * Migrate poll command * Migrate bunny command * Update required roles checker * Migrate role command * Migrate unmute command * Migrate warn command * Migrate eval command * Migrate help command * Migrate rules command * Migrate events to typescript * Update about command to use the PublicEmbed class * Update ErrorMessage to ChannelNotFound * Update messageDelete event to ignore bots * Feature/74 merge vylbot core (#80) * Merge VylBot-Core * Update commands to new system * Fix issue where events would not load * Feature/12 create tests (#102) * Fix tests * Update coverage * Remove unrequired mock files * Add about command test * Update about tests * Ban command tests * eval command tests * Start help command tests * Add help command tests * Add kick command tests * Mute command tests * Poll command tests * Add role command tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add rules command tests * Add unmute command tests * Add warn command tests * Add MemberEvents tests * Add GuildMemberUpdate tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add MessageEvents tests * Add StringTools test Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add embed tests Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add GitHub Actions Signed-off-by: Ethan Lane <ethan@vylpes.com> * Move to tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove tslint Signed-off-by: Ethan Lane <ethan@vylpes.com> * Remove linting script Signed-off-by: Ethan Lane <ethan@vylpes.com> * Update rules with blog website and event spoilers rule" (#106) Signed-off-by: Ethan Lane <ethan@vylpes.com> * Containerise bot (#107) * Add moderator names to audit reason (#108) * Feature/48 database (#114) * Add database and default values * Add ability to save a setting to the database * Get commands and events to use database * Setup and config command * Update commands to check roles per server * Different rules per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Different prefix per server Signed-off-by: Ethan Lane <ethan@vylpes.com> * Add verification system Signed-off-by: Ethan Lane <ethan@vylpes.com> * Disabled commands per server * Add devmode for default prefix * Update embeds * Fix broken tests * Feature/66 add different commands per server (#122) * Add ability for server exclusive commands * Add MankBot server-exclusive commands * Add lobby entity to database * Add documentation * Add setup command for lobby (#123) * Update bot to discord.js v13 (#125) * Update bot to discord.js v13 * Remove debug code * 110 commandshelp about command errors which causes command to not run (#126) * Change onMessage to onMessageCreate * Fix help command * Add override for bot owner and server owner (#135) * Change help command so exclusive commands can only be seen for the server they're assigned to (#136) * Change parsing to not crash if invalid (#142) * 137 role command cannot read properties of undefined (#141) * Fix issue with bot crashing * Fix server prefix not showing * Add easy way to configure role command * Move help text to its own directory * Make role config command to use role id * Get lobby command to use IDs instead of names (#144) Co-authored-by: Vylpes <getgravitysoftware@gmail.com>
2022-04-24 14:46:37 +01:00
});