diff --git a/.changeset/tricky-gifts-poke.md b/.changeset/tricky-gifts-poke.md new file mode 100644 index 00000000..7aebe67d --- /dev/null +++ b/.changeset/tricky-gifts-poke.md @@ -0,0 +1,6 @@ +--- +"@buape/carbon": patch +"create-carbon": patch +--- + +fix: move base url option back diff --git a/packages/carbon/src/classes/Client.ts b/packages/carbon/src/classes/Client.ts index af09432e..3fd67f14 100644 --- a/packages/carbon/src/classes/Client.ts +++ b/packages/carbon/src/classes/Client.ts @@ -26,6 +26,10 @@ import { concatUint8Arrays, subtleCrypto, valueToUint8Array } from "../utils.js" * The options used for initializing the client */ export interface ClientOptions { + /** + * The base URL of the app + */ + baseUrl: string /** * The client ID of the app */ diff --git a/packages/carbon/src/plugins/linked-roles/LinkedRoles.ts b/packages/carbon/src/plugins/linked-roles/LinkedRoles.ts index d89885e6..32d14aac 100644 --- a/packages/carbon/src/plugins/linked-roles/LinkedRoles.ts +++ b/packages/carbon/src/plugins/linked-roles/LinkedRoles.ts @@ -15,10 +15,6 @@ type Tokens = { declare module "../../classes/Client.d.ts" { interface ClientOptions { - /** - * The base URL of the app - */ - baseUrl: string /** * The client secret of the app, used for OAuth */ diff --git a/packages/create-carbon/template/.env.hbs b/packages/create-carbon/template/.env.hbs index 3e8f322f..f7dd6b0a 100644 --- a/packages/create-carbon/template/.env.hbs +++ b/packages/create-carbon/template/.env.hbs @@ -8,9 +8,8 @@ path: .env {{/if}} --- - -{{#if plugins.linkedRoles}} BASE_URL= +{{#if plugins.linkedRoles}} {{/if}} DEPLOY_SECRET= DISCORD_CLIENT_ID= @@ -18,4 +17,4 @@ DISCORD_CLIENT_ID= DISCORD_CLIENT_SECRET= {{/if}} DISCORD_PUBLIC_KEY= -DISCORD_BOT_TOKEN= \ No newline at end of file +DISCORD_BOT_TOKEN= diff --git a/website/content/classes/client.mdx b/website/content/classes/client.mdx index 66ba8ca7..c38b30ad 100644 --- a/website/content/classes/client.mdx +++ b/website/content/classes/client.mdx @@ -13,6 +13,7 @@ A client must be created within your [`createHandle`](/api/index/functions/creat ```ts title="src/index.ts" const handle = createHandle((env) => { const client = new Client({ + baseUrl: String(env.BASE_URL), deploySecret: String(env.DEPLOY_SECRET), clientId: String(env.CLIENT_ID), publicKey: String(env.PUBLIC_KEY), @@ -24,6 +25,7 @@ const handle = createHandle((env) => { Here we have created a client with the following options: +- `baseUrl`: The relative base URL of your app - `deploySecret`: The deploy secret of your bot, used as a password for deploying commands and other sensitive matters - `clientId`: The Discord client ID of your bot - `publicKey`: The Discord public key of your bot diff --git a/website/content/getting-started/basic-setup.mdx b/website/content/getting-started/basic-setup.mdx index 1b6057c2..606ed709 100644 --- a/website/content/getting-started/basic-setup.mdx +++ b/website/content/getting-started/basic-setup.mdx @@ -46,6 +46,7 @@ import { createHandle, Client } from "@buape/carbon"; const handle = createHandle((env) => { const client = new Client( { + baseUrl: String(env.BASE_URL), deploySecret: String(env.DEPLOY_SECRET), clientId: String(env.DISCORD_CLIENT_ID), publicKey: String(env.DISCORD_PUBLIC_KEY),