Open ShakyaMajumdar opened 3 years ago
seems good to me :+1:
but are you storing the challenges manually?
No; there's a function which I call to update the database of stored challenges.
We could just loop this to be called at specified time intervals automatically
I had also wanted to include some way to test submissions from users, but unfortunately I couldn't think of any way to extract sample input and output from the API response and all katas don't have examples any way.
So have you like stored every single challenge there is in a db, and can update with a command, wont that be slow as there are like so many katas? though if we use asyncpg with postgres i think it wouldnt be that slow, if asyncpg doesn't lie about its speed
I extracted the latest 30 katas everytime I ran !update_kata_db
, so I guess considering overlaps there are around 100 katas atm.
I don't think that's so large as to cause performance issues
Ah alright, seems like a good idea to me, though we would have to wait till we get a db setup
Fair enough
Maybe json could be a temporary solution?
In that case I might have to put aside my hatred for the format for the time being lol
no no no no not json :no_good:
well that's good news I think any other ideas or do we put this on hold till the db gets set up?
i think we will have to wait for the db :((
sure, no probs. I'll keep my eyes open on #93 then.
You can except the DB pr by next week, a lil busy with a hackathon this weekend
@ShakyaMajumdar would you like to start working on this?
I think this could be a fun feature; if someone invokes a command like
!kata
the bot sends a random kata from a db.I have made a bare-bones implementation as a personal project, you could check it out at https://github.com/ShakyaMajumdar/KataBot/blob/master/bot/exts/challenges.py.
This what it looks like currently:![image](https://user-images.githubusercontent.com/69471777/109335375-f3bb7980-7887-11eb-8304-e57fadb82cb0.png)