osuAkatsuki / bancho.py

An osu! server for the generic public, optimized for maintainability in modern python
https://akatsuki.gg
MIT License
201 stars 125 forks source link

Reduce duplication issues with map nomination requests and clarity of cmd output #585

Closed cmyui closed 4 months ago

cmyui commented 4 months ago

Describe your changes

There are two changes introduced in this PR:

  1. Group nomination requests by beatmap in the !requests command output. Display count of times requested, rather than individual player requests.
  2. Disallow duplicate nomination requests for unique key (map_id, player_id).

Sample command usage after the change:

22:30 cmyui: !requests
22:30 BanchoBot: The queue is clean! (0 map request(s)) | Elapsed: 870.11 μsec
22:30 *cmyui is listening to [https://osu.cmyui.xyz/beatmapsets/521936#/1820817 DJ TOTTO - Crystalia]
22:30 cmyui: !request
22:30 BanchoBot: Request submitted. | Elapsed: 22.58 msec
22:30 cmyui: !request
22:30 BanchoBot: You already have an active nomination request for that map. | Elapsed: 1.11 msec
22:30 cmyui: !requests
22:30 BanchoBot: Total requested beatmaps: 1
1x request(s) starting 2024-02-13: [https://osu.cmyui.xyz/b/1820817 DJ TOTTO - Crystalia [Extra 2018]] | Elapsed: 1.06 msec
22:30 cmyui: !map rank map
22:30 BanchoBot: [https://osu.cmyui.xyz/b/1820817 DJ TOTTO - Crystalia [Extra 2018]] updated to Ranked. | Elapsed: 26.47 msec
22:30 cmyui: !requests
22:30 BanchoBot: The queue is clean! (0 map request(s)) | Elapsed: 1.05 msec
22:32 cmyui: !request
22:32 BanchoBot: Only pending maps may be requested for status change. | Elapsed: 24.20 μsec

Related Issues / Projects

Checklist