zeusops / operationbot

A bot for handling events on the Zeusops discord server
GNU General Public License v3.0
7 stars 4 forks source link

Add support for more than 20 reactions per event #65

Open Gehock opened 3 years ago

Gehock commented 3 years ago

The discord API only allows 20 reactions in a single message. This limit gets often exceeded because of multiple additional roles. The easiest solution would most likely to create a separate message for the extra reactions.

The challenge is that currently the code relies very heavily on the fact that a singe Event == single message and vice versa.

MaxKosi commented 3 years ago

image 4Ai6DS5 because I always forget what we discussed https://discord.com/channels/219564389462704130/530411066585382912/825741913738969108

MaxKosi commented 3 years ago

Current structure (if im correct):

Event holds List of roleGroups which contains roles when creating an event it goes through that list and adds them to the embed Currently hard coded is an role limit of 20 for that event. There is currently also a limit of 20 additional roles because of the saved emotes in the config file

TODO: event.py

  1. remove the limiter in addAdditionalRole()

Functions to touch: commandListener.py _updateevent messageFunctions.py createEventMessage updateMessageEmbed event.py __init_\ createEmbed countReactions ? toJson fromJson

return embeds as a list issue: message.id

MaxKosi commented 3 years ago

Suggestion: Divide this Issue in multiple smaller issues.

Right now solving this issue is very complicated because, as already said, the code heavily relies that it works with one message. So far I came to following solution: createEmbed in event.py returns a list of embeds Issue: Identification of messages in relation to the event. Solution: Create list of messageID in event.py Issue: Methods rely on getting one messageID and not a list

@Gehock help

Gehock commented 3 years ago

Creating a list of embeds and storing a list of messageIDs sounds reasonable to me. One thing that would cause some extra work might be sorting messages, right now sorting relies quite heavily on the fact that a single event has a single message. Not considering sorting, I think that dealing with multiple messageIDs might not be too complicated.

Gehock commented 1 year ago

With the current player numbers, this is not really a high priority anymore