-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from thenorthsolution:flags
Message Command Flags
- Loading branch information
Showing
22 changed files
with
817 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// @ts-check | ||
import { MessageCommandBuilder } from "reciple"; | ||
import { createMessageCommandUsage } from '@reciple/message-command-utils'; | ||
|
||
export class Message { | ||
commands = [ | ||
new MessageCommandBuilder() | ||
.setName('flag') | ||
.setDescription('Sends a message') | ||
.addFlag(flag => flag | ||
.setName('flag') | ||
.setDescription('A flag') | ||
.setValueType('string') | ||
.setRequired(true) | ||
.setMandatory(true) | ||
) | ||
.setExecute(async ({ message, flags }) => { | ||
await message.reply(flags.getFlagValues('flag', { required: true, type: 'string' })[0]); | ||
}) | ||
]; | ||
|
||
onStart() { | ||
logger.log(this.commands[0]) | ||
logger.log(createMessageCommandUsage(this.commands[0])) | ||
return true; | ||
} | ||
} | ||
|
||
export default new Message() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
// @ts-check | ||
|
||
import { SlashCommandBuilder } from 'reciple'; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
// @ts-check | ||
|
||
/** | ||
* @satisfies {import("reciple").CommandPreconditionData} | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
"node_modules/**" | ||
], | ||
"watch": [ | ||
"src", | ||
"modules", | ||
"reciple.mjs", | ||
".env" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.