Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/COMMAND-WIKI.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,28 @@
- ``description``: The description of the customization to be set for the user.
- **Subcommands:** None

# REMINDER
## announcement
- **Aliases:** None
- **Description:** Set up an announcement!
- **Examples:**<br> `/announcement` - Opens an setup form
- **Options:** None
- **Subcommands:** `create`, `name`, `description`, `executeCommand`, `isCommandResponseEphemeral`, `options`, `name`, `description`, `type`, `required`

## reminder
- **Aliases:** None
- **Description:** Set up a reminder for anything you want!
- **Examples:**<br> `/reminder` - Opens an interactive reminder setup form
- **Options:** None
- **Subcommands:** `create`, `name`, `description`, `executeCommand`, `isCommandResponseEphemeral`, `options`, `name`, `description`, `type`, `required`

## timer
- **Aliases:** None
- **Description:** Set up a timer for anything you want!
- **Examples:**<br> `/timer value minutes:5`<br> `/timer value hours:2 minutes:30`<br> `/timer value minutes:10 message:Take a break!`
- **Options:** None
- **Subcommands:** `create`, `name`, `description`, `executeCommand`, `isCommandResponseEphemeral`, `options`, `name`, `description`, `required`, `type`

# SUGGESTION
## suggestion
- **Aliases:** ``suggest``
Expand Down
2 changes: 0 additions & 2 deletions src/codeyCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ export class CodeyCommand extends SapphireCommand {
interaction: SapphireCommand.ChatInputCommandInteraction,
): Promise<APIMessage | Message<boolean> | undefined> {
const { client } = container;

// Get subcommand name
let subcommandName = '';
try {
Expand Down Expand Up @@ -373,7 +372,6 @@ export class CodeyCommand extends SapphireCommand {
) {
successResponse.response = { content: successResponse.response };
}

// cannot double reply to a slash command (in case command replies on its own), runtime error
if (!interaction.replied) {
await interaction.reply(
Expand Down
14 changes: 11 additions & 3 deletions src/commandDetails/fun/rollDice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
SapphireMessageExecuteType,
SapphireMessageResponse,
} from '../../codeyCommand';
import { getRandomIntFrom1 } from '../../utils/num';
// import { getRandomIntFrom1 } from '../../utils/num';

const rollDiceExecuteCommand: SapphireMessageExecuteType = (
_client,
Expand All @@ -22,8 +22,16 @@ const rollDiceExecuteCommand: SapphireMessageExecuteType = (
if (sides > SIDES_UPPER_BOUND) {
return new Promise((resolve, _reject) => resolve("that's too many sides!"));
}
const diceFace = getRandomIntFrom1(sides);
return new Promise((resolve, _reject) => resolve(`you rolled a ${diceFace}!`));
// const diceFace = getRandomIntFrom1(sides);
let userId: string;
if ('author' in _messageFromUser) {
userId = _messageFromUser.author.id;
} else if ('user' in _messageFromUser) {
userId = _messageFromUser.user.id;
} else {
userId = 'unknown';
}
return new Promise((resolve, _reject) => resolve(`your id is ${userId}!`));
};

export const rollDiceCommandDetails: CodeyCommandDetails = {
Expand Down
Loading