Jump to content
πŸ‘‰ Click here to explore Remote Jobs, Work From Home & Global News – USA πŸ‡ΊπŸ‡Έ | UK πŸ‡¬πŸ‡§ | Canada πŸ‡¨πŸ‡¦ | Pakistan πŸ‡΅πŸ‡° Γ—
🚫 Guest Access Notice Γ—

Recommended Posts

Posted

Wasn't too sure if this is the right section, but this is where I felt it was most appropriate from the forum titles I could see. I in no way claim to own this as I just found it on a small forum and thought others may find it useful. I have edited the Read Me below to contain more up to date and relevant information.

Shiroyuki JavaScript IPB to Discord Bot.

Summary:

This is a JavaScript bot developed using Node.JS which connects to discord via the Eris library. This bot uses REST API to grab information like the latest threads, posts, and users from Invision Power Boards. This is only a basic bot and as such can only post latest threads, authors, and posts but I will be expanding it in future to include many other useful things.

Features

  1. Uses REST API to grab Latest Thread
  2. Uses REST API to grab Latest Post
  3. Uses REST API to grab username of aforementioned things, and posts it in discord.
  4. URL Shortener (usingΒ https://goo.gl/)
  5. Syncing usernames on Discord with IPB Usernames (currently done with JSON file and a command)

To be implemented:

  1. automatic syncing of names.

Installation

  1. Download LTS Version of NodeJS fromΒ NodeJS
  2. Download files from github and extract them to wherever you like.
  3. Setup your REST API.
  4. Open Node.JS in your favorite editor eg Notepad++, Sublime, Atom etc.
  5. Edit the following sections and replace them with your own information.

Setting up REST API

Go to your Admin Control Panel -> System -> Underneath Site Features click "REST API" -> Create New and make it according to the image below. In regards to "Posts" Do the same as Topics with 4 Endpoints for it to gather information from. I just couldn't crop it out nicely and added this text as a result.

d0c2ENf.png

Β 

Setting up the bot.

Replace:

googl.setKey('');

with your own API from Goo.gl in this section. Link can be found by clicking --->Β Goo.gl API pageΒ <---

Replace:

var bot = new Eris(""); //This is your discord bot token

with your own token which can be gotten fromΒ --->Β Discord DevelopersΒ <---

Replace:

var username = '' //enter in your {REST API Key} here
var password = '' //Leave this blank

with your REST API key which you can make by going to IP Board Admin Control Panel -> System -> REST API and leave the password section blank. Otherwise this will not work as the API uses a basic authentication method.

forumDomain = "", //replace with your domain name

Replace the both of these with your different messages for Posts and Threads, Discord emotes will work as far as I am aware. For further documentation on the REST API I recommend you checkΒ IPB4 REST Api

Finally replace:

var postMessage = ":regional_indicator_n: :regional_indicator_e: :regional_indicator_w: :snowflake: :regional_indicator_p: Β :regional_indicator_o: :regional_indicator_s: :regional_indicator_t:"; // What message will come before linking to to new post."
var threadMessage = ":regional_indicator_n: :regional_indicator_e::regional_indicator_w: :snowflake: :regional_indicator_t: :regional_indicator_h::regional_indicator_r::regional_indicator_e: :regional_indicator_a::regional_indicator_d:"; // What message will come before linking to to new thread.

with whatever you want the bot to say when a thread/post is posted on the forums. At the moment it'll post something like this.

Example Image

Some of the text was removed for security, and because I felt like removing it.

After you've edited the file to suit the needs of your Discord and IPB Forums go to CMDΒ and navigate to the location of your bot. Eg: cd C:\Users\<Your Username>\Desktop\Discord-Bot and type "node bot.js" without the quotation marks.

To sync users

go to your discord channel and type !addNewTag FORUMUSERNAME @discordname (replace "!" with whatever you set your bot command prefix to) What this will do is whenever "FORUMUSERNAME" makes a thread and or post it'll automatically grab the forum username and if it matches with a preexisting discord name (via the use of the command (!addNewTag FORUMUSERNAME @discordname) it will change FORUMNAME into the discord name.

Issues

  1. At the current time: NONE

Shiroyuki_IPB_to_Discord.rar

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Forum Statistics

    2.7k
    Total Topics
    10.1k
    Total Posts


Γ—
Γ—
  • Create New...

Important Information

FundayForum uses essential cookies to run the community. Optional cookies support analytics and advertising. Choose Accept or Reject below. Read our Privacy Policy, Terms of Use and Guidelines. Essential cookies keep this community running. Choose Accept or Reject for optional cookies. Read our cookie policy and manage your cookie preferences.