Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(interface): fix !tts command not register #4494

Merged
merged 3 commits into from Jan 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bot/_interface.ts
Expand Up @@ -12,7 +12,7 @@ import { Settings } from './database/entity/settings';
import { commandsToRegister, loadingInProgress, permissions as permissionsList } from './decorators';
import { getFunctionList } from './decorators/on';
import { invalidateParserCache, refreshCachedCommandPermissions } from './helpers/cache';
import { isDbConnected } from './helpers/database';
import { isBotStarted } from './helpers/database';
import { flatten, unflatten } from './helpers/flatten';
import { error, info, warning } from './helpers/log';
import { addMenu, addMenuPublic, addWidget, ioServer, menu, menuPublic } from './helpers/panel';
Expand Down Expand Up @@ -131,7 +131,7 @@ class Module {
this._sockets();

const load = () => {
if (isDbConnected) {
if (isBotStarted) {
setTimeout(async () => {
const state = this._name === 'core' ? true : await this.loadVariableValue('enabled');
const onStartup = async () => {
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions test/helpers/db.js
Expand Up @@ -31,6 +31,8 @@ const { HeistUser } = require('../../dest/database/entity/heist')

const translation = (require('../../dest/translate')).default;

let initialCleanup = true;

module.exports = {
cleanup: async function () {
const waitForIt = async (resolve, reject) => {
Expand All @@ -39,6 +41,10 @@ module.exports = {
return setTimeout(() => waitForIt(resolve, reject), 1000);
} else {
debug('test', `Bot is started`);
if (initialCleanup) {
await waitMs(5000);
initialCleanup = false;
}
}

const oauth = (require('../../dest/oauth')).default;
Expand Down
2 changes: 1 addition & 1 deletion test/tests/message/list.js
Expand Up @@ -99,7 +99,7 @@ describe('Message - list filter', () => {
describe('(list.core.<permissionName>) should return proper message', () => {
it('(list.core.CASTERS) should return core commands', async () => {
const r = await new Message('(list.core.CASTERS)').parse({});
assert.strictEqual(r, '_debug, alert, alias, alias add, alias edit, alias group, alias list, alias remove, alias toggle, alias toggle-visibility, bansong, command, command add, command edit, command list, command remove, command toggle, command toggle-visibility, commercial, cooldown, cooldown toggle enabled, cooldown toggle followers, cooldown toggle moderators, cooldown toggle owners, cooldown toggle subscribers, disable, enable, game set, highlight, highlight list, hltb, ignore add, ignore check, ignore remove, keyword, keyword add, keyword edit, keyword list, keyword remove, keyword toggle, level change, makeitrain, permission exclude-add, permission exclude-rm, permission list, permit, playlist, playlist add, playlist import, playlist list, playlist remove, playlist set, playlist steal, points add, points all, points get, points online, points remove, points set, points undo, price, price list, price set, price toggle, price unset, queue clear, queue close, queue list, queue open, queue pick, queue random, quote add, quote remove, quote set, raffle open, raffle pick, raffle remove, rank add, rank add-flw, rank add-sub, rank edit, rank edit-flw, rank edit-sub, rank help, rank list, rank list-flw, rank list-sub, rank rm, rank rm-flw, rank rm-sub, rank set, rank unset, scrim stop, set, skipsong, snipe, timers, timers add, timers list, timers rm, timers set, timers toggle, timers unset, title set, top bits, top followage, top gifts, top messages, top points, top subage, top submonths, top time, top tips, unbansong');
assert.strictEqual(r, '_debug, alert, alias, alias add, alias edit, alias group, alias list, alias remove, alias toggle, alias toggle-visibility, bansong, command, command add, command edit, command list, command remove, command toggle, command toggle-visibility, commercial, cooldown, cooldown toggle enabled, cooldown toggle followers, cooldown toggle moderators, cooldown toggle owners, cooldown toggle subscribers, disable, enable, game set, highlight, highlight list, hltb, ignore add, ignore check, ignore remove, keyword, keyword add, keyword edit, keyword list, keyword remove, keyword toggle, level change, makeitrain, permission exclude-add, permission exclude-rm, permission list, permit, playlist, playlist add, playlist import, playlist list, playlist remove, playlist set, playlist steal, points add, points all, points get, points online, points remove, points set, points undo, price, price list, price set, price toggle, price unset, queue clear, queue close, queue list, queue open, queue pick, queue random, quote add, quote remove, quote set, raffle open, raffle pick, raffle remove, rank add, rank add-flw, rank add-sub, rank edit, rank edit-flw, rank edit-sub, rank help, rank list, rank list-flw, rank list-sub, rank rm, rank rm-flw, rank rm-sub, rank set, rank unset, scrim stop, set, skipsong, snipe, timers, timers add, timers list, timers rm, timers set, timers toggle, timers unset, title set, top bits, top followage, top gifts, top messages, top points, top subage, top submonths, top time, top tips, tts, unbansong');
});

it('(list.core.VIEWERS) should return core commands', async () => {
Expand Down