docs: Include notice of strictNullChecks being required (#4267)

And also update deno example to use v21
This commit is contained in:
Fleny
2025-07-28 08:21:51 +02:00
committed by GitHub
parent 0ab543d02e
commit ca9f4fec10
3 changed files with 9 additions and 3 deletions
+4 -2
View File
@@ -25,8 +25,10 @@ While a single topic might not seem memory-intensive, this property can quickly
By choosing to store only the properties relevant to your bots functionality — like omitting `channel.topic` when its unnecessary — you can save gigabytes of memory.
Desired Properties is thus an essential tool for bots needing scalable and efficient caching, allowing for minimal resource usage without sacrificing performance.
:::tip
Check the [TypeScript](#typescript) section if you are using typescript
:::info[Typescript]
When using Typescript you do need to enable `strictNullChecks` in your TSConfig, or else you may get type errors despire configuring stuff properly.
Check the [TypeScript](#typescript) section for more useful information.
:::
## Configuring
+1 -1
View File
@@ -20,7 +20,7 @@ This is how you can use it to create a bot that logs into discord:
```ts
import { load } from 'https://deno.land/std@0.212.0/dotenv/mod.ts'
import { createBot } from 'npm:@discordeno/bot@19.0.0'
import { createBot } from 'npm:@discordeno/bot@21.0.0'
const env = await load()
+4
View File
@@ -21,6 +21,10 @@ If you need more specific packages, you can install them directly for example:
npm install @discordeno/types # Using npm
```
### Typescript
If you are using Typescript you do need to enable `strictNullChecks` in your TSConfig, or else it may cause issues especially with [Desired Properties](#understanding-desired-properties-in-discordeno)
## Understanding Bot Helpers
Whenever you want to do something on discord, you will need to talk to the discord api. To make this easy, we provide "helpers". For example, to send a message to a channel, you can call the `bot.helpers.sendMessage` method with the 2 required parameters: