Comments (7)
If it is to be done correctly, I need to make a change to the backend aswell to get a proper Query where I fetch the user's points + user's current ranking in the leaderboard.
from odin-bot-v2.
Could anyone have a look at this from @TheOdinProject/odin-bot :) ?
from odin-bot-v2.
As I mentioned here: #366 I think we should consider removing this legacy command and replace it with a slash command if we proceed with having the user point retrieval as an option.
We have decided to keep a few legacy commands that are often used in sentences like this:
It would be best if you use the !question template
or
Below you will find some ways to share your !code
or
we don't support !windows
the below bot output should give you more information on how you can proceed
One of the good things about the slash commands is that they show up when entering a slash in the server, which is a great improvement compared to the old commands which people find out about when others use them or from scouring the bot repo.
I'd love to hear if other maintainers have some more feedback on the issue in particular. Perhaps there's a reason it's not working, or a deliberate decision made on it in the past. I've never seen that command in use to be honest.
from odin-bot-v2.
I'm quite confident that it's not working because this particular command is very old and something about either the discord API, or the points-API changed.
it predates discord allowing us to do slash commands, which is the reason it's a legacy one. I approve of fixing it and transitioning it to a slash command
from odin-bot-v2.
@KevinMulhern @01zulfi I would like your opinions on this since it can potentially be an expansion of previous discussions with the API we had about fetching data. I can confirm the problem is not related to the API but the bot itself is calling a function with wrong parameters. A simple fix to the bot would fix the problem but it will only allow it to fetch the user's points which is not that powerful since all users can already see their points when anyone gives them a ++.
There are 3 approaches to the problem:
-
The first is I use the
/api/points
to fetch all the user's data and filter them in the bot to display the user's Rank + Points. The problem with this approach is that whenever the changes to/api/points
ship, which limits the data received, the bot will break. Another problem is that the endpoint/api/points/{discord_id}
will have no reason to exist and will just be dead code in the backend. -
The second is to update the backend with a query that fetches the user's Rank in the leaderboard in addition to their points and returns it back to the calling request, here is what I came up with https://github.com/Mclilzee/theodinproject/blob/points-ranking/app/controllers/api/points_controller.rb#L9C3-L18C6
-
The third approach is just to fix the command to only show the user's current points. The problem with this approach is we need a better name for the command, as slash command
/rank
does not make sense anymore because there is no ranking involved. we could keep it as!points
but that will be a clarity conflict with the new slash command/points
from odin-bot-v2.
Thanks for detailed write-up @Mclilzee
Haven't had the chance to think things through, but here's my gut instinct.
- We should definitely create & use
/api/points/{discord_id}
- We could leverage subcommands
/points about
for general info on commands/points rank
for user's points
OR we could look at updating theleaderboard
command somehow so user can get their own points easily as well
from odin-bot-v2.
@01zulfi I like the idea of subcommands very much.
I think the best subcommand would be for leaderboard, I'm updating the leaderboard command to be a slash command as well since it going to be related.
My PR will be done shortly, then we can discuss further changes in there.
from odin-bot-v2.
Related Issues (20)
- Channel that includes messages that have been bookmarked a certain number of times HOT 5
- spam ban app menu command: add right-click App context menu command for spam HOT 1
- Repo: Add .prettierrc HOT 2
- Slash commands: Group several similar commands into single commands HOT 5
- /typescript command HOT 3
- /replaced: new command for answering AI tools taking jobs HOT 3
- Wiki page Commands contains outdated info HOT 3
- /knowledge: A new command HOT 5
- OS: Add link to list of reasons why TOP doesn't support Windows? HOT 4
- Deduplicate command info between old and new style commands HOT 2
- All relevant commands: Replace hardcoded ID's with ID's from config.js where possible HOT 2
- CircleCI: Add a test to run prettier HOT 6
- Enhancement - Document .env configuration and pre-requisite installs HOT 3
- Abstract out isAdmin check to new utility in /utils HOT 1
- Bug - points command: Symbols aren't escaped HOT 13
- Feature: Add dev token for points HOT 2
- Feature: Allow Channel ID's to be overridden via `.env` HOT 1
- /ai Language about The Odin Project discord Not being a place to double check ChatGPT output HOT 3
- Feature: Autopost certain issues to #contribution-opportunities HOT 1
- Feat: Replace issue templates with issue forms HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from odin-bot-v2.