An open API service indexing awesome lists of open source software.

https://github.com/thekicker/node-discord-bot


https://github.com/thekicker/node-discord-bot

Last synced: 12 months ago
JSON representation

Awesome Lists containing this project

README

          

# Discord Bot - Node JS Tutorial

Traversy Media - https://www.youtube.com/watch?v=BmKXBVdEV0g

## Getting Started

1. Create your bot on Discord's Developer Portal
- New Application (Give it a name)
- Bot tab, generate a Token (Store in .env file)
- OAuth tab, copy client id
- Visit: https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&scope=bot
- Add it to your server

2. Create a script to actually log the bot in

## Links

Discord:
```
https://discord.com/
```

Discord Developer Portal:
```
https://discord.com/developers/applications
```

Discord.js Documentation
```
https://discord.js.org/#/
```

## Bugs

CLIENT_MISSING_INTENTS
- Fix (link) is to add GatewayIntentBits to several lines

```
const { Client, GatewayIntentBits } = require('discord.js')
const sigma = new Client({ intents: [GatewayIntentBits.Guilds] });
```

Message.content is empty but everything else is there
- Fix (link) is to add GatewayIntentBits.MessageContent

```
'intents': [
GatewayIntentBits.DirectMessages,
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildMessages
]
```