Skip to content

Commit

Permalink
(fix): some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
LoboMetalurgico committed Jan 19, 2023
1 parent c8fbd46 commit fda59dc
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arunabase",
"version": "1.0.0-ALPHA.2",
"version": "1.0.0-ALPHA.3",
"description": "An API made to help developers what works with discord and twitch.",
"main": "build/index.js",
"types": "src/main/index.ts",
Expand Down
14 changes: 12 additions & 2 deletions src/main/discord/Client.ts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ClientOptions, Client as DJSClient } from 'discord.js';
import { IDiscordConfiguration } from '../interfaces';
import { Client as DJSClient } from 'discord.js';
import { CommandManager } from './managers';
import { Utils } from '@twitchapis/twitch.js';

Expand All @@ -12,7 +12,7 @@ export class DiscordClient extends DJSClient {
private logger: Utils.Logger;

constructor(options: IDiscordConfiguration) {
super(options);
super(options as ClientOptions);

this.prefix = options.prefix ?? '!';
this.allowSlashCommands = options.allowSlashCommands ?? true;
Expand Down Expand Up @@ -48,6 +48,16 @@ export class DiscordClient extends DJSClient {
public getLogger(): Utils.Logger {
return this.logger;
}

public login(token?: string): Promise<string> {
if (token) {
return super.login(token);
} else if (this.configuration.token) {
return super.login(this.configuration.token);
} else {
throw new Error('No token provided.');
}
}
}

export { IntentsBitField as Intents } from 'discord.js';
Expand Down
4 changes: 2 additions & 2 deletions src/main/discord/structures/CommandStructure.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class CommandStructureBase {
constructor(name: string, options: ICommandOptions) {
this.name = name;
this.description = options.description;
this.isSlashCommand = options.isSlashCommand;
this.isLegacyCommand = options.isLegacyCommand;
this.isSlashCommand = options.isSlashCommand ?? true;
this.isLegacyCommand = options.isLegacyCommand ?? true;
this.allowDM = options.allowDM ?? true;
this.aliases = options.aliases ?? [];
this.type = options.type ?? ApplicationCommandType.ChatInput; // Slash Commands only
Expand Down
1 change: 1 addition & 0 deletions src/main/interfaces/IDiscordConfiguration.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface IDiscordConfiguration extends ClientOptions {
botID?: string,
token?: string,
prefix?: string,
shardId?: number,
allowSlashCommands?: boolean,
allowLegacyCommands?: boolean,
}
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"removeComments": false,
"declaration": true,
"declarationMap": true,
"traceResolution": true,
"moduleResolution": "node",
"skipLibCheck": true,
"target": "ES6",
Expand Down

0 comments on commit fda59dc

Please sign in to comment.