Repository navigation
Listening party tracking - #3
Conversation
| const LP_ROLES: &'static [u64] = &[ | ||
| 1198354637137391709, // `@Listening Party`` in test guild | ||
| // TODO: Make this configurable? Fetch via name? | ||
| ]; |
There was a problem hiding this comment.
The Lp module in serenity-command-handler defines a role_id guild field, could use that for consistency (it can be defined here too without risk of conflicts)
There was a problem hiding this comment.
I was thinking about this - the roles should ideally work both in test instances and on the deployed instance, perhaps they should be fetched by name when we connect to the guild, if that's possible?
There was a problem hiding this comment.
The way I've come up with now is to keep taking the role ID from the message (essentially free since they are provided by serenity anyway) and dynamically resolve them to their name via to_role_cached. This should be "cheap enough" since the request is cached and it only happens on role mentions.
There was a problem hiding this comment.
Hmm, maybe it should get the role from this: https://github.com/etwyniel/discord_framework/blob/f26138393edb495b7d951129f13cd04350a86c5a/serenity-command-handler/src/modules/lp.rs#L349-L376
However, this only seems to be a single role for listening parties that the LP module uses to ping.
|
|
||
| let conn = Connection::open("humble_ledger.sqlite")?; | ||
| let polls = ModPoll::new("✅", "❎", "▶️", None, "<a:crabrave:996854529742094417>"); | ||
| let polls = ModPoll::new("✅", "❎", "▶️", None, "<a:crabrave:996854529742094417>", lp.clone() ); |
There was a problem hiding this comment.
I wonder if we could implement some kind of event system in Handler, instead of explicitly connecting modules.
There was a problem hiding this comment.
Yes, this is the big ugly. I just hacked together the dumbest thing I could think of to make it work.
There was a problem hiding this comment.
I've implemented this now, and it relies on etwyniel/discord_framework#2
* include tracks started timestamp
|
I've rebased this PR so it doesn't pull in the changes from #2 |
I've opened a PR to track the development of this
This draft is not done, please do not merge.This should now be mergeable