I mean, you do expect this username to be deleted anyway, right. False if the user does exist and the operation failed for some reason. Though depends on the use-case
The function seems to grow too big too huge. Instead of piling every action in one file response.py
, splitting every do_* into separate files could help. The file will be very heavy on a lot of unrelated to each other changes, hence every function belongs to a separate "domain", that could be expressed by splitting
it'd be more readable if you unpacked the array into variables that have names. is_float(arguments[2]))
is too low-level if you are not someone who wrote this function.
Oh, you already do have the mapping! now just move the functions away to their own separate places, to unload the file
What I would have proposed is already proposed by VD, nice.
My additional nit
In players "idle" time (meaning time outside of duels) let players build a deck. Since we don't have complex…
Idk why it's in "request changes", all good here, it's just an observation
You are doing neat tuple unpacking at response.py, but here you don't. Would be cool to unify your approach and do the same with response
object here! The intention would be a lot clearer
I understand the intent, but you have to put an unchecked box in your head, that now you bot_app.py
is VERY heavily depending on Misskey notification notations and API. If you still want to aggregate all Misskey specifics to one place, this move makes it a bit harder for the future.
cool, @waifu if you do that, you can combine with waifu/kemoverse#3 that's literally related
and yes, as you said, you can alternatively move everything to a function, so it will be
notifications = client.i_notifications()
process_notifications(notifications)
time.sleep(5)
…
You don't even need more functions, just consider the starting point:
- The whole
while true
is entirely wrapped into one hugeif notifications:
. So you can safely invert it, and just…