Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Feature Idea: Command to send random, small programming challenges from codewars.com #94

Open
ShakyaMajumdar opened this issue Feb 26, 2021 · 14 comments

Comments

@ShakyaMajumdar
Copy link
Contributor

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

@v1nam
Copy link
Contributor

v1nam commented Feb 26, 2021

seems good to me 👍

@v1nam
Copy link
Contributor

v1nam commented Feb 26, 2021

but are you storing the challenges manually?

@ShakyaMajumdar
Copy link
Contributor Author

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

@ShakyaMajumdar
Copy link
Contributor Author

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.

@v1nam
Copy link
Contributor

v1nam commented Feb 26, 2021

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

@ShakyaMajumdar
Copy link
Contributor Author

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

@v1nam
Copy link
Contributor

v1nam commented Feb 26, 2021

Ah alright, seems like a good idea to me, though we would have to wait till we get a db setup

@ShakyaMajumdar
Copy link
Contributor Author

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

@v1nam
Copy link
Contributor

v1nam commented Feb 26, 2021

no no no no not json 🙅

@ShakyaMajumdar
Copy link
Contributor Author

well that's good news I think
any other ideas or do we put this on hold till the db gets set up?

@v1nam
Copy link
Contributor

v1nam commented Feb 26, 2021

i think we will have to wait for the db :((

@ShakyaMajumdar
Copy link
Contributor Author

sure, no probs.
I'll keep my eyes open on #93 then.

@RohanJnr
Copy link
Member

You can except the DB pr by next week, a lil busy with a hackathon this weekend

@Arnav-2004
Copy link
Contributor

@ShakyaMajumdar would you like to start working on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants