Skip to content

Commit

Permalink
Remove Client#name, Client#version, version command
Browse files Browse the repository at this point in the history
Neither were used anywhere else within the framework. For name the clientuser username can be used, and for version and the version command, it's not hard to write a custom command that grabs the version from package.json.

Also updated the gulpfile a bit
  • Loading branch information
zajrik committed Jul 6, 2017
1 parent 28135f1 commit 8dbe49e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 44 deletions.
8 changes: 4 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ const project = gulp_ts.createProject('tsconfig.json');
const linter = tslint.Linter.createProgram('tsconfig.json');

gulp.task('default', ['build']);
gulp.task('build:vscode', ['lint', 'build']);
gulp.task('build:vscode', cb => runSequence('lint', 'build', cb));
gulp.task('build:docs', () => execSync('npm run docs:indev'));
gulp.task('docs', (cb) => runSequence('build', 'build:docs', cb));
gulp.task('docs', cb => runSequence('build', 'build:docs', cb));

gulp.task('pause', (cb) => setTimeout(() => cb(), 1e3));
gulp.task('tests', (cb) => runSequence('lint', 'build', 'pause', 'build:tests', cb));
gulp.task('pause', cb => setTimeout(() => cb(), 1e3));
gulp.task('tests', cb => runSequence('lint', 'build', 'pause', 'build:tests', cb));

gulp.task('lint', () => {
gulp.src('./src/**/*.ts')
Expand Down
14 changes: 0 additions & 14 deletions src/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const { on, once, registerListeners } = ListenerUtil;
export class Client extends Discord.Client
{
@logger private readonly _logger: Logger;
public readonly name: string;
public readonly commandsDir: string;
public readonly localeDir: string;
public readonly owner: string[];
Expand All @@ -59,7 +58,6 @@ export class Client extends Discord.Client
public readonly selfbot: boolean;
public readonly passive: boolean;
public readonly pause: boolean;
public readonly version: string;
public readonly disableBase: BaseCommandName[];
public readonly provider: StorageProviderConstructor;
public readonly _middleware: MiddlewareFunction[];
Expand All @@ -83,12 +81,6 @@ export class Client extends Discord.Client

this._token = options.token;

/**
* The name of the bot this Client is for
* @type {string}
*/
this.name = options.name || 'botname';

/**
* The owner/owners of the bot, represented as an array of IDs.
* These IDs determine who is allowed to use commands flagged as
Expand Down Expand Up @@ -171,12 +163,6 @@ export class Client extends Discord.Client
*/
this.pause = options.pause || false;

/**
* Client version, best taken from package.json
* @type {string}
*/
this.version = options.version || '0.0.0';

/**
* Array of base command names to skip when loading commands. Base commands
* may only be disabled by name, not by alias
Expand Down
22 changes: 0 additions & 22 deletions src/command/base/Version.ts

This file was deleted.

4 changes: 1 addition & 3 deletions src/types/BaseCommandName.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated automatically at Sat Jul 01 2017 21:13:23 GMT-0500 (CDT)
// Generated automatically at Thu Jul 06 2017 09:05:41 GMT-0500 (CDT)

/**
* @typedef {string} BaseCommandName String representing a name of a base command. Valid names are:
Expand All @@ -16,7 +16,6 @@
* 'reload',
* 'setlang',
* 'setprefix',
* 'version',
* 'whitelist'
* ```
*/
Expand All @@ -34,5 +33,4 @@ export type BaseCommandName = 'blacklist'
| 'reload'
| 'setlang'
| 'setprefix'
| 'version'
| 'whitelist';
2 changes: 1 addition & 1 deletion src/util/static/baseCommandNames.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["blacklist","clearlimit","disablegroup","enablegroup","eval","eval:ts","help","limit","listgroups","ping","reload","setlang","setprefix","version","whitelist"]
["blacklist","clearlimit","disablegroup","enablegroup","eval","eval:ts","help","limit","listgroups","ping","reload","setlang","setprefix","whitelist"]

0 comments on commit 8dbe49e

Please sign in to comment.