mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
docs: Include notice of strictNullChecks being required (#4267)
And also update deno example to use v21
This commit is contained in:
@@ -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 bot’s functionality — like omitting `channel.topic` when it’s 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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user