zeusops / operationbot

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

20+ reaction support #86

Open MaxKosi opened 3 years ago

MaxKosi commented 3 years ago

closes #65 one day

Done:

messageID is a list now createEmbed returns a list of embeds reactions are added to the embeds adding roles updating the event signups / reactions work command functions dead code parts of messageID Saving/Loading/snycing on_raw_reaction_add

To Check:

make linter happy (:

Gehock commented 3 years ago

This is a very promising start. I simplified createAdditionalEmbed a bit, now there's slightly less duplicate code.

I think it would be more beneficial to try to add as many additional roles to the main message as possible. Normally the main message can fit quite a few additional roles before needing extra space, with this current setup adding even a single additional role will result in an extra message. I think the basic idea here is good, but instead of always splitting the Additional group into a separate message, we'd have to count the number of roles/reactions and create a new message only if that number exceeds 20.

Notes about my changes: I commented out some functionality related to the message handling so that I could make the bot display the embeds generated by createAdditionalEmbed. The logic for handling multiple messages and their IDs is currently missing completely, see the TODO notes in my commit.

MaxKosi commented 3 years ago

This is much better than my start. I didn't really have time to improve the code myself. BTW I might not have too much time until next week, because of another project. So if you want to continue this, feel free to do so. I don't have any local changes atm. I will look at any changes though so I can continue or help if necessary

MaxKosi commented 3 years ago

I re-added the emojis - they dont have a function yet again but theyre added correctly. You might want to look over it and maybe improve it. I have made quiet a few changes to messageFunctions

And added a TODO for the updateReactions function because I scrapped the more efficient part for now. Needs to be implemented again

BTW I havent got the Linter plugin yet, because it doesnt work yet. Ill fix the errors in the next commit ^ I didnt

MaxKosi commented 3 years ago

This pull request needs in-depth testing. I haven't found anything so far. But there might be a few things that I haven't seen.

There are 2 TODOs in messageFunctions.py. The one for syncMessages is obsolete but I forgot to remove the comment. Just saw that. The other one needs improvement but works,

Gehock commented 2 years ago

This feature is slowly starting to take shape. Creating and sorting multi-message events works now. Some things to still implement:

MaxKosi commented 2 years ago

Hey, as you've probably noticed, currently I dont have time to improve this PR. I have to put it on hold until decembre (probably). I would prefer if you would take care of this, if you have time and motivation, since this code has to be checked on every other change made to the master.

Gehock commented 2 years ago

Yeah, no worries. There's not really a rush with feature, I've been improving it every now and then when I've had the time.