FuelRats / pipsqueak

ED Fuel rats IRC bot
Other
13 stars 14 forks source link

Maybe added reference system functionality to tweetcase #214

Closed andybish closed 7 years ago

andybish commented 7 years ago

Might not work though, I'm not good with python. In particular, I'm not sure how the db parameter is passed to cmd_tweetc, so refsystem might need to go after it instead of before. Also, I'm not sure how parameterize works, but it'll probably need to be changed to reflect the new optional syntax.

andybish commented 7 years ago

Redone, it now uses db.query to check for the rescue system, and reference system, before passing through to get_tweet_for_case. If the rescue system isn't in the db, but reference system is, it overwrites rescue.system.

andybish commented 7 years ago

EDIT: Ok, parameterize is fixed I think, sorry about that, totally missed where it was being imported from. But because system names can include spaces, it has to be 'rt'. Will that interfere with the db being passed into it?

I didn't think changing rescue.system within the function would actually overwrite it on the board, if it does, sorry. But if that's the case, then I'd just go back to my first solution, which passes refsystem into get_tweet_for_case. I don't see a way to do this without doing one of those 2 things.

And the reference system would be when the case's system is correct, but not in EDDB, a nearby system that is in EDDB can be given as the reference to have the tweet provide a landmark and distance, instead of just "rats needed".