Comments (15)
I don't think we need a Discord username (the user already knows this from typing the command), online status or some of the activity stuff.
I'd actually like to keep this minimal - even though there will be usage limiting to prevent spam, it's not really good practice to have commands post paragraphs of text. I say we post the info in a single paragraph but separate keys
from values
using formatting:
Forum name: [HLF]Southclaw Member since: 2009 Reputation: 1500 etc: etc...
Regarding the activity/date stuff: For one thing, most of the discord join dates are going to be early 2017, when this server opened. The forum join date is probably the more interesting one to users. Discord activity could be useful if a user disappears for a while, depends if the API exposes this value as I'd rather not introduce more state tracking to the bot. Last forum activity can be scraped but is it really necessary? Use cases?
from cj.
That hash will be different everytime the user posts and not when rep changes.
I think just adding a cooldown or something to make it only accept new request after previous is done would be good.
from cj.
The codebase has a cache available at app.cache
, it uses patrickmn/go-cache and supports expiry.
So just store the user profile object or data in a cache keyed by the ID/URL/Username and only do lookups if the cache lookup doesn't hit.
from cj.
What do you say about /userinfo for this command?
We can use some parameters, like general (will include post count, reputation, posts-per-day), visitor_messages, what do you say?
from cj.
Yep, that sounds perfect!
from cj.
Discord Name: bleh
Forum Name: bleh
Online: (green, yellow, red)
Forum Join Date:
Discord Join Date:
Last Discord Activity (time and channel): bleh
Last Forum Activity (time and the last "Current Activity"): bleh
Total Posts: bleh
Reputation:
etc
from cj.
I've added scraping for TotalPosts, LastActive and JoinDate... Reputation is remaining though which I don't know where should I get it from. I need to goto any of user's posts to get it or any other solution ?
https://github.com/JohnyMac/cj/commit/406486116d894e2d59955ff664dbe17c261930b3
from cj.
It should be visible from the user profile page, in the "mini stats" box if I remember correctly.
from cj.
It doesn't.. There is only that green icon that shows rep amount..
from cj.
Yeah, that's odd, everything else is exposed via the user page! I suppose you'll need to use http://forum.sa-mp.com/search.php?do=finduser&u=USER_ID
, grab the first page and look at the post div and grab the reputation points from there - that's the only way I can think of doing it unless there's another area where reputation is stored.
from cj.
I don't think we need a Discord username (the user already knows this from typing the command), online status or some of the activity stuff.
- Discord username: People can have multiple names. Like khanz for example, his real Discord name is aymel (not talking about his forum name). We should show this.
- Online status: Agreed, not needed.
- Activity stuff: I think both, forum and discord activity would be useful.
As I suggested to @johnymac, maybe we should separate the discord/forum data.
/info <user>
Name(s): (and aka's, see below)
Join Date: (date joined Discord)
Last Activity: ("time in #channel" or "Online in #channel")
/forum <user>
Name: (current forum name)
Join Date:
Last Activity: (time and the last "Current Activity" from the forum... ex. [was viewing Bleh Bleh Bleh on data/time])
Posts:
Reputation:
Also, when you PM people with multiple names you can see their alternative names at the top, is it possible to get these AKA's through the API?
from cj.
Command should be in pm or general channel ?
And also @Crayder there is no a last activity thing, but only current activity...
from cj.
I say general, but with rate-limiting and a minimal line-footprint (see my earlier post).
We could add a separate command for listing Discord names: /aliases
or it could be integrated into this one.
from cj.
An idea for this command is to store reputation in a database field and a MD5 hash for page http://forum.sa-mp.com/search.php?do=finduser&u=ID and every time when a user execute this command the bot should compare the MD5 or the user will wait a little bit for the bot to query 2 pages.
from cj.
And also @Crayder there is no a last activity thing, but only current activity...
Yes, like I literally said, it's called "Current Activity" on the forum. It's only available when the user is active on the forum. So we will only show that line if the user is online on the forum. And yes, CJ should call it "Last Activity" since it's sent in a message that isn't current after it's sent.
from cj.
Related Issues (20)
- /stats command uses deprecated API link HOT 1
- let /rep take more than 1 emoji HOT 1
- A /mytop command to show user's rank.
- change /stats to something funny HOT 2
- add @coool9 as contributor HOT 1
- Support slash-commands HOT 1
- Dependabot can't resolve your Go dependency files HOT 1
- Dependabot can't resolve your Go dependency files
- Dependabot can't resolve your Go dependency files
- Dependabot can't resolve your Go dependency files HOT 1
- Dependabot can't resolve your Go dependency files
- add antispam features
- Show emoji in /toprep if no results found and an emoji parameter was passed
- /postcode command HOT 2
- Deploy credentials are expired/invalid HOT 1
- /changelog command to show recent changes
- Ability to download one's messages stored in cj's database
- Don't save bot messages.
- Don't show the commands that can't be used in the list
- /rep command doesn't work
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 cj.