Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/discord-rose/discord-rose
The simple Discord library for advanced users
https://github.com/discord-rose/discord-rose
discord discord-api discord-bot discord-js discord-library
Last synced: about 2 months ago
JSON representation
The simple Discord library for advanced users
- Host: GitHub
- URL: https://github.com/discord-rose/discord-rose
- Owner: discord-rose
- Created: 2021-01-26T03:36:38.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-05T03:46:47.000Z (over 3 years ago)
- Last Synced: 2024-10-31T19:51:29.725Z (about 2 months ago)
- Topics: discord, discord-api, discord-bot, discord-js, discord-library
- Language: TypeScript
- Homepage: https://rose.js.org
- Size: 13.5 MB
- Stars: 34
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Discord-Rose
## The simple Discord library for advanced users.
# Installation
Run `npm i --save discord-rose`
## Links
[Wiki](https://github.com/discord-rose/discord-rose/wiki) [Docs](https://rose.js.org)
[Support Server](https://discord.gg/EdpA6qRHhs)
[NPM](https://npmjs.com/package/discord-rose), [GitHub](https://github.com/discord-rose/discord-rose)
# Simple bot
You can easily use the `SingleWorker` class for easy use of discord-rose, for scaled solution, look [below](#scaled-bot)
**./index.js**
```js
const { SingleWorker } = require('discord-rose')const worker = new SingleWorker({
token: 'BOT TOKEN'
})worker.commands
.prefix('!')
.add({
command: 'hello',
exec: (ctx) => {
ctx.reply('World!')
}
})
```# Scaled Bot
You can instead use a `Master` & `Worker` solution, one master managing multiple workers/clusters, which hold x amount of shards, making it much more efficient.
**./master.js**
```js
const { Master } = require('discord-rose')
const path = require('path')const master = new Master(path.resolve(__dirname, './worker.js'), {
token: 'BOT TOKEN'
})master.start()
```**./worker.js**
```js
const { Worker } = require('discord-rose')const worker = new Worker()
worker.commands
.prefix('!')
.add({
command: 'hello',
exec: (ctx) => {
ctx.reply('World!')
}
})
```
Do `node ./master.js` and you're off to the races. Scaled automatically.*Do note if your bot only ever fits into 1 cluster (< 5000 servers by default), you should consider using [SingleWorker](#simple-bot) since master & worker introduce more process overhead*
You can even easily implement [slash commands](https://github.com/discord-rose/discord-rose/wiki/Slash-Commands) directly within message commands.
## Ready to take it to the next level? Take a look out our [Wiki](https://github.com/discord-rose/discord-rose/wiki)