Skip to content

Commit

Permalink
Version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Smaug6739 committed Nov 21, 2021
1 parent fb82210 commit a8655b0
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 21 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
![sheweny](https://cdn.discordapp.com/attachments/881988260925153322/882027519753224244/sheweny_baniere.png)

[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/Sheweny/cli)
[![made-with-Markdown](https://img.shields.io/badge/Made%20with-Markdown-1f425f.svg)](http://commonmark.org)
[![made-with-Markdown](https://img.shields.io/badge/Made%20with-Typescript-1f425f.svg)](http://commonmark.org)
[![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/Sheweny/master/LICENSE)
[![GitHub tag](https://img.shields.io/github/tag/Sheweny/cli.svg)](https://github.com/Sheweny/cli/tags/)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

This module is a CLI (Command Line Interface) for create discord bots with Sheweny framework.

[GUIDE](https://sheweny.js.org/guide/cli/Usage.html)

## Getting started

Prerequisites

Node.js 14.0.0 or newer is required.
Node.js 16.6.0 or newer is required.

### Instalation

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sheweny/cli",
"description": "Cli for sheweny framework",
"version": "1.1.4",
"version": "2.0.0",
"main": "lib/cli.js",
"bin": {
"sheweny": "bin/sheweny",
Expand Down
8 changes: 3 additions & 5 deletions src/templates/V2/add/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ import type { ${importDjs} } from "discord.js";`
${options.config!.template === "javascript" ? "module.exports =" : "export"} class ${options.addName}Command extends Command {
constructor(client${options.config!.template === "typescript" ? ": ShewenyClient" : ""}) {
super(
client,
{
name: ${options.addName.toLowerCase()},
super(client, {
name: "${options.addName.toLowerCase()}",
description: "${options.commandOptions.description}",
type: "${options.commandOptions.type}",
${options.commandOptions.category ? `category: "${options.commandOptions.category}",` : ""}
${options.commandOptions.cooldown ? `cooldown: "${options.commandOptions.cooldown}",` : ""}
${options.commandOptions.cooldown ? `cooldown: ${options.commandOptions.cooldown},` : ""}
${options.commandOptions.only ? `channel: "${options.commandOptions.only}",` : ""}
}
);
Expand Down
12 changes: 5 additions & 7 deletions src/templates/V3/add/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ import type { ${importDjs} } from "discord.js";`
${options.config!.template === "javascript" ? "module.exports =" : "export"} class ${options.addName}Command extends Command {
constructor(client${options.config!.template === "typescript" ? ": ShewenyClient" : ""}) {
super(
client,
{
name: ${options.addName.toLowerCase()},
description: ${options.commandOptions.description},
type: ${options.commandOptions.type},
super(client, {
name: "${options.addName.toLowerCase()}",
description: "${options.commandOptions.description}",
type: "${options.commandOptions.type}",
${options.commandOptions.category ? `category: "${options.commandOptions.category}",` : ""}
${options.commandOptions.cooldown ? `cooldown: "${options.commandOptions.cooldown}",` : ""}
${options.commandOptions.cooldown ? `cooldown: ${options.commandOptions.cooldown},` : ""}
${options.commandOptions.only ? `channel: "${options.commandOptions.only}",` : ""}
}
);
Expand Down
2 changes: 1 addition & 1 deletion src/templates/V3/add/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { ShewenyClient } from "sheweny";`
${options.config!.template === "javascript" ? "module.exports =" : "export"} class ${options.addName}Event extends Event {
constructor(client${options.config!.template === "typescript" ? ": ShewenyClient" : ""}) {
super(client, "${options.addName}", {
description: ${options.eventOptions.description},
description: "${options.eventOptions.description}",
once: ${options.eventOptions.once},
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/templates/V3/add/inhibitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ ${options.config!.template === "javascript" ? "module.exports =" : "export"} cla
});
}
execute(interaction${options.config!.template === "typescript" ? `: CommandInteraction` : ""}) {
execute(client: ShewenyClient, interaction${options.config!.template === "typescript" ? `: CommandInteraction` : ""}) {
return !["877090306103840778"].includes(interaction.guildId!);
}
async onFailure(interaction${options.config!.template === "typescript" ? `: CommandInteraction` : ""}) {
async onFailure(client: ShewenyClient, interaction${options.config!.template === "typescript" ? `: CommandInteraction` : ""}) {
await interaction.reply("Your guild is blacklisted.");
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/templates/V3/create/javascript/src/events/ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = class ReadyEvent extends Event {
super(client, "ready", {
description: "Client is logged in",
once: true,
emitter: this.client,
emitter: client,
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/templates/V3/create/typescript/src/events/ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class ReadyEvent extends Event {
super(client, "ready", {
description: "Client is logged in",
once: true,
emitter: this.client,
emitter: client,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class BlackListInhibitor extends Inhibitor {
});
}
execute(interaction: CommandInteraction) {
execute(client: ShewenyClient, interaction: CommandInteraction) {
// Put a guild id
return !["<guildId>"].includes(interaction.guildId!);
}
Expand Down

0 comments on commit a8655b0

Please sign in to comment.