Skip to content

Commit

Permalink
Resolve commandsDir path for relative path support
Browse files Browse the repository at this point in the history
Never tried using them for it before so I didn't realize they didn't work.
  • Loading branch information
zajrik committed Apr 17, 2017
1 parent 9ed8455 commit ba5812c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/client/Client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as Discord from 'discord.js';
import * as path from 'path';
import { Channel, ClientOptions, Collection, Emoji, Guild, GuildMember, Message, MessageReaction, Role, User, UserResolvable } from 'discord.js';
import { Command } from '../command/Command';
import { CommandDispatcher } from '../command/CommandDispatcher';
Expand Down Expand Up @@ -71,7 +72,7 @@ export class Client extends Discord.Client
* @name Client#commandsDir
* @type {string}
*/
this.commandsDir = options.commandsDir || null;
this.commandsDir = path.resolve(options.commandsDir) || null;

/**
* Status text for the client
Expand Down
3 changes: 1 addition & 2 deletions test/test_client.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Client, LogLevel, Logger } from '../bin/';
import * as path from 'path';
const config: any = require('./config.json');
const logger: Logger = Logger.instance();

const client: Client = new Client({
name: 'test',
token: config.token,
config: config,
commandsDir: path.join(__dirname, 'commands'),
commandsDir: './commands',
logLevel: LogLevel.DEBUG
}).start();

Expand Down

0 comments on commit ba5812c

Please sign in to comment.