Files
discordeno/website/docs/examples/bun.md
Fleny 8e011210e2 feat(docs): Add getting-started with installation (#3557)
* Add getting-started with installation

* Add minimal example, and helpers and desired proprieties explanation

* Add comment on helper example usage

* fix small grammar error

* Fix GuildMessages being without the Intents. before

Co-authored-by: Awesome Stickz <awesome@stickz.dev>

* Apply code suggestion

Co-authored-by: Awesome Stickz <awesome@stickz.dev>

* Apply suggestions from code review

Co-authored-by: Awesome Stickz <awesome@stickz.dev>

* fix: typo

* remove todo

* Apply suggestions from code review

Co-authored-by: LTS20050703 <lts20050703@gmail.com>

* Remove useless parenthesis

* Apply code review suggestion

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
Co-authored-by: LTS20050703 <lts20050703@gmail.com>
2024-05-24 05:09:35 +00:00

1.1 KiB

sidebar_position, sidebar_label
sidebar_position sidebar_label
4 Using with Bun

Using with Bun

Discordeno supports Bun by installing the @discordeno/bot package

Pre-Requirements

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

After you installed the @discordeno/bot package with bun you can start using it.

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

import { createBot } from '@discordeno/bot'

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

await bot.start()

:::note If you want you can use bun with any package manager, so if you want to can use npm to install the node_modules and use bun to run the code :::

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