Skip to content

Commit

Permalink
Add version command
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkView committed Feb 4, 2020
1 parent 8a453f7 commit 25d5a37
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions MRVN/src/plugins/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,23 @@ interface IUtilityPluginConfig {
can_ping: boolean;
can_level: boolean;
can_uptime: boolean;
can_version: boolean;

dm_response: string;
}

export class UtilityPlugin extends Plugin<IUtilityPluginConfig> {
public static pluginName = "utility";

public static VERSION = "1.0.1";

getDefaultOptions(): IPluginOptions<IUtilityPluginConfig> {
return {
config: {
can_ping: false,
can_level: false,
can_uptime: false,
can_version: false,

dm_response: "Sorry, but you can only control this bot through commands within the server!",
},
Expand All @@ -39,6 +43,7 @@ export class UtilityPlugin extends Plugin<IUtilityPluginConfig> {
config: {
can_ping: true,
can_uptime: true,
can_version: true,
},
},
],
Expand Down Expand Up @@ -112,6 +117,12 @@ export class UtilityPlugin extends Plugin<IUtilityPluginConfig> {
logger.info(`${msg.author.id}: ${msg.author.username}#${msg.author.discriminator} Requested bot uptime`);
}

@d.command("version")
@d.permission("can_version")
async versionRequest(msg: Message): Promise<void> {
msg.channel.createMessage(`Current bot version: **${UtilityPlugin.VERSION}**\nLatest release: <https://github.com/DarkView/JS-MRVNLFG/releases>`);
}

@d.event("messageCreate", "dm", true)
async dmReceived(msg: Message): Promise<any> {
logger.log(`${msg.author.id} said the following in DMs: ${msg.cleanContent}`);
Expand Down

0 comments on commit 25d5a37

Please sign in to comment.