10.3.7 • Published 1 year ago

dscbots.js v10.3.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Credits

Goodsie - Helping me with the websocketmanager

About

dscbots.js is a Node.js module that allows you to interact with the Discord API without any complications.

  • Performant
  • 100% coverage of the Discord API

Usage


Node.js 16.9.0 or newer is required.

Installing dscbots.js:

npm install dscbots.js
yarn add dscbots.js
pnpm add dscbots.js

Setup your bot with the following code:

const Dbot = require('dscbots.js')
const bot = new Dbot.BotClient({
    intents: [Dbot.Intents.FLAGS.GUILD_MESSAGES, Dbot.Intents.FLAGS.DIRECT_MESSAGES],
    token: "<Bot Token>"
})

bot.CreateBot(function () {
   console.log(`${bot.user.tag} is ready.`)
});

Afterwards we can create a quite simple message command:

const Dbot = require('dscbots.js')
const bot = new Dbot.BotClient({
    intents: [Dbot.Intents.FLAGS.GUILD_MESSAGES, Dbot.Intents.FLAGS.DIRECT_MESSAGES],
    token: "<Bot Token>"
})

bot.on('message', (message) => {
    if (message.author.isBot) return;
    
    if (message.content === '!hello') {
        message.reply("Hi!");
    }
})

bot.CreateBot(function () {
   console.log(`${bot.user.tag} is ready.`)
});

You can also set your activity!

const Dbot = require('dscbots.js')
const bot = new Dbot.BotClient({
    intents: [Dbot.Intents.FLAGS.GUILD_MESSAGES, Dbot.Intents.FLAGS.DIRECT_MESSAGES],
    token: "<Bot Token>"
})

bot.CreateBot(function () {
   console.log(`${bot.user.tag} is ready.`)
   bot.user.setActivity("This server!", "WATCHING");
   //Dbot.activities - Returns a list of activities available.
   // There is currently 2,5s delay to not cause ratelimit!
});

And you can set the your bot to be on phone.

const Dbot = require('dscbots.js')
const bot = new Dbot.BotClient({
    intents: [Dbot.Intents.FLAGS.GUILD_MESSAGES, Dbot.Intents.FLAGS.DIRECT_MESSAGES],
    token: "<Bot Token>",
    device: Dbot.devices.mobile
    // You can also remove this option, it's not required!
})

bot.CreateBot(function () {
   console.log(`${bot.user.tag} is ready.`)
   bot.user.setActivity("This server!", "WATCHING");
});

For more information go to dscbots.js Server!

Help

If you don't understand something in the package, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official dscbots.js Server.

10.3.2

1 year ago

10.2.3

1 year ago

10.1.4

1 year ago

10.0.5

2 years ago

10.3.3

1 year ago

10.2.4

1 year ago

10.1.5

1 year ago

10.0.6

2 years ago

10.3.4

1 year ago

10.2.5

1 year ago

10.1.6

1 year ago

10.0.7

2 years ago

10.3.5

1 year ago

10.2.6

1 year ago

10.1.7

1 year ago

10.0.8

2 years ago

10.3.6

1 year ago

10.2.7

1 year ago

10.1.8

1 year ago

10.0.9

2 years ago

10.3.7

1 year ago

10.2.8

1 year ago

10.1.9

1 year ago

10.2.9

1 year ago

10.0.0

2 years ago

10.1.0

2 years ago

10.0.1

2 years ago

10.2.0

1 year ago

10.1.1

2 years ago

10.0.2

2 years ago

10.3.0

1 year ago

10.2.1

1 year ago

10.1.2

2 years ago

10.0.3

2 years ago

10.3.1

1 year ago

10.2.2

1 year ago

10.1.3

1 year ago

10.0.4

2 years ago

1.0.2

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago