Spectrum - Discord Bot

p1
The problem this bot is trying to tackle is a lack of flexibility in conditions for assigning roles to your users. It aims to achieve maximum freedom in what you can check for role assignments.

Usually, Discord bots have a predefined set of conditions you can select. Those conditions might include but are not limited to:

  • In Alliance
    A player is in a specific alliance or a list of alliances.

  • In Corporation
    A player is in a specific corporation or a list of corporations.

  • Standings
    A player or his corporation/alliance have a specific standing.

What if you would like to check if a player is in a specific alliance, enlisted in Factional Warfare, has Jump Drive Calibration trained to 5 and the necessary skills to fly your doctrine capitals? Would be nice if you could give him a Discord role that provides him with access to a capital ping channel, right?

Whit this bot, that and more is possible.

How does this work?

The EVE Online ESI does provide a lot of ingame information for developers to play around with. If you have experience with programming, you can use that information to do a lot of nice stuff. If you do not, you are usually limited to using the tools of other players, but those might not always entirely provide what you need.

The way to solve this issue is to provide the information you are getting from ESI in a format non-developers can work with, which is what this bot does. Instead of giving you predefined conditions, it provides you with ESI Endpoints that you can use to create your own conditions in a graphical user interface via drag and drop.

To give you an example… a request to pull public corporation information from ESI will provide you with the following attributes: alliance_id , ceo_id , creator_id , date_founded , description , faction_id , home_station_id , member_count , name , shares , tax_rate , ticker , url , war_eligible .

For this bot, such an attribute is called “Endpoint” and they are provided in a list you can drag and drop onto the page to check for specific values. If we would like to know which corporations in the alliance VINDICTIVE have 100 members or more, that would look like this …


A condition like that can now be used on the Rules page and linked with an action (Create Role, Assign Role, Change Nickname, …) that will trigger, when the condition is true. How you connect those endpoints and what you want to check for, is completely up to you. Most elements in this condition will show you a popup when clicked and provide you with more options.

p3 p4

How do I use a condition I’ve created?

Once you have saved your condition, switch to the Rules page. When creating a new rule, you will be greeted by two red boxes. One is for selecting the condition you’d like this rule to have, the other box is for selecting the action this rule will execute.


Clicking Select Condition will provide you with some predefined conditions (in yellow) for convenience and your custom conditions. Select one of the conditions, and the box will turn green. After you’ve selected your condition, click Select Action and choose what should happen when your condition is true. After you’ve selected the action, additional options for the action you’ve selected will appear. In our case, we would like to create a Discord role called Big Corp when our condition is true.


After saving this rule, you can switch to the Bot Control page and (if not active) activate the bot. You will find a server console there that will forward any logs that are specific to your server and show you what the bot is doing in the background.


As you can see, the bot created our Discord role Big Corp and moved it to the correct position in the role list. It then told us that it has finished updating all endpoints and enforcing the rules. It will do a new check every 60 seconds.

What’s with the other pages?

This bot is still in beta. That does not mean it isn’t feature complete for its main purpose (authentication and role assignment), but that there’s still a lot more to come before release. It is intended for a broad Spectrum (heh) of tasks like event forwarding and pings, kill feeds, intel gathering and fleet management. The pages Dashboard and Payment currently serve no purpose, because during beta I will not ask for any ISK payment for this bot. The beta will continue for a few months while I’m adding new functionality via Modules , which can be subscribed to and tested and will provide the mentioned features. It is likely there’ll still be some bugs to fix as well.

I have a feature request / bug report / question!

Please join the development Discord server: https://discord.gg/CjXDjfD

At the time of writing this, we are at 707 endpoints and new functionality and endpoints are added regularly. If you are missing endpoints or features or something is not working correctly, the development Discord server will be the best option to get in contact. You will also find people there that might be able to help with any questions regarding the configuration.

How can I make this bot join my server?

Click this link: https://discordapp.com/oauth2/authorize?client_id=576146498773975053&scope=bot

What chat commands are there?

!auth

The bot will send you a private message with a link. Follow the link and select your character. The bot will then link your character to your Discord user.

!config

The bot will send you a private link to the configuration page. When the bot joins your server, only the server owner will be able to request this link at first. He can add more bot operators. Having admin rights on Discord will NOT automatically grant you access to the bot configuration.

What scopes does the bot request from my users?

That is dynamic and depends on which endpoints you are checking for in your conditions. If you are only checking for public information like corporation names, alliance names or member count, the bot does need no scopes at all.

The requested scopes in the authentication link will change according to what information you require from your users.

Important

If you change an already running configuration so it does require scopes that were not needed before, every user that was authenticated will receive a message telling them to re-authenticate within 72 hours (3 days), or their tokens will be deleted.

There is also a page where you can add scopes that should always be requested, so you can plan ahead a bit and ask for more scopes than the bot currently needs.

What permissions does the bot need on my server?

At least one channel where it can read and write, so it can see commands being entered. Other than that, the server should allow private messages between users, so the bot can answer the authentication and configuration commands.

Everything else depends on which actions you have select in the rules. If you would like the bot to change your user’s nicknames, it will need the permissions to do that. If you want it to create and assign roles, it will need those permissions.

Hint

Be aware that the bot can not create roles with permissions that he himself does not have. If you want the bot to create an admin role for directors in your corporation, the bot itself will need admin roles as well.

That’s it.

I still have a lot of work to do, but I feel like this project is mature enough to be used by the public. I hope this will be useful to some people and would be happy for feedback during the beta.

2 Likes

Been asked if I could include some Endpoints for roleplaying servers, so the following Endpoints have been added.

  • Added Ancestry ID endpoint to Endpoints > EVE Online > Character > Lineage .
  • Added Ancestry Name endpoint to Endpoints > EVE Online > Character > Lineage .
  • Added Bloodline ID endpoint to Endpoints > EVE Online > Character > Lineage .
  • Added Bloodline Name endpoint to Endpoints > EVE Online > Character > Lineage .
  • Added Race ID endpoint to Endpoints > EVE Online > Character > Lineage .
  • Added Race Name endpoint to Endpoints > EVE Online > Character > Lineage .
  • Added Gender Name endpoint to Endpoints > EVE Online > Character > Lineage .

The already existing Endpoints to check for the current ship characters are sitting in got extended by the ship group (Combat Battlecruiser, Interceptor, Frigate, etc.).

  • Added Ship Group ID endpoint to EVE Online > Character > Ship .
  • Added Ship Group Name endpoint to EVE Online > Character > Ship .

Additionally, the following Endpoints have been added.

  • Added Member Count endpoint to Endpoints > EVE Online > Corporation .
  • Added Tax Rate endpoint to Endpoints > EVE Online > Corporation .
  • Added War Eligible endpoint to Endpoints > EVE Online > Corporation .

Bugfixes and Improvements.

  • Removed some redundant error checking, saving some performance and memory.
  • Fixed the process of re-ordering roles on Discord sometimes getting stuck.
  • Cleared some of the unnecessary header information of ESI requests, saving some memory.

A page to manually add additional scopes to the bot has been added to the configuration page. Every scope selected there will always be requested from authenticating users, no matter if the scope is currently needed or not.

Unbenannt
This should help if you plan to use additional features at a later point and don’t want to have your users re-authenticate when you make the switch.

As of the latest update, it is now possible to chain previously created conditions together. That will remove a big chunk of redundancy when you try to make sure that all the conditions you are creating only apply to specific users. You could now (for example) create the condition Is a Friend , which will check if a user is either in the specified corporation or has blue standing from it. If we save this condition, then it will show up under the My Conditions section on the right and can be reused.

You could now create a second condition that will check if a user can fly a Drake, but we are only interested in Drake pilots that can actually join our fleets, hence are either in our corporation or a friend of it. You can do that now by simply dragging the custom condition you created before and don’t need to bother with duplicating that huge condition again.

The amount of chaining you can do is not limited, so your now created Can fly Drake condition will show up in the My Conditions section as well. If you now would like to create a third condition which checks whether Drake pilots who can join our fleet are currently online, you can do that by dragging the Can fly Drake condition into the Is Online condition we are about to create. The Is a Friend condition is no longer necessary at this point, because the Can fly Drake condition already checks for that.

This is just one example of course. I’m sure you’ll find other useful use cases for this. I hope this helps to remove some of the complexity and clutter.

A notification module has been added to the bot. It now supports forwarding ingame notifications to a Discord channel or multiple channels.

You can freely choose which notifications go into which channel. You could also forward the same notification into multiple channels. A filter for factions (Caldari State, Minmatar Republic, Amarr Empire, Gallente Federation), alliances and corporations lets you choose from what entities you would like to receive notifications.

Example

The amount of available notification types will increase over the coming days. At the time of writing this, the following notifications can be forwarded:

Factional Warfare

  • Alliance Kicked
    An alliance has been kicked from participating in factional warfare.

  • Corporation Kicked
    A corporation has been kicked from participating in factional warfare.

Alliance

  • Alliance Capital Changed
    The capital system of our alliance changed to a new system.

  • Bounty Placed On Alliance
    Someone placed a bounty on our alliance.

  • Entosis Capture Started
    Someone activated an entosis link on an alliance’s sovereignty structure and the warm up cycle is over.

  • Sovereignty Structure Destroyed
    A structure that can only be placed in sovereign space has been destroyed. Infrastructure Hubs and Territorial Claim Units would fall under this category.

  • Sovereignty Structure Self Destruct Cancelled
    A structure that can only be placed in sovereign space had its self destruct command cancelled. Infrastructure Hubs and Territorial Claim Units would fall under this category.

  • Sovereignty Structure Self Destruct Finished
    A structure that can only be placed in sovereign space has successfully self destructed. Infrastructure Hubs and Territorial Claim Units would fall under this category.

  • Sovereignty Structure Self Destruct Initiated
    A structure that can only be placed in sovereign space was sheduled to self destruct. Infrastructure Hubs and Territorial Claim Units would fall under this category.

Corporation

  • Bounty Place On Corporation
    Someone placed a bounty on our corporation.

  • Character Application Accepted
    A corporation accepted the membership application from a character.

  • New Corporation Application
    A player applied for joining a corporation.

  • New CEO
    The CEO of a corporation changed.

  • Tax Changed
    A corporation changed its tax rate to a new percentage.

  • Moonmining Automatic Fracture
    A moon chunk has expired its lifetime and fractured automatically.

  • Moonmining Extraction Cancelled
    The extraction of a moon chunk has been cancelled.

  • Moonmining Extraction Finished
    The extraction of a moon chunk is complete. It is waiting to be fractured.

  • Moonmining Extraction Started
    The extraction of a moon chunk has been started.

  • Moonmining Laser Fired
    A moon chunk has been fractured by hand by firing the moonmining laser.

War

  • Accepted Ally
    An ally offer has been accepted in one of our wars.

  • Accepted Surrender
    A surrender offer has been accepted in one of our wars.

If you would like to see support for any specific notifications that you need, let me know on the Development Discord Server.

1 Like

Do you have this bot on stand alone where i can install it myself?

Not yet, no.

When most of the important modules that are planned are finished, I will work on a self-hosting option for this bot. It is definitly coming, but I can not say how soon.

Bumping because we all need this.

1 Like

I had some time for programming again and reworked the bot backend, making it a lot more efficient CPU and RAM wise. The authentication process now works with a dedicated page instead of a simple link and the bot now supports linking multiple characters to your discord user.

This will do automatic checks for conditions on all of your characters and if one of them fulfills a condition, the rule will be applied.

Additional updates:

  • Removed remnants of Dust514 specific ingame roles.
  • Changed most of the notification descriptions to better clarify what the notifications are for.
  • Links to locations in notifications will now forward you to dotlan instead of zKillboard and mark the location (system, constellation, region) on the map.
  • Added notification Structure Under Attack to module Notification.
  • Added notification Low On Fuel to module Notification.

With the main work now taken care of, I should be able to push out most of the features still on my list (there are a lot) a bit quicker. You should get development updates in a higher frequency now.

2 Likes

The bot can now automatically create channels and categories. It can add roles to channels (including permission overwrites) and add channels to categories. Keywords for dynamic channel and category names are supported.

The bot will try its best to conform to Discord’s naming policy (no white space for text channels, lower case, …), but when that fails, it’ll let you know to change it.

Changelog:

  • Added action Create Channel to page Rules.
  • Added action Create Category to page Rules.
  • Added action Add Role To Channel to page Rules.
  • Added action Add Channel To Category to page Rules.
  • Changed name of action Assign Role to Add Role To User on page Rules.
  • Fixed a display bug on the Conditions page when checking against another endpoint instead of a value.
  • Removed restriction on only being able to have one rule that creates or assigns a role with the same name.
  • Upon joining a new server the bot will now create some default conditions to make getting started easier.

This is a fantastic bot!

I used it to setup our alliance discord.

After some playing around and asking Nexus some questions, to which he was amazingly patient, i have managed to setup some really great automated features.

This bot and Nexus have been fantastic!

Good news! As of today, Spectrum is officially verified by Discord!
Thank you for all your support so far! Lots of new features coming soon!

Unbenannt

2 Likes