https://github.com/boqsc/how-to-make-a-bot-using-revolt.js
A quick tutorial on how to make a bot for https://revolt.chat/
https://github.com/boqsc/how-to-make-a-bot-using-revolt.js
bot nodejs revolt-bot revolt-chat template tutorial
Last synced: about 2 months ago
JSON representation
A quick tutorial on how to make a bot for https://revolt.chat/
- Host: GitHub
- URL: https://github.com/boqsc/how-to-make-a-bot-using-revolt.js
- Owner: BoQsc
- License: cc0-1.0
- Created: 2022-11-27T09:15:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-15T16:02:45.000Z (about 2 years ago)
- Last Synced: 2024-05-01T21:29:20.469Z (about 1 year ago)
- Topics: bot, nodejs, revolt-bot, revolt-chat, template, tutorial
- Language: JavaScript
- Homepage:
- Size: 113 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Make-a-bot-in-Revolt.js
A step by step journey to make a Revolt Bot.
1. Download [Node JS Binary](https://nodejs.org/en/download/current/)
1. Reinstall NPM to avoid bug where **.\node_modules\npm** folder being deleted after first use. [More information](https://stackoverflow.com/a/71853469/3789797)
`npm install -D npm`2. Install [revolt.js](https://www.npmjs.com/package/revolt.js)
* `npm i revolt.js`
3. Go to Revolt and open **My Bots**
4. Add Bot
5. Copy Token
6. Use CommonJS example.
**bot.js**```javascript
// This is a bot.js example.
const { Client } = require("revolt.js");let client = new Client();
client.on("ready", async () => {
console.info(`User ID: ${client.user._id}!`);
console.info(`Logged in as ${client.user.username}!`);
console.info(`Bot online: ${client.user.online}!`);
client.users.edit({
status: {
text: "Listening to you.",
presence: "Idle",
},
});
console.info(`Logged in as ${client.user.bot.status}!`);
});client.on("message", async (message) => {
if (message.content === "hello") {
message.channel.sendMessage("world");
}
});client.loginBot("..");
```7. Insert your Token into `client.loginBot("..");`
8. Start your bot with `node --experimental-specifier-resolution=node bot.js`
9. Invite the bot into your server using Copy Invite Link button from **My Bots** Tab.
---
10. Edit the bot in the **My Bots**:
Change profile picture and Description.
# Advanced
11. Enabling TypeScript
*This part of article is incomplete and needs help.*
`npm i -D typescript`
`npm i revolt-api`
`npm i -D @types/node`
`npm i -D @types/ws`
`npm i axios`
`npm i -D @insertish/oapi`
`npx tsc bot.ts --lib ES6 --lib DOM --esModuleInterop --module ES6`
`npx tsc --showConfig`
`npx tsc bot.ts --lib ES6 --lib DOM --esModuleInterop --module ES6 --moduleResolution node --target ES6 --showConfig`
`npx tsc bot.ts --esModuleInterop --module ES6 --moduleResolution node --target ES6 --experimentalDecorators --strict --showConfig`
https://github.com/debertjamie/revolt-bot-template/blob/master/tsconfig.json
Current issue: https://github.com/revoltchat/revolt.js/issues/5711. Rehosting onto Linux Platform.

1. `apt install nodejs npm -y`
2. Install [revolt.js](https://www.npmjs.com/package/revolt.js)
* `npm i revolt.js`
3. `node --experimental-specifier-resolution=node bot.js`
12. Make the bot stay after disconnecting from Linux Machine:
```
nohup node --experimental-specifier-resolution=node bot.js > /dev/null 2>&1 & echo $! > run.pid
```
13. Stop the bot if needed.
```
kill -9 `cat run.pid`
```Useful Linux Commands:
```
ps
killall node
```# General Information
Revolt Web Client Production Source Code Repository
https://github.com/revoltchat/revite/tree/productionRevolt Windows Client releases
https://github.com/revoltchat/desktop/releasesRevolt API Changes
https://developers.revolt.chat/changes/Revolt Experimental Plugin API
https://developers.revolt.chat/plugin-apiRevolt Markdown Reference
https://developers.revolt.chat/markdownRevolt Architecture Map
https://developers.revolt.chat/stack/Revolt Bot programming Introduction
https://developers.revolt.chat/stack/revolt.js/guide/discord_js_migrationRevolt Bot programming basics
https://github.com/revoltchat/revolt.jsRevolt Katex Example
https://developers.revolt.chat/markdown#katex
$\color{red}\textsf{Red Text}$Revolt revolt.js API Reference
https://revolt.js.org/index.html