mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-30 15:30:07 +00:00
* 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>
1.0 KiB
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.
- Create an application and get the bot token. Create Application Guide
- Add your bot to a server you own. Invite Bot Guide
- Install Discordeno. Installation Guide
- Setup environment variables. Environment Variables Guide
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-next.d81b28a'
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!