Files
discordeno/website/docs/examples/deno.md
Fleny 4939822434 docs: Update desired properties docs (#3940)
* Update docs for desired properties

* Update examples to use createBot desiredProperties

The BigBot and reaction roles examples use the Discordeno CLI

* Migrate examples to v19 stable

* Docs work
2024-11-19 16:40:01 -06:00

1.0 KiB

sidebar_position, sidebar_label
sidebar_position sidebar_label
3 Using with Deno

Using with Deno

Discordeno supports Deno by using the npm: specifier for your import.

Pre-Requirements

Before, going forward, please make sure to have finished everything on this list.

This is how you can use it to create a bot that logs into discord:

import { load } from 'https://deno.land/std@0.212.0/dotenv/mod.ts'
import { createBot } from 'npm:@discordeno/bot@19.0.0'

const env = await load()

const bot = createBot({
  token: env.token,
  events: {
    ready: ({ shardId }) => console.log(`Shard ${shardId} ready`),
  },
})

await bot.start()

You are free to expand from this point with whatever code you want. Happy coding!