Coder Social home page Coder Social logo

Comments (15)

Southclaws avatar Southclaws commented on August 21, 2024 1

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.

Ahmad45123 avatar Ahmad45123 commented on August 21, 2024 1

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.

Southclaws avatar Southclaws commented on August 21, 2024 1

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.

WopsS avatar WopsS commented on August 21, 2024

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.

Southclaws avatar Southclaws commented on August 21, 2024

Yep, that sounds perfect!

from cj.

Crayder avatar Crayder commented on August 21, 2024
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.

Ahmad45123 avatar Ahmad45123 commented on August 21, 2024

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.

Southclaws avatar Southclaws commented on August 21, 2024

It should be visible from the user profile page, in the "mini stats" box if I remember correctly.

from cj.

Ahmad45123 avatar Ahmad45123 commented on August 21, 2024

It doesn't.. There is only that green icon that shows rep amount.. rep rep rep

from cj.

Southclaws avatar Southclaws commented on August 21, 2024

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.

Crayder avatar Crayder commented on August 21, 2024

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.

Ahmad45123 avatar Ahmad45123 commented on August 21, 2024

Command should be in pm or general channel ?
And also @Crayder there is no a last activity thing, but only current activity...

from cj.

Southclaws avatar Southclaws commented on August 21, 2024

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.

WopsS avatar WopsS commented on August 21, 2024

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.

Crayder avatar Crayder commented on August 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.