Jump to content
TeyKey1

The Discord PVE rotation Bot

Recommended Posts

 

Caution: Due to update 0.35 the bot is currently not operational until further notice.

 

Given we now got a rotation API by GoldenGnu to access rotation data online I thought it's time to code a simple discord bot which shows the current rotations in a discord text channel:

84lxq3h.png

Use the Bot on your Discord:

You can invite the bot to your Discord Server by clicking the following link: https://discord.com/api/oauth2/authorize?client_id=802580434768756786&permissions=126016&scope=bot

You can use the following commands in Discord to control the bot:

$awr help shows the help page of this bot with all available commands

$awr setup #channel creates a PVE rotation in the given channel

$awr delete #channel deletes a PVE rotation in the given channel

$awr version shows the version of the bot and other details

please make sure the bot actually has access to the channels you want it to post the rotations/react to commands. Also to set it up you need to have the Manage_Roles permission in said server (Simply to prevent any user from spamming rotations around).

Important: I should have managed to fix most apparent bugs, chances are though that you'll find more while using it. In this case please let me know here or create an issue on github (link below). Also the rotations are fetched from https://aw.nikr.net/ which is maintained by GoldenGnu. So we still do not have anything automatic and of course it won't be up to date everytime due to that. The timezone of the bot is CET. There's currently no way for the client to change this.

 

It's a fairly simple bot right now in case you have ideas for new functions or improvements please let me know. Though we can't have it all as I'm limited by the fact that I can't run any client side code and by the functions Discord provides.

 

Github/Host the bot yourself:

You can find the Github repository here: https://github.com/TeyKey1/AWrotationDiscordBot

The Bot was built in node JS with the Discord JS library. My code is MIT licensed so feel free to reuse it for your own projects or needs.

Of course you can also host the bot yourself if you want. All you need is node and a server. In this case it's also advisable to use your own instance of the online PVE rotation Tracker by GoldenGnu to serve the rotation data. In general though you can also just run the bot standalone, as long as you serve a rotation.json file online for the Bot to access. You can configure the bot with the files given in the config folder.

 

Changelog:

Spoiler

09.02.2021 Updated to 1.0.1
- Enhanced error handling (Added specific message in case the Bot does not have access to given channel, seemed to happen quite often)

12.02.2021 Updated to 1.0.2
- Fixed memory leak
- Overhauled timing calculation and fixed bugs caused by certain offsets

13.02.2021 Updated to 1.1.0
- Added proper logging. You can find the logs of the bot and the express server in the logs folder
- Enhanced error handling

13.02.2021 Updated to 1.1.1
- Fixed wrong log timestamps

14.02.2021 Updated to 1.1.2
- Fixed wrong help commands. They now start properly with prefix+awr

Known Issues:

Spoiler

- Bot can run into a memory leak occasionally. I'm currently investigating this but it seems to be connected to the way Discord.js Library is caching data

- Some promise rejections in Discord.js Library are uncaught. 

 

  • Upvote 2

Spoiler

fdassdaas.jpg.c709df3e98adc5265f232fe9458a3043.jpg

 

Share this post


Link to post
Share on other sites

FYI. The bot can run into memory leaks currently resulting in the application to crash if it runs for too long (couple days usually). I seems to be connected to the way Discord.js, a library I use, is chaching data.

For now if you host the bot yourself, the immediate fix would be to restart it occasionally (once every day for example) to flush the memory. If you just use the provided bot you don't have to worry about anything everything should work as always.

I'll try to fix this asap, need some time to read into the docs to find a solution for this though.

 

Edit: Fixed with v1.0.2


Spoiler

fdassdaas.jpg.c709df3e98adc5265f232fe9458a3043.jpg

 

Share this post


Link to post
Share on other sites

Hello Guys

As you may have noticed the bot is not working since AW Update 0.35.
This update modified the way PVE rotations work as follows:

  • Map rotation time increased from 3min to 6min
  • Doubled PVE rotation pool size

To incorporate those changes the bot needs to undergo an update. This is in general not really a problem and can be done fast. However, due to those changes updating the rotations becomes an increasingly demanding job as the rotations now need to be tracked for 2h in an ideal case. As this is too high of an effort for most people who currently do the rotations it remains uncertain whether the rotations will continue to be tracked or not.

Due to this uncertainity I can currently not tell if the bot will resume standard operations or not. For the time being it will not track the rotations. And may even go offline until further notice. In case you want to remain updated on the bot development please refer to this Forum topic. I'll post any news about it here.


Spoiler

fdassdaas.jpg.c709df3e98adc5265f232fe9458a3043.jpg

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...