0.0.2 • Published 3 years ago

flarumbots.js v0.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Flarum.js

Please read the disclaimer in the bottom of the readme!

Install: npm i flarumbots.js

How to create your first bot:

const flarum = require('flarumbots.js'); // import package
const Flarum = new flarum('https://discuss.flarum.org', false); // DO NOT PUT A '/' AT THE END OF THE URL!

// Make an Async function that runs automaticly
(async ()=>{
    const FlarumLogin = await Flarum.login('email/username', 'pass'); // Username/email password
    console.log(FlarumLogin);

    const posts = await Flarum.getLatestPosts();
    console.log(posts)

    const me = await Flarum.getUser('me'); // me = userid ('me' IS supported!!!!)
    console.log(me)
})()

Functions

getForumData() This requires no arguments, this gets all json from the forum itself.

getLatestPosts(mine) This has one argument of bool, this will get your/all latests posts.

getUser(id) This will get the selected user with that id.

getUsers() This needs no arguments, but you do need permissions!

login(identification, password) Log your bot in to initialize.

DISCLAIMER:

We are not affiliated to Flarum.org at all, all copyright belongs to the rightfull owner! We are not responsible for any damage done by this package, this is made to improve a flarum expierence!

0.0.2

3 years ago

0.0.1

3 years ago