1
0
Fork 0

Fix certain typings stuff

refactor/models
Bsian 2020-03-29 00:55:40 +00:00
parent 9433ad997f
commit fbd5c478cc
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
7 changed files with 5 additions and 37 deletions

View File

@ -16,7 +16,7 @@
"axios": "^0.19.0", "axios": "^0.19.0",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"eris": "^0.11.2", "eris": "^0.11.2",
"eris-pagination": "bsian03/eris-pagination", "eris-pagination": "bsian03/eris-pagination#dev",
"express": "^4.17.1", "express": "^4.17.1",
"fs-extra": "^8.1.0", "fs-extra": "^8.1.0",
"helmet": "^3.21.2", "helmet": "^3.21.2",

View File

@ -48,7 +48,7 @@ export default class CWG_Data extends Command {
}); });
this.client.signale.log(embeds); this.client.signale.log(embeds);
if (embeds.length === 1) return message.channel.createMessage({ embed: embeds[0] }); if (embeds.length === 1) return message.channel.createMessage({ embed: embeds[0] });
return createPaginationEmbed(message, this.client, embeds, {}); return createPaginationEmbed(message, embeds);
} catch (error) { } catch (error) {
return this.client.util.handleError(error, message, this); return this.client.util.handleError(error, message, this);
} }

View File

@ -41,7 +41,7 @@ export default class Help extends Command {
return cmdPages.push(embed); return cmdPages.push(embed);
}); });
if (cmdPages.length === 1) return message.channel.createMessage({ embed: cmdPages[0] }); if (cmdPages.length === 1) return message.channel.createMessage({ embed: cmdPages[0] });
return createPaginationEmbed(message, this.client, cmdPages); return createPaginationEmbed(message, cmdPages);
} }
const resolved = await this.client.util.resolveCommand(args, message); const resolved = await this.client.util.resolveCommand(args, message);
if (!resolved) return message.channel.createMessage(`${this.client.stores.emojis.error} **Command not found!**`); if (!resolved) return message.channel.createMessage(`${this.client.stores.emojis.error} **Command not found!**`);

View File

@ -55,7 +55,7 @@ export default class Modlogs extends Command {
if (embeds.length === 1) { if (embeds.length === 1) {
msg.edit({ content: '', embed: embeds[0] }); msg.edit({ content: '', embed: embeds[0] });
} else { } else {
createPaginationEmbed(message, this.client, embeds, {}, msg); createPaginationEmbed(message, embeds, {});
} }
return msg; return msg;
} catch (error) { } catch (error) {

View File

@ -15,7 +15,6 @@ export default class SecureSign_Init extends Command {
public async run(message: Message, args: string[]) { public async run(message: Message, args: string[]) {
try { try {
return;
const account = await this.client.db.Account.findOne({ userID: message.author.id }); const account = await this.client.db.Account.findOne({ userID: message.author.id });
if (!account) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Account not found***`); if (!account) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Account not found***`);
if (!account.hash) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Account not initialized***`); if (!account.hash) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Account not initialized***`);

View File

@ -2,7 +2,7 @@
"compilerOptions": { "compilerOptions": {
/* Basic Options */ /* Basic Options */
// "incremental": true, /* Enable incremental compilation */ // "incremental": true, /* Enable incremental compilation */
"target": "ES2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */ // "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */ // "allowJs": true, /* Allow javascript files to be compiled. */

31
types/global.d.ts vendored
View File

@ -1,31 +0,0 @@
interface PromiseFulfilledResult<T> {
status: 'fulfilled';
value: T;
}
interface PromiseRejectedResult {
status: 'rejected';
reason: any;
}
type PromiseSettledResult<T> = PromiseFulfilledResult<T> | PromiseRejectedResult;
interface PromiseConstructor {
/**
* Creates a Promise that is resolved with an array of results when all
* of the provided Promises resolve or reject.
* @param values An array of Promises.
* @returns A new Promise.
*/
allSettled<T extends readonly unknown[] | readonly [unknown]>(values: T):
Promise<{ -readonly [P in keyof T]: PromiseSettledResult<T[P] extends PromiseLike<infer U> ? U : T[P]> }>;
/**
* Creates a Promise that is resolved with an array of results when all
* of the provided Promises resolve or reject.
* @param values An array of Promises.
* @returns A new Promise.
*/
allSettled<T>(values: Iterable<T>): Promise<PromiseSettledResult<T extends PromiseLike<infer U> ? U : T>[]>;
}