Skip to content

Commit

Permalink
Addressed comments, fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpenguin committed Jul 7, 2022
1 parent d3b70bf commit 367e530
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
6 changes: 4 additions & 2 deletions src/codeyCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ export class CodeyCommand extends SapphireCommand {
commandOptions!: CodeyCommandOptions;

// Register application commands
public override registerApplicationCommands(registry: ChatInputCommand.Registry) {
registry.registerChatInputCommand((builder) => builder.setName(this.name).setDescription(this.description));
public override registerApplicationCommands(registry: ChatInputCommand.Registry): void {
registry.registerChatInputCommand(builder => builder
.setName(this.name)
.setDescription(this.description));
}

// Regular command
Expand Down
16 changes: 5 additions & 11 deletions src/commands/fun/flipCoin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// import { ApplyOptions } from '@sapphire/decorators';
// import { Command, CommandOptions, container } from '@sapphire/framework';
// import { Message } from 'discord.js';

import { Command, container } from '@sapphire/framework';
import { Message } from 'discord.js';

import { CodeyCommand, SapphireMessageExecuteType, SapphireMessageResponse } from '../../codeyCommand';

Expand All @@ -16,20 +11,19 @@ const commandOptions: Command.Options = {
\`${container.botPrefix}flip\`
\`${container.botPrefix}coin-flip\`
\`${container.botPrefix}coinflip\`
\`${container.botPrefix}flipcoin\``,
\`${container.botPrefix}flipcoin\``
};

const executeCommand: SapphireMessageExecuteType = (
client,
messageFromUser,
initialMessageFromBot
_client,
_messageFromUser,
_initialMessageFromBot
): SapphireMessageResponse => {
const onHeads = Math.random() < 0.5;
return `The coin landed on **${onHeads ? 'heads' : 'tails'}**!`;
}
};

export class FunFlipCoinCommand extends CodeyCommand {

messageWhenExecutingCommand = 'Flipping a coin...';
executeCommand: SapphireMessageExecuteType = executeCommand;

Expand Down

0 comments on commit 367e530

Please sign in to comment.