Repository navigation
feat: suggest EMA tournaments in /create_channel - #339
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #339 +/- ##
==========================================
+ Coverage 50.42% 53.81% +3.39%
==========================================
Files 22 24 +2
Lines 1664 1968 +304
==========================================
+ Hits 839 1059 +220
- Misses 825 909 +84
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
d1bf56e to
35bb84d
Compare
35bb84d to
3c1faf8
Compare
3c1faf8 to
3f6a3a4
Compare
6e8072f to
8cf55cd
Compare
Suggests tournaments from the EMA calendar and names their channels like 🏆2026-02-kraków-hatsumi-taikai-2026, with the city, Polish date and website as the topic.
8cf55cd to
ebc3ac2
Compare
| use crate::tournaments_watcher::ema::TournamentEntry; | ||
|
|
||
| /// English month names and their Polish genitive forms ("14 lutego"). | ||
| const MONTHS: [(&str, &str); 12] = [ |
There was a problem hiding this comment.
nit: can we separate logic from data and move the MONTHS and POLISH_CITY_NAMES constants into a separate submodule?
There was a problem hiding this comment.
Done, moved them to tournament_channel/polish_names.rs
| return Ok(tournaments.clone()); | ||
| } | ||
|
|
||
| match get_tournaments().await { |
There was a problem hiding this comment.
We already retrieve the tournament list in the tournament_watcher module and we really should avoid duplicating this. Right now, the list is updated every 10 minutes for the tournament updates, and then it might be updated here every 10 minutes just to generate the autocomplete suggestions for the slash command.
I really want to avoid making excessive requests to the EMA servers so that they won't block us, and therefore we should unify how tournaments watcher and command autocomplete stores the tournament list cache. One way to do that would be to modify start_tournaments_watcher to get the list using TournamentsCache instead of using get_rcr_tournaments directly.
There was a problem hiding this comment.
Done, the watcher now fetches through the shared TournamentsCache
| } | ||
| } | ||
|
|
||
| /// Like [`Self::get`], but gives up (logging why) after `limit`. |
There was a problem hiding this comment.
This will return stale data in case a request fails before limit is reached, but not in case the timeout just takes up too much time. Is this intentional? Shouldn't we just return stale data whenever possible in this function?
There was a problem hiding this comment.
Not intentional, fixed: it returns the stale list on timeout too
Stacked on
feat/create-channel./create_channelsuggests tournaments from the EMA calendar (cached for 10 minutes); picking one names the channel like🏆2026-02-kraków-hatsumi-taikai-2026and sets the topic toKraków :: 14-15 lutego 2026 :: <link>. Cities and dates are in Polish, and tournaments sharing a name (e.g. Pumpkin Tiles 2026 in Tbilisi and Yerevan) are listed separately.🤖 Generated with Claude Code