Feature request: ping @XHBr near battle start, not upon beghasting
BotB Academy Bug Reports and Feature Requests
 
 
155001
Level 24 Chipist
ipi
 
 
 
post #155001 :: 2022.04.14 2:18pm
  
  amelia, kalii, YQN, Lincent, wizardmusic, Corell, MelonadeM, sean, Thingerthing, Xaser, Vaneckuss, nitrofurano and damifortune liēkd this
The @XHBr role on Discord is nice, but a bit useless when you can beghast compos that start several days later. I can browse the site and find scheduled ones that I'm interested in, but I often forget about them afterwards - I'm very busy these days! It'd be nice if the ping alerted you to a XHB that was about to begin rather than when one is created, so I could join in if I have some spare time.

I think pinging 15 minutes before the start of an XHB seems like a good balance between sticking in short-term memory and giving you time to wrap up whatever else you're doing.

The bot message that's sent whenever an XHB is beghasted can stay, but it shouldn't ping the role. And obviously, if an XHB is set to start in less than 15 minutes it should ping immediately.
 
 
155058
Level 23 Chipist
MelonadeM
 
 
 
post #155058 :: 2022.04.16 3:05am
yea i agree with this lol
 
 
155065
Level 29 Hostist
puke7
 
 
 
post #155065 :: 2022.04.16 7:34am
  
  MelonadeM and Thingerthing liēkd this
I've been trying to remember where the project left off.

The BotB IRC Bot is open source:
https://github.com/langel/botb_irc_bot

iirc advancing node beyond v10 breaks the irc module it uses. Or maybe a more recent version breaks other things. I really can't remember. There was a time, several years ago, where there were multiple contributors to the bot, but then something happened. Regardless, if I had a couple days to spare, I could probably get it updated and implement this feature. Anyone else is welcome to try!
 
 
155080
Level 28 Mixist
argarak
 
 
 
post #155080 :: 2022.04.16 12:50pm :: edit 2022.04.16 12:50pm
  
  puke7 and MelonadeM liēkd this
so here's an implementation idea if this was to be done bot-side rather than sending the right POSTs to the bot server. it would be a bit of a bodge implementation because it would rely purely on the initial "battle has beghasted" message from the botb server:

1. hook into the say command (in http_server.js) and detect when a XHB has began by reading the server input
2. get XHB information from the API, specifically the start time (which i believe is in US pacific time?). this will need to be done on bot start up as well
3. calculate the amount of time between now and 15 minutes before XHB start and use setTimeout
4. setTimeout executes and pings XHBr role with an appropriately formatted message

i should be able to implement this if it sounds like a good idea, would only need to figure out some script to send the right POST data to simulate an XHB starting
 
 
155102
Level 29 Hostist
puke7
 
 
 
post #155102 :: 2022.04.16 8:30pm
  
  MelonadeM, argarak and Xaser liēkd this
Here is the API with battle infos:
https://battleofthebits.com/api/v1/battle/current

Yes, the timedate strings are American Pacific timezone based. But.
The battle object data returned from the API includes a `period_end_seconds` property. If `period` == 'warmup' then the battle will begin in `period_end_seconds` seconds. Similarly, if `period` == 'entry' then `period_end_seconds` is a countdown to the end of the entry period. If the `type` property is 3 then it's an XHB.

Here's my view of/from two different scopes of solution.

Minimal Fuss:
Pretty much what you described. If we scrape the battle_id out of data from the POST then we can do a one time call to the API per battle announced with:
https://battleofthebits.com/api/v1/battle/load/{battle_id}

Maximal Potential:
I know this thread is originally about pinging folks 15 minutes before a battle rather than at the moment of beghasting, but I'd like to share memories of the original bots behaviour. Actually, I dug up Strobe's old bot's mIRC script to get a source of truth.

/msg %announcechannel 4,1 [TEST OHC] OHC Started!!! g0g0g0g0g0! http://battleofthebits.com/ohc.php
/msg %announcechannel 4 30 Minutes Left @ OHB !!! =o !!!
/msg %announcechannel 4 10 Minutes Left @ OHB !!! =o !!!
/msg %announcechannel 4 2 Minutes Left @ OHB !!! I suggest you R teh uploading !!!!
/msg %announcechannel 4Yer OHB time is teh up. slackerz.

Looks like we got a bot message when the battle started. Then warnings at 30, 10, and 2 minutes left of the entry period. Then a final snarky message about the entry period being over.
Obviously, OHB should be replace with XHB (unless I add that OHB/2HB/4HB property to the api battle data (which would be trivial)), but should it say the title of the battle too?
It could be fun to be like speedrunslive.com's irc bot and do messages at more intervals like 30, 15, 10, 5, 4, 3, 2, 1 seconds left of warmup and/or entry period.

OH WAIT BUT THE MAXIMAL POTENTIAL REALLY:
The bot should poll the current battle api endpoint every 5 minutes. This would include terminating all setTimeouts and setting new ones according to the data returned from the api. This solution offers both better concurrency and an ability to pivot should an XHB's start time be edited/changed/updated.
 
 
155105
Level 31 Chipist
kleeder
 
 
 
post #155105 :: 2022.04.16 11:29pm
  
  null1024, damifortune and MelonadeM liēkd this
i admit i miss the old bot-messages at 30,10,2,0 mins left !
 
 
155111
Level 23 Chipist
MelonadeM
 
 
 
post #155111 :: 2022.04.17 5:42am
  
  nitrofurano and damifortune liēkd this
tbh if i do an ohc, i'm invested in my song and usually dont rlly pay attention to alerts saying 30 mins left or whatever, but i can see them being helpful to others so yae thumb';s up
 
 
155131
Level 28 Chipist
BubblegumOctopus
 
 
 
post #155131 :: 2022.04.17 1:42pm :: edit 2022.04.17 1:44pm
  
  damifortune liēkd this
unrelated, but since it came up up in the thread as an aside: I feel like I've seen people talk about botb's clock with confusion a lot the past three days and a thought I've frequently had returned to me:
"huh, people wouldn't be as confused about communicating time if there was a clock on the page displaying the BotBST time zone"

Anyway, intended reply:

I think a two ping system for the @XHBr rank would be best for participation.

Speaking for myself, I like knowing when the battle is beghasted because I have to plan "do battol" into my schedule ahead of time and the notification ensures I don't miss my chance to do so. I suspect I'm not alone in this.
Of course, on the flip side there seems to be plenty of 15 minute ping support and people hopping in to the chat to do !ohb command and then being sad they're too late is a common occurrence. Ostensibly those both mean a second ping would benefit participation numbers.

Personally, unless I'm in the extreme minority with liking the beghast ping I'd rather just accommodate everyone and deal with having two pings for any battle hosted more than 15 minutes out.
 
 
155137
Level 31 Chipist
damifortune
 
 
 
post #155137 :: 2022.04.17 5:01pm
  
  BubblegumOctopus liēkd this
i agree with BGO's reasoning regarding two pings, both seem relevant to making sure you won't miss a thing you want to participate in
 
 
155172
Level 28 Mixist
argarak
 
 
 
post #155172 :: 2022.04.19 3:46am
  
  Savestate and puke7 liēkd this
i wrote some implementation of this and it has been pulled and merged into the irc bot \o/
https://github.com/langel/botb_irc_bot/pull/89

probably some quirks along the way but we'll deal with them... maybe. drop by irc before an xhb starts to see the new messages!
 
 

LOGIN or REGISTER to add your own comments!