Skip to content

andygarcha/CE-Assistant-v2

Repository files navigation

CE-Assistant (v2)

An object oriented version of CE-Assistant-v1, a discord bot coded using discord.py. This bot serves two main purposes for the online community Challenge Enthusiasts.

Challenge Enthusiasts

Challenge Enthusiasts is an online community made to curate and categorize video games in a point-based system. Each game is given certain "objectives" based on tasks to be completed in the game.

Purpose 1: Game Updates

This bot will send detailed updates to the Discord server whenever a game on the site is added, updated, or removed.

Screenshot of Mario Kart: Double Dash being added to the site.

When a game is updated, the bot gives a run down of everything that was changed.

Screenshot of a game, Terra Feminarum, being updated on Challenge Enthusiasts.

When a game has a longer amount of objectives (seven or more), the bot will screenshot just the specific objective that was changed.

Screenshot of the 'Challenge Enthusiasts' game on the Challenge Enthusiasts site, used for keeping track of individual user accomplishments, having a singular objective update.

Purpose 2: Casino

This bot allows users in the Discord server to participate in roll events. Users who participate in these will have a set number of games that fit certain parameters (difficulty, category, etc.) randomly selected for them, depending on the event. Once they complete these events (usually within a time limit, but some events go on forever), they're awarded a badge on the site, and the bot sends an update to the server.

Screenshot of a user completing Two 'Two Week T2 Streak' Streak.

The bot keeps track of all previously completed rolls as well, so anyone can view their previous accomplishments.

This gets a lot trickier, as some rolls are Co-Op or PvP. You can view a spreadsheet with information on all of the roll events here.

Smaller Capabilities

While CE-Assistant has its own main purposes, it also can do a lot of smaller stuff.

1. Return user information

Users can use /profile, with an optional parameter of another discord.User, and the bot will return information about this user.

Screenshot of Folkius's profile page. Screenshot of Folkius's profile page.

2. Return information on any CE game

Users can use /ce-game with one parameter for the name of the game, and the bot will return information from CE about it.

A message showing CE information about Celeste

3. Return information on any Steam game

Users can use /steam-game with one parameter for the name of the game, and the bot will return information from Steam about it.

This feature is outdated, and likely will not return in the future.

Requested Steam information on Celeste.

4. Steam curator

The Steam curator for Challenge Enthusiasts is updated with games that are cleared and popular on the site. Any time the curator is updated, the bot will send a message.

A curator message showing that Crisis Wing has been added to the Curator.

5. Setting user color

Challenge Enthusiast users are awarded ranks based on how many points they have. The higher rank they are, the more colors they have access to within the Discord server. /set-color presents users with the options they have available to them and changes their colors on request.

Set color menu

6. Get SteamHunters information

One Challenge Enthusiasts user, Schmole, runs a script once a month and collects information on all the games and users on Challenge Enthusiasts and dumps it on this spreadsheet. This bot can access this spreadsheet and save specific data from it, specifically the 'Median Completion Time' from SteamHunters. So, rather than scrape the SteamHunters API every time a game is checked, the bot just accesses its local copy of this spreadsheet.

7. Help/FAQ

As is standard with any Discord bot, users can use /help to get a menu with frequently asked questions and access to other help.

Admin Capabilities

Administrators in the server have access to other commands to help with the bot.

8. Add notes

Administrators have the option to add notes to any game update message, in case there's any added context needed.

A game update with additional notes added.

9. Purge roll

In the event that something happens with a roll event, administrators can manually remove a roll from a user (without initiating a cooldown) so that they can re-roll.

How this gets done (for nerd losers)

The previous version of this code, CE-Assistant-v1, was not object-oriented. While it also used discord.py, it held all of its data in .json files and simply edited them raw. This became a huge issue whenever we, the developers, had to go back in and fix something, because as time went on, dealing with just the raw data got more and more confusing. In this version, we made classes for every type of object we were working with.

This bot utilizes the APIs for Steam, RetroAchievements, SteamHunters, and Challenge Enthusiasts. It stores its information using MongoDB.

The module Mongo_Reader contains all of the functions used for getting and dumping information straight from MongoDB. Similarly, the module CEAPIReader contains all of the functions used for scraping information from Challenge Enthusiasts' own backend.

For screenshotting, we use Selenium WebDrivers to access the internet and re-worked the screenshot functions in PIL. It uses the locations of specific objects on the pages to get the exact screen needed, and saves it until it can be sent.

Credits

Credits to Andy and Theron for being the main developers of both versions.

Credits to Folkius and Jarvis, the main administrators of Challenge Enthusiasts who helped us with direction and ideas quite a lot, and to Laura for writing the entire backend for the site and several custom API endpoints for the bot to use.

Credits to apollo and Schmole for writing code intermittenly and for general inspiration.

Credits to crappy for making both the icons for Challenge Enthusiasts emojis and the icon for CE-Assistant (seen below).

The final icon used by CE-Assistant.

About

discord.py bot used for Challenge Enthusiasts automation

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages