Use as instead of specifying the generic (#4111)

This commit is contained in:
Fleny
2025-01-31 17:58:58 +01:00
committed by GitHub
parent ebbb5f5541
commit 0059056d77

View File

@@ -194,9 +194,9 @@ const desiredProperties = createDesiredPropertiesObject({
interface BotDesiredProperties extends Required<typeof desiredProperties> {}
const bot = createBot<BotDesiredProperties>({
const bot = createBot({
// Your usual createBot options, such as token and intents
desiredProperties,
desiredProperties: desiredProperties as BotDesiredProperties,
});
```
@@ -206,4 +206,4 @@ Now, when you hover over `bot.helpers.getUser()`, you'll see:
(property) getUser: (id: BigString) => Promise<SetupDesiredProps<User, BotDesiredProperties, DesiredPropertiesBehavior.RemoveKey>>
```
This makes it more readable and easier to work with.
This makes it more readable and easier to work with.