tdmalone / working-plusplus

Like plusplus.chat, but one that actually works, because you can host it yourself 😉
MIT License
23 stars 41 forks source link

Ability to reset leaderboard #4

Open azzronulation opened 6 years ago

azzronulation commented 6 years ago

We'd love an option to reset the leaderboard, like PlusPlus, you DM the bot "leaderboard reset" and it wipes the slate clean.

Also, a silly question as I'm a bit new when it comes to stuff like this, but how would one make sure the Heroku is updated with the latest version?

tdmalone commented 6 years ago

Hi Aaron, thanks for dropping by and for using the app!

Good idea - one issue would be allowing anyone to potentially reset the leaderboard, which is probably not ideal. I might be able to get the user ID from the Slack API of the person who installed the app; would it be suitable then for you if only that user could reset the leaderboard?

In the meantime, you can reset it through Heroku by removing the Postgres addon and re-adding it - essentially dropping the data and starting fresh.

Regarding updates, that’s a good question - I’ve got mine directly authed to my GitHub account which obviously isn’t suitable for anyone else, and I’ve been meaning to look into what others do for this. I’ll create a separate issue for looking into it.

Thanks again for the feedback - it’s nice to know this little project is useful for others too!

azzronulation commented 6 years ago

Hey Tim,

Yeah, I believe that's how PlusPlus handles it (by having the person who installed it as the only user who can reset the leaderboard). So yeah, that'd be suitable.

I'll try and figure out how to remove the Postgres addon, hopefully it's pretty simple. I'm pretty new to Heroku having only used it for one other thing. I'd love to be able to dig in and mess around with the leaderboard theme files (as I'm more familiar with HTML/CSS), I just need to work out how... haha.

Happy to help, believe me, we've been frustrated with PlusPlus for too long, it's just so inconsistent. As soon as we installed this, it was all fun again!

tdmalone commented 6 years ago

we've been frustrated with PlusPlus for too long, it's just so inconsistent. As soon as we installed this, it was all fun again!

That’s exactly why I created this haha! How did you come across this repo by the way? Was it just searching for PlusPlus alternatives?

I'd love to be able to dig in and mess around with the leaderboard theme files (as I'm more familiar with HTML/CSS), I just need to work out how... haha.

You’re more than welcome to fork this repo and edit the theme files to make them better, then submit a pull request back. If you haven’t done this before I’d be happy to step you through the process.

I’m not much of a frontend person so there’s a lot better the HTML leaderboard could be ;)

I'll try and figure out how to remove the Postgres addon, hopefully it's pretty simple.

It is - I’m on mobile at the moment so can’t easily get proper screenshots, but if you log in to the Heroku web interface, go to your app and then to the Addons section, it should be fairly straightforward. After re-adding Heroku Postgres again, the app will simply pick up that the database is empty and will re-create the necessary tables (just like it does at first install).

I’ll have a look into the leaderboard reset command.

azzronulation commented 6 years ago

Hey Tim,

That’s exactly why I created this haha! How did you come across this repo by the way? Was it just searching for PlusPlus alternatives?

I wish it were that simple. Searching for alternatives came up with nothing but apps which charge premium after a trial (Karma Bot, HeyTaco, etc. etc.) I actually came across this looking for how to create Slack bots w/ Heroku (as I used Heroku previously for a Twitter bot I have). And surprisingly yours was exactly what I was looking for so I didn't have to do much of the leg work, so thank you for that ;)

You’re more than welcome to fork this repo and edit the theme files to make them better, then submit a pull request back. If you haven’t done this before I’d be happy to step you through the process.

I'll definitely take a look at that this weekend!