Giter Site home page Giter Site logo

chylex / discord-history-tracker Goto Github PK

View Code? Open in Web Editor NEW
441.0 20.0 80.0 14.83 MB

Desktop app & browser script that saves Discord chat history into a file, and an offline viewer that displays the file.

Home Page: https://dht.chylex.com

License: MIT License

Python 1.23% HTML 0.94% JavaScript 18.13% CSS 3.13% Batchfile 0.15% C# 70.85% Shell 0.15% PHP 5.41%
discord app csharp desktop

discord-history-tracker's Introduction

Welcome

For instructions on how to use Discord History Tracker, visit the official website.

To report an issue or suggestion, first please see the issues page and make sure someone else hasn't already created a similar issue report. If you do find an existing issue, comment on it or add a reaction. Otherwise, either click New Issue, or contact me via email [email protected] or Twitter @chylexmc.

If you are interested in building from source code, continue reading the build instructions below.

This branch is dedicated to the Discord History Tracker desktop app. If you are looking for the older browser-only version, visit the master-browser-only branch.

Build Instructions

Setup

Fork the repository and clone it to your computer (if you've never used git, you can download the GitHub Desktop client to get started quickly).

Folder organization:

  • app/ contains a Visual Studio solution for the desktop app
  • web/ contains source code of the official website, which can be used as a template when making your own website

To start editing source code for the desktop app, install the .NET 8 SDK, and then open app/DiscordHistoryTracker.sln in Visual Studio or Rider.

Building

To build a Debug version of the desktop app, there are no additional requirements.

To build a Release version of the desktop app, follow the instructions for your operating system.

Release – Windows (64-bit)

  1. Install Powershell 5 or newer (on Windows 10, the included version of Powershell should be enough)

Run the app/build.bat script, and read the Distribution section below.

Release – Other Operating Systems

  1. Install the zip package from your repository

Run the app/build.sh script, and read the Distribution section below.

Distribution

The mentioned build scripts will prepare Release builds ready for distribution. Once the script finishes, the app/bin folder will contain self-contained executables for each major operating system, and a portable version that works on all other systems but requires .NET 8 to be installed.

Note that when building on Windows, the generated .zip files for Linux and Mac will not have correct file permissions, so it will not be possible to run them by double-clicking the executable. Since .NET 8 fixed several issues with publishing Windows executables on Linux, I recommend using Linux to build the app for all operating systems.

discord-history-tracker's People

Contributors

chupalika avatar chylex avatar denetii avatar excinera avatar jahands avatar lynxy avatar matojeje avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

discord-history-tracker's Issues

"Go to next channel" functionality stops on group boundaries

In the setup, I have told DHT to go to the next channel when it reaches the last message. This option works entirely correctly when the server does not have channel groups. However, when the server does have channel groups, DHT stops at the end of the last channel in the channel group, even when there are other groups with channels which have not been downloaded.

List of users

It would be a nice addition if a live "snapshot" of all the users in the Discord server could be taken, perhaps including their profile images. Some users don't speak and it would be useful to see who was in the server at the time, and perhaps their status/rich presence/offline or not.

Thanks

Basic feature list

Tracker

  • Ajax hooks
  • Message saving
    • Caching last request when not tracking
    • Warning message about reloading page after 2+ requests
  • Metadata saving
    • (user names)
    • (tracked channels and servers)
  • Old database upload
  • Settings GUI
    • Autoscroll
      • Autoswitch channels or DM users
        • (after hitting first message)
        • (after hitting last saved entry)

Renderer

  • Database upload
  • Channel listing
  • Message rendering
    • Basic message layout
    • Link and mention formatting
    • Image rendering
    • Customizable pagination

Pause tracking after reaching end of a Category

Earlier versions of this app would stop after reaching the end of a Category. Right now, Tracking is continuing on to the next Category, until all Categories on the server are tracked.

Adding another group of radio-buttons with the title "After reaching the end of a Category..." in Settings menu would solve this problem, and gave users a choice.

Btw, thanks for the app, it's a life saver! Great work!

Viewer: Specify the file to load automatically

I'd like to host our archive of an old server and the viewer on a secure web server, so it would be nice to have the ability to automatically load the archive when the viewer loads instead of having to load a local file each time.

The possibility of a downloadable viewer program

Out of curiosity, what would be the possibility of the viewer for the history tracker becoming a program on its own that can be downloaded and used without a browser? I'm asking because I much prefer loading a text file of Discord history on a downloaded program rather than on a web browser.

Broken due to Discord update

Discord seems to have updated the entire chat layout recently, breaking this script (and other things unrelated to it) in the process.

Suggestion: look up messages from certain users

This would be a cool feature :)

edit: oh, it's possible to look up messages from certain users in the viewer, but is it possible to download all of it in a nice, readable format? it's a hassle to highlight, copy and paste it after each page.

Incremental saving would be nice.

I love this thing, but I've had to restart my archive 2 or 3 times on Chrome now just because I left it overnight on a big server and it keeps crashing.

Would it be possible to store the data in a cookie or something even before it's been downloaded?

Make DHT work inside Discord app & add persistence

  • Make sure the script works in Discord's dev tools
  • Store last script settings in local storage for both Discord and browsers
  • Add a way to exit the script UI and delete the script from memory when done

User IDs unmatched after uploading/combining multiple logs with different channels into a single file.

One channel:
ImageWoot

After combining:
ImageWoot

I'm not sure if this is an actual problem with the final file or just a viewer bug. It doesn't seem to affect messages from the first dataset uploaded, but consistently shows up in the rest of the channels.

However, it doesn't affect every single message from every user in every channel. The last page or so in some (not all) of the channels still seem display properly, and sometimes only certain usernames are affected.

Example of a cut-off point where it affects one message but not the next one from the same user:
ImageWoot
ImageWoot

In the above example, the change in displayed username also corresponds to a change in the "u" index saved for the messages in the dht file, so it's not just a display error from the viewer. The first, incorrectly identified message is labelled with "u":0, while the second, correctly labelled message is identified with "u":19. The original file identified the user with a value of "u":0; however, I believe this is coincidental as the issue affects more than one user at once, and another message I checked had its user changed from "u":2 to "u":5, which rendered incorrectly.

I have not been able to identify whether the incorrectly tagged messages have "u" values that would be equivalent to the correct user in any of the other files that were combined into a single record.

Changing username replaces them with only your username

If another Discord user changes their Discord username (not server nickname) to something else while their old one was still saved in the same log file, the name of the user that changed their username will be replaced by yours.
Also, it seems some channels won't be affected by this if they never posted in there before until after they changed their username.

I'm not sure what happens if you change your own Discord username, as I never have before, but I'd imagine it would have a similar effect or would just update your username in the log like you would expect it to.

I looked through the log file that I had saved using DHT, but I couldn't find anything too obvious that could be causing this.

The selected channel is not visible in the channel list.

I'm receiving this error when trying to track the Discord DMs of one person in particular. Virtually every other person is working fine. I was previously able to track the DMs with that person, but it stopped working sometime in the past couple of months.

Could you have a look at what's causing the issue? Let me know if you need more information from me to troubleshoot it.

Nothing happens

I don't know if discord had an update to block this script but when I click on bookmark nothing happens.

If I click on bookmark outside of discord app website, it tells discord not found in URL.

Unable to use tracker

I was able to use the tracker two days ago, but now I am unable to. I tried different browsers, and the result was the same in all of them. Whenever I try to start tracking, the following error pops up in my console: d775a0c….js:98 Uncaught TypeError: Cannot read property 'id' of null
at e.s (:1:11257)
at s.i (:1:139)
at XMLHttpRequest.onreadystatechange (:1:7250)
at XMLHttpRequest.r (d775a0c….js:98)
The 'd775a' corresponds to: https://discordapp.com/assets/d775a0cd1a5cf763548a.js

This error pops up as soon as I attempt to start tracking and it stops the entire thing from working, so no messages are tracked for download. However, it will work on private DMs, all of which have been between me and one other user. Any help or fixes would be greatly appreciated, I rely on this tracker very heavily to keep archives of my group chats, which is where I'm seeing this issue. Thanks!

Scrolling will sometimes seem to pause indefinitely without being set to. (Intended Behaviour?)

Using Discord in Chrome, the applet seems to stop scrolling up a channel for any duration of time ranging from a couple seconds to several minutes at a time (or possibly longer).

Manually scrolling up the page or otherwise interacting with user input seems to "jolt" it back into action.

I suspect this may be happening due to the scrolling event being triggered before the client has actually loaded any new content?

Multiple filters

You should add the ability to add multiple filters, such as searching for specific message contents by specific people.

How all merge all channels? what i have to change in the regex...

How all merge all channels? what i have to change in the regex...

Sorry, i'm noob at scripting, tried for hours and didnt work... before compiling and after compiling too..

(its not a issue btw, just me a try harder) if you could give me where to look i could try again..

iFrame API?

Could you maybe implement an iFrame that accepts a server and channel id and gives you an iframe widget?

Support for auto tracking

Will there be support to automatically track new messages without combining and downloading over and over again?

Discord's done it again...

It seems discord has updated something again, causing the tracker to be unable to track messages for download. This time I cannot even track my private messages. If it helps, here's the error the console throws up: e03407fa8b8397b43be8.js:79 Uncaught TypeError: Cannot read property 'props' of undefined
at Object.l (:1:425)
at Object.v (:1:1088)
at o.Z (:1:11543)
at n (:1:10237)
at s.ie (:1:10555)
at HTMLButtonElement.Y.t.M (:1:5008)
at HTMLButtonElement.r (e03407fa8b8397b43be8.js:79)
https://discordapp.com/assets/e03407fa8b8397b43be8.js

This was used in Chrome, but I haven't checked other browsers.

Help: Different kind of export

Hi!
I was using dht to extract chatlogs from discord to put the data into a spreadsheet to do things like this: https://docs.google.com/spreadsheets/d/11vFkOFpvcmVBWtKcYvgRYjYGKNW39lmvjCeVoe6RYk8/edit?usp=sharing

I've been using a simple script to format the JSON file dht gives into this format (separated by tabs):

6/14/2018   1:23:45 PM   0   wooow
6/14/2018   1:23:47 PM   0   this is neat-o
6/14/2018   1:23:50 PM   1   yes
6/14/2018   1:23:55 PM   1   indeed it is

formatter.txt (change to .js)

I've been trying to figure out the tracker script, but it's a bit difficult to read, the least I could do was change around colors to look a little nicer like this:
screen shot 2018-06-18 at 10 41 13 pm
(color modified tracker script https://hastebin.com/raw/rucijaluwi)

Soo I am not super experienced, but I'd like to figure out a way to add a button to the paste-able tracker that could export it this way in one step... I think I could try figuring it out if I had a non-simplified version of the original script, but I don't know where to find that. If anyone could help me, thanks!

More stringent detection of the start of a channel?

Using Discord in Chrome on Linux, the client seems to occasionally display a LOAD MORE MESSAGES button before actually loading new content when you scroll to the top of your browser.

Pressing this button or simply continuing to scroll up will cause new messages to be loaded.

However, if Switch to Next Channel After reaching the first message in a channel is enabled, this applet will simply jump to and start working on the next channel instead. Downloading a whole server thus requires disabling this option, and manually intervening when it reaches the start of a channel instead.

There is a unique banner at the top of every channel that says Welcome to the beginning of the #channel_name channel.. Why not use that for triggering the switch or pause instead?

Not capturing the top 4 messages in DMs

For some reason on DMs it will stop before capturing the top 4 messages. If a DM with a person only has 4 messages (or less) it will skip it entirely.

(Thank you for all your work on this! It's been so helpful.)

The selected channel is not visible in the channel list.

When trying to track DMs, it comes up with a popup that says "The selected channel is not visible in the channel list." Tracking channels on servers works just fine still, but no DMs will work. It wasn't doing that on Tuesday so it might have been one of the recent discord updates that caused it.

(thank you for your time, I love this tool!)

A possible desktop application version?

I was wondering, if it was possible, if you would create a version of this for those who use the Discord desktop app at some point. The program you've created is great however I - along with others - tend to not use the web browser version of Discord much but we do use the desktop application (mostly due to the fact that it is far more easy to use the desktop app than web browser for us) instead which means that I can not use it as much as I hoped.

Statistics

Global + per-channel statistics.

  • UI
    • Toggle button that switches between message & statistics view
    • 'Global Statistics' section in channel list
  • Calculations
    • Total messages (overall and per user)
    • Total characters (overall and per user)

Output Issue

Is it supposed to end up like this because I've tried multiple different things and it always comes out like this. If it is how it's supposed to turn out then how can i make it like way more simple xd. Also I am downloading direct messages
desktop screenshot 2018 11 24 - 02 36 40 03

Suggestion: Page Select

I've been using DHT for some of my other projects. It's been working well so far, but I have not so much as an issue, but a suggestion. When the documents get long (like 153 pages in a file), I find it annoying when you need to scroll to the middle and need to click a button 50-something times to reach the desired page. Can you guys add a function where you can specify what page you want to go to? Or is that already present, and I just don't know how to access it? Thanks!

Downloading the viewer?

Ut says you can download the viewer on the webpage but I see absolutely no way to do so, and if it's here on github, then...help?

Per-server nicks are not saved

A user can set a custom nick on a per-server basis by using /nick or right-clicking their own entry in the member list.

Such nicknames do not seem to be included in the exported data.

Search and filtering

  • Filters
    • by username
    • by time period
    • by contents
    • by regex
    • by embed/attachment types
    • by edited status

Message formatting bugs

  • Backslahes don't work with inline code
  • Bold text formatting with a single backslash before the first asterisk should cancel formatting completely, instead of ending up with a backslash followed by bold text
  • Asterisks at the start of a message display 'undefined' due to capturing of the first character
  • Combinations of 3 asterisks and backslashes is a bit of a mess
  • Images with no embed leave >; at the end
  • Custom emoji should display properly

Discord ID next to the name

It would be nice if the Discord ID (name #XXXX)) appeared next to the name, to know who the person is etc.

I love this app!!!!

I just wish it would grab the links for files dropped directly into discord, rather than skipping or just leaving the text name of the file.

empty messages

Heya,

1st of all, i rly love your tool, but i want to use ur tool to log a game result channel to create statistics for these games.
The game results are posted by a bot on game end. When i download the log and parse it into the viewer, i only see the name of the bot but not the message itself.
Viewer: https://imgur.com/a/60x5I
Discord Channel: https://imgur.com/a/JzW3H

When i disable link preview on discord, the messages by the bot are like in the viewer:
https://imgur.com/a/SAZuq

How can i log these messages?

Not Logging in Desktop App

When I insert the code into the main app, it does seem to "start" - the bar pops up with the options - but upon clicking to Start Tracking, nothing happens.

The console simply spits this out:

Uncaught TypeError: Cannot read property 'querySelector' of null
    at Object.g (<anonymous>:1:1025)
    at o.Z (<anonymous>:1:12182)
    at n (<anonymous>:1:10767)
    at i.ae (<anonymous>:1:11151)
    at HTMLButtonElement.Y.t.M (<anonymous>:1:5442)
    at HTMLButtonElement.r (cfb17c9….js:79)

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.