Skip to content

Predicts orbital alignments in order to provide accurate information about upcoming events in the MMO Aberoth via a Discord bot interface.

License

Notifications You must be signed in to change notification settings

aberoth-community/ephemeris-discord-bot

Repository files navigation

Ephemeris Logo

Aberoth Ephemeris Discord Bot

A Discord bot and user app that provides information about upcoming scroll events and moon phases within the MMORPG Aberoth. Built with the Aberoth Ephemeris module—which is also developed by GitHub user jvandag under an MIT license—which can be installed separately from PyPI or via a GitHub release for use in other contexts.

Example scroll event prediction menu:
Ephemeris_Bot_Example_Scroll_Menu.mp4

Installation & Running

If you're just looking to install Aberoth Ephemeris—the module that creates the prediction information—for your own project, you can install it with

pip install aberoth-ephemeris

Be sure to check the Aberoth Ephemeris repository for documentation on how to use the module for your own applications.

Otherwise, follow along to set up the Discord bot.

1. Clone the Repository

git clone https://github.com/aberoth-community/ephemeris-discord-bot

2. Initialize the Repository and Install Requirements

If you're using a bash terminal you can simply run

firstTimeSetup.sh

This will set up a venv and install the dependencies. Otherwise, optionally, you can configure a venv through other means and use

pip install .

3. Configure .env File

See example.env for structure

4. Configure Emojis

Change the emojis in variables.py to your own variables that your bot instance can use. It is recommended to upload your emojis to the emojis section for your bot in the Discord developer dashboard.

5. Run Bot

python -m ephemeris

Optional - 6. Run web server in separate terminal to intake auto-calibration data from separate script

cd ephemeris/UpdateWebServer
waitress-serve --listen=0.0.0.0:5000 --threads=1 varUpdateWS:app

An excellent separate script that can be used to send live calibration data to the Aberoth Ephemeris module used for this bot is the Ephemeris Overheard Hook made by GitHub user jvandag. It is built on GitHub user ashnel3's Overheard Scrapper which scrapes the Aberoth overheard page to find changes in scroll state, moon phase, time of day, and number of players online.

Bot Usage and Commands

If you're hosting your own distribution of this bot, be sure to configure the ownerID and disableWhitelisting variables variables within the variables.py file located in the config directory within the bot sub-directory.

Only the specified owner may use the /update_whitelist command which can be used to add users and guilds/servers to the whitelist. By default, all users and guilds are not whitelisted and thus unable to use the bot or user installable.

If disableWhitelisting is set to True, then all users will be able to utilize bot commands and menus as well as the user installable commands and menus regardless of the current whitelist settings.

Command Description & Parameters

/update_whitelist

Description: Adds a specified guild or user to the whitelist, allowing them to use the bot while in whitelist mode.

Parameters:
  • user_or_guild: The ID of the user or guild for which the permissions are being updated.
  • type: Indicates whether the passed in ID is a user or guild ID. Two options: user or guild.
  • expiration: The epoch timestamp in seconds at which the user's permissions will expire. An expiration time of -1 indicates no expiration.

/permissions

Description: Responds with the time the command user's and—if used in a guild—the guild's permissions expire.

When disableWhitelisting is set to `False`, the permissions have no effect.

Parameters: None.

/persistent_prediction_menu

Description: Creates an embed menu that allows users to request glows and darks for a selected day or range of days.

The command requires the user to be an admin within the guild it is used in. The menu has no expiration time and will persist between restarts of the bot. Bot responses are ephemeral.

Parameters:
  • use_emojis: Yes or No option. Yes indicates that the bot should use the emojis set for the command user—set via the /set_server_emojis command—in the place of the orb names.
  • allow_filters: Yes or No option. Yes indicates that the created menu should include a select menu that allows filtering of response content by orb. Note that filter changes from any user will update the filter settings for all users using the same menu instance.
  • whitelist_users_only (optional): Yes or No option. Yes indicates that non-whitelisted users will be allowed to use the menu instance, even if they are unable to create an instance.

/prediction_menu

Description: User App/Installable version only. Creates an embed menu that allows users to request glows and darks for a selected day or range of days.

The menu expires after five minutes. Filters are always allowed. Bot responses are NOT ephemeral.

Parameters:
  • use_emojis: Yes or No option. Yes indicates that the bot should use the emojis set for the guild, set via the /set_personal_emojis command, in the place of the orb names.
  • whitelist_users_only (optional): Yes or No option. Yes indicates that non-whitelisted users will be allowed to use the menu instance, even if they are unable to create an instance.

/persistent_lunar_calendar

Description: Creates an embed menu that allows users to request start information on the current and upcoming moon phases.

The command requires the user to be an admin within the guild it is used in. The menu has no expiration time and will persist between restarts of the bot. Bot responses are ephemeral.

Parameters:
  • user_set_emojis: Yes or No option. Yes indicates that the bot should use the emojis set for the guild, set via the /set_server_emojis command, instead of the default global emojis.
  • whitelist_users_only (optional): Yes or No option. Yes indicates that non-whitelisted users will be allowed to use the menu instance, even if they are unable to create an instance.

/lunar_calendar

Description: Creates an embed menu that allows users to request start information on the current and upcoming moon phases.

The command requires the user to be an admin within the guild it is used in. The menu has no expiration time and will persist between restarts of the bot. Bot responses are ephemeral.

Parameters:
  • user_set_emojis: Yes or No option. Yes indicates that the bot should use the emojis set for the user, set via the /set_user_emojis command, instead of the default global emojis.
  • whitelisted_users_only (optional): Yes or No option. Yes indicates that non-whitelisted users will be allowed to use the menu instance, even if they are unable to create an instance.

/set_server_emojis

Description: Sets the emojis used by persistent menus within the server.

The command requires the user to be an admin within the guild it is used in.

Parameters:
  • white, black, green, red, purple, yellow, cyan, blue (optional): The emojis that will be used for the corresponding orbs. If no options are selected then a suitable default emoji is used.
  • new, waxing_crescent, first_quarter, waxing_gibbous, full, waning_gibbous, third_quarter, waning_crescent (optional): The emojis that will be used for the corresponding moon phases. If no options are selected then a suitable default emoji is used.

/set_user_emojis

Description: Sets the emojis used by the command user's user app/installable menus.

Parameters:
  • white, black, green, red, purple, yellow, cyan, blue (optional): The emojis that will be used for the corresponding orbs. If no options are selected then a suitable default emoji is used.
  • new, waxing_crescent, first_quarter, waxing_gibbous, full, waning_gibbous, third_quarter, waning_crescent (optional): The emojis that will be used for the corresponding moon phases. If no options are selected then a suitable default emoji is used.

About

Predicts orbital alignments in order to provide accurate information about upcoming events in the MMO Aberoth via a Discord bot interface.

Topics

Resources

License

Stars

Watchers

Forks

Languages