Skip to content

Commit

Permalink
chore: use .release-please-manifest version (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuimarudev authored Feb 11, 2024
1 parent b32883c commit 0045996
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 13 deletions.
8 changes: 6 additions & 2 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"experimental": {
"keepImportAssertions": true
},
"parser": {
"syntax": "typescript"
"syntax": "typescript",
"importAssertions": true
},
"target": "esnext"
},
"minify": true,
"sourceMaps": true
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"build": "./scripts/beforeBuild.sh && swc src --out-dir dist && ./scripts/afterBuild.sh",
"build": "swc src --out-dir dist",
"start": "pnpm run build && node --enable-source-maps dist",
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down
1 change: 0 additions & 1 deletion scripts/afterBuild.sh

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/beforeBuild.sh

This file was deleted.

1 change: 0 additions & 1 deletion src/common/version.ts

This file was deleted.

24 changes: 23 additions & 1 deletion src/handlers/ready.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { GatewayReadyDispatchData, WithIntrinsicProps } from "@discordjs/core";
import {
ActivityType,
GatewayReadyDispatchData,
PresenceUpdateStatus,
WithIntrinsicProps,
} from "@discordjs/core";
import manifest from "../../.github/release-please/.release-please-manifest.json" assert {
type: "json",
};
import { initCommands } from "../commands/init.js";
import { client } from "../index.js";

export default async ({
api,
Expand All @@ -8,5 +17,18 @@ export default async ({

console.log("ready!");

client.updatePresence(0, {
status: PresenceUpdateStatus.Online,
afk: false,
since: null,
activities: [
{
state: `v${manifest["."]}`,
name: "custom status",
type: ActivityType.Custom,
},
],
});

return true;
};
6 changes: 4 additions & 2 deletions src/synthesizer/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { version } from "../common/version.js";
import manifest from "../../.github/release-please/.release-please-manifest.json" assert {
type: "json",
};

const escapeMap: Record<string, string | undefined> = {
"<": "&lt;",
Expand Down Expand Up @@ -40,7 +42,7 @@ export default class Synthesizer {
</voice>\
</speak>`,
headers: {
"User-Agent": `OHNO/${version}`,
"User-Agent": `OHNO/${manifest["."]}`,
"Content-Type": "application/ssml+xml",
"Ocp-Apim-Subscription-Key": this.key,
"X-Microsoft-OutputFormat": "ogg-48khz-16bit-mono-opus",
Expand Down

0 comments on commit 0045996

Please sign in to comment.