Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

A way to be able to log various actions like message edits #274

Open
IAmJSD opened this issue Mar 18, 2020 · 7 comments
Open

A way to be able to log various actions like message edits #274

IAmJSD opened this issue Mar 18, 2020 · 7 comments

Comments

@IAmJSD
Copy link
Contributor

IAmJSD commented Mar 18, 2020

Is your feature request related to a problem? Please describe.
We want to be able to log things such as message edits, nickname changes, etc. To do that, we will need a way to be able to track changes.

Describe the solution you'd like
Ideally, the inclusion of a Before attribute in payloads would allow for this to be done easier.

Describe alternatives you've considered - optional

  • Possibly a custom flag to include the before payload?
  • Possibly a special handler that can be toggled for this?
@andersfylling
Copy link
Owner

That would be beneficial indeed. However, it also becomes a question about logging messages and for how long?

@andersfylling
Copy link
Owner

Or do you mean updates of any objects?

@jacquesamsel
Copy link

jacquesamsel commented Mar 19, 2020

That would be beneficial indeed. However, it also becomes a question about logging messages and for how long?

Something that I've seen implemented in some other libraries is a value which can be set to indicate exactly how many messages to log. Either disgord could implement this as a size value (bytes) or message count. I personally prefer the size method, but that may be more difficult to implement.

@andersfylling
Copy link
Owner

andersfylling commented Mar 19, 2020 via email

@Kelwing
Copy link
Contributor

Kelwing commented Mar 30, 2020

@andersfylling, I'm working on the same project as Jake, so I can expound upon the needs here. We don't need the lib to help us log messages or anything, we're looking for a way to detect what changed in an update event. The best way to do this is to have a snapshot of what the member, channel, guild, or message looked like before the cache update along with the new update event payload.

@andersfylling
Copy link
Owner

I'm thinking that maybe adding a new function signature for this would allow disgord to figure out whether or not this is needed. As I don't see a way to introduce more overhead and memory use, and eventually slow down the through put.

E.g. the new func signature is not required and won't cause existing projects to break:
func(s Session, snapshot *MessageCreate, evt *MessageCreate).

I might just create "Snapshot" structs to make it more obvious. Who knows. Currently I'm somewhat busy as I have 2-3 months left of my masters degree.

@andersfylling
Copy link
Owner

This should be easy to implement with the new cache.

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

No branches or pull requests

4 participants