A Node.js wrapper of the Ruqqus API; designed for Ruqqus Applications.
npm install ruqqus-jsnpm i ruqqus-jshttps://ruqqus.com/oauth/authorize and add the following URL parameters:
client_id - Your application's Client ID
redirect_uri - The redirect URI (or one of the URIs) specified in your application information. Must not use HTTP unless using localhost (use HTTPS -
state - This is your own anti-cross-site-forgery token. Ruqqus doesn't do anything with this, except give it to the user to pass back to you later. You are responsible for generating and validating the state token.
scope - A comma-separated list of permission scopes that you are requesting. Valid scopes are: identity, create, read, update, delete, vote, and guildmaster.
permanent - optional. Set to true if you are requesting indefinite access. Omit if not.
getAuthURL(), which takes parameters in the function arguments, and getAuthURLInput(), which takes the parameters in the console. Below is an example of the former.
js
const { getAuthURL } = require("ruqqus-js");
console.log(getAuthURL({
id: "CLIENT_ID",
redirect: "REDIRECT_URI",
state: "STATE_TOKEN",
scopes: "SCOPE_LIST",
permanent: true
}));
`
$3
If you did everything correctly, the URL should take you to an Authorization page, which should subsequently take you to your specified redirect URI. The authcode should be in the URL; keep in mind that every code has a one-time use. Follow the code in the example section with the client parameters to run your bot.
Example
`js
const Ruqqus = require("ruqqus-js");
const client = new Ruqqus.Client();
client.on("ready", () => {
console.log(Logged in as ${client.user.username}!);
});
client.login({
id: "CLIENT_ID",
token: "CLIENT_SECRET",
code: "AUTHCODE"
});
``