Skip to content

Commit

Permalink
update deps and add build check
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSegal855 committed Nov 12, 2023
1 parent c8835de commit 7c809e0
Show file tree
Hide file tree
Showing 8 changed files with 1,078 additions and 1,030 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/buildCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build and Lint Check

on:
pull_request:
workflow_dispatch:

jobs:
build-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: yarn
- name: Build
run: yarn build
- name: Lint
run: yarn lint
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@lib": "dist/lib"
},
"devDependencies": {
"@sapphire/ts-config": "4.0.1",
"@sapphire/ts-config": "^5.0.0",
"@types/common-tags": "1.8.1",
"@types/node": "17.0.45",
"@types/node-cron": "3.0.8",
Expand Down
8 changes: 6 additions & 2 deletions src/interaction-handlers/rollImport/buttons.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApplyOptions } from '@sapphire/decorators';
import { InteractionHandler, type InteractionHandlerOptions, InteractionHandlerTypes } from '@sapphire/framework';
import { ActionRowBuilder, ButtonBuilder, ButtonInteraction } from 'discord.js';
import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ComponentType } from 'discord.js';

@ApplyOptions<InteractionHandlerOptions>({
interactionHandlerType: InteractionHandlerTypes.Button
Expand Down Expand Up @@ -36,7 +36,11 @@ export class rollImport extends InteractionHandler {
newButtons.push(
new ActionRowBuilder<ButtonBuilder>()
.addComponents(row.components.map(button =>
new ButtonBuilder({ ...button.data, disabled: button.disabled || importAll || button.customId?.includes(type) })
new ButtonBuilder({
...button.data,
type: ComponentType.Button,
disabled: button.disabled || importAll || button.customId?.includes(type)
})
))
);
});
Expand Down
4 changes: 2 additions & 2 deletions src/lib/extensions/SteveBoi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { container, Events, SapphireClient } from '@sapphire/framework';
import { ActionRowBuilder, ButtonBuilder, type ClientOptions, EmbedBuilder, TextChannel } from 'discord.js';
import { ActionRowBuilder, ButtonBuilder, type ClientOptions, EmbedBuilder, TextChannel, ComponentType } from 'discord.js';
import { schedule, type ScheduledTask } from 'node-cron';
import type { CmdStats, DbGuild } from '@lib/types/database';
import { generateSnoozeButtons, getChannel, pickRandom } from '@lib/utils';
Expand Down Expand Up @@ -102,7 +102,7 @@ export class SteveBoi extends SapphireClient {
newButtons.push(
new ActionRowBuilder<ButtonBuilder>()
.addComponents(row.components.map(button =>
new ButtonBuilder({ ...button.data, disabled: true })
new ButtonBuilder({ ...button.data, disabled: true, type: ComponentType.Button })
))
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/lib/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { srcDir } from '@lib/constants';
import { container } from '@sapphire/framework';

// Read env var
config({ path: join(srcDir, '.env') });
config({ env: join(srcDir, '.env') });

// Set default inspection depth
inspect.defaultOptions.depth = 1;
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"extends": "@sapphire/ts-config",
"extends": ["@sapphire/ts-config", "@sapphire/ts-config/decorators"],
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/.tsbuildinfo",
"paths": {
"@root/*": ["./*"],
"@lib/*": ["./src/lib/*"]
Expand Down
1 change: 1 addition & 0 deletions tsconfig.tsbuildinfo

Large diffs are not rendered by default.

Loading

0 comments on commit 7c809e0

Please sign in to comment.