Skip to content

Commit

Permalink
chore: format and goji command
Browse files Browse the repository at this point in the history
  • Loading branch information
louiszn committed Oct 20, 2024
1 parent b965393 commit 0f1c2af
Show file tree
Hide file tree
Showing 25 changed files with 546 additions and 199 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
on:
push:
branches: [ "main" ]
push:
branches: ["main"]

jobs:
build:
runs-on: self-hosted
build:
runs-on: self-hosted

steps:
- uses: actions/[email protected]
- run: bun install
- run: |
touch .env
echo "${{ secrets.ENV }}" >> .env
- name: Stop all proccess
run: pm2 delete all || true
- name: Start a new process
run: pm2 start "bun src/index.ts"

steps:
- uses: actions/[email protected]
- run: bun install
- run: |
touch .env
echo "${{ secrets.ENV }}" >> .env
- name: Stop all proccess
run: pm2 delete all || true
- name: Start a new process
run: pm2 start "bun src/index.ts"
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"printWidth": 100,
"printWidth": 80,
"tabWidth": 4
}
Binary file modified bun.lockb
Binary file not shown.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"name": "zentbot",
"type": "module",
"scripts": {
"start": "bun run src/index.ts"
"start": "bun run src/index.ts",
"format": "prettier . -w"
},
"devDependencies": {
"@types/bun": "latest",
"@types/humanize-duration": "^3.27.4"
"@types/humanize-duration": "^3.27.4",
"prettier": "^3.3.3"
},
"peerDependencies": {
"typescript": "^5.0.0"
Expand Down
19 changes: 14 additions & 5 deletions src/commands/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import type {
Client,
RESTPostAPIApplicationCommandsJSONBody as CommandData,
UserContextMenuCommandInteraction,
AutocompleteInteraction
AutocompleteInteraction,
PermissionResolvable,
} from "discord.js";
import type { Subcommand } from "../types/subcommand";

namespace Command {
export type ChatInput = ChatInputCommandInteraction<"cached">;
export type UserContextMenu = UserContextMenuCommandInteraction<"cached">;
export type MessageContentMenu = MessageContextMenuCommandInteraction<"cached">;
export type MessageContentMenu =
MessageContextMenuCommandInteraction<"cached">;
export type Autocomplete = AutocompleteInteraction<"cached">;
}

Expand All @@ -22,6 +24,7 @@ abstract class Command {
public subcommands: { [x: string]: Subcommand[] };
public client!: Client;
public cooldown = 5000;
public permissions?: PermissionResolvable;

public constructor(name: string) {
this.name = name;
Expand All @@ -31,9 +34,15 @@ abstract class Command {

public init?(): Awaitable<void>;
public executeChatInput?(interaction: Command.ChatInput): Awaitable<void>;
public executeUserContextMenu?(interaction: Command.UserContextMenu): Awaitable<void>;
public executeMessageContextMenu?(interaction: Command.MessageContentMenu): Awaitable<void>;
public executeAutocomplete?(interaction: Command.Autocomplete): Awaitable<void>;
public executeUserContextMenu?(
interaction: Command.UserContextMenu,
): Awaitable<void>;
public executeMessageContextMenu?(
interaction: Command.MessageContentMenu,
): Awaitable<void>;
public executeAutocomplete?(
interaction: Command.Autocomplete,
): Awaitable<void>;
}

export default Command;
Loading

0 comments on commit 0f1c2af

Please sign in to comment.