Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
new-dblapi
Advanced tools
new-dblapi was made to be very easy to use. Is it better than the original? No idea, I made this out of pure boredom, most of it is tested to work.
const DBL = require('new-dblapi')
const dbl = new DBL(token[, options[, client]])
const DBL = require('new-dblapi')
const dbl = new DBL(token[, client])
It is very important you actually have a discordbots.org token for your bot to use this. In matter of fact, it doesn't work without it! So what does an amazing programmer like yourself do? Head to https://discordbots.org/api/docs#mybots, make sure your signed in. Nothing appearing? Make sure you have the right account and your bot is since verified!
Very good question. After you have a discord.js bot (if you don't I don't even know why your here) and a dbl token you call the constructor, it'll look something like:
const DBL = require('new-dblapi')
const dbl = new DBL(token[, options[, client]])
const DBL = require('new-dblapi')
const dbl = new DBL(token[, client])
Look familiar? It should, it's just above this.
Options is an object consisting of 4 things: delay (posting stats), port, auth and path. All 3, port, auth and path are for the webhook. If you provide a port, you must provide an auth, but path is optional. So what does it look like?
const DBL = require('new-dblapi')
const dbl = new DBL('your-dbl-token', {delay: 4444444, port: 5555, auth: "6666", path: "77777"}, client)
Happy? I hope you are, it took 10 minutes to make.
So you want a webhook to receive your votes? This is very easy to do and is all done in the optional options. That's right you don't even need them, but if you want a webhook, you do. Theres only two required parameters to get webhooks working all good, that's a port for the server to run on and your webhook's authorization. What if I want to be cool and run it on a different path? That's easy to do, when constructing it, provide a path. Is this too hard to understand? Let me break it down.
const DBL = require('new-dblapi')
const dbl = new DBL(token, {port: 5000, auth: "StinkyAuthorization", path:"notmyvotes"})
dbl.on('vote', (vote) => {
// Your stuff here, you cant have it all!
})
So what does vote
return? Vote returns exactly what the original dblapi does. This means you get a user by doing vote.user
. Cool, eh? No? Oh, I'll go cry in a corner.
What else can I do with this package? Theres some cool stuff you can do with this package, well bascially everything the original one can do.
How do I post stats? This one's easy, just provide a client (discord.js client). If you dont provide a delay in options
, it will automatically be 30 minutes, the minimum is 15 minutes.
But, what are the cool methods? There are 5 whole methods, wow! So what do we got to work with? getUser(id)
, getBot([id[, votes]])
(votes is false by default, add true to get last 1000 votes), checkVote(id)
, getStats([id])
What does all this do? I have no idea to be honest I made this with 10 minutes of free time and tested it once #gooddev.
getUser(id)
gets a user, who'da thunk it? It returns a user from the discordbots api
getBot([id[, votes]])
gets a bot, wow! Another obvious method! It will get your bot by default and if you put votes to true, it will return an array of the last 1000 votes. Cool.
checkVote(id)
will... check... a... users vote! It returns 1, or 0. 1 being yes, 0 being no (true/false, if you're feeling like that).
getStats([id])
get's a bots stats if it's listed on discordbots.org. It will return the full bot object.
So this was made in 10 minutes, will I keep it updated? Yes.
Will I add requests from the github? Yes.
Will I add support for eris? idk.
FAQs
A new DBL API wrapper.
The npm package new-dblapi receives a total of 5 weekly downloads. As such, new-dblapi popularity was classified as not popular.
We found that new-dblapi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.