Sign inSign up

tyzbit/go-discord-archiver

By tyzbit

•Updated over 1 year ago

Discord bot for archive.org, written in Go

Image
0

6.4K

tyzbit/go-discord-archiver repository overview

⁠go-discord-archiver

Discord bot for archive.org, written in Go

⁠NOTICE

The emoji functionality was deprecated September 1, 2024. Please see the issue on the issue tracker⁠ for more information.

⁠Help and data deletion requests

Join the Discord for help and for deletion requests

https://discord.gg/kvE2bbfYu3⁠

⁠Configuration

Set some environment variables before launching, or add a .env file.

If database environment variables are provided, the bot will save configuration to an external database. Otherwise, it will save configuration to a local sqlite database at /var/go-discord-archiver/local.db

VariableValue(s)
DB_NAMEDatabase name for database
DB_HOSTHostname for database
DB_PASSWORDPassword for database user
DB_USERUsername for database user
REREGISTER_COMMANDSDelete and re-register commands. Only use when command names are changed, unset after
LOG_LEVELtrace, debug, info, warn, error
COOKIEArchive.org login cookie, get this from a web browser's Dev Tools visiting Archive.org
TOKENThe Discord token the bot should use

⁠Usage

Right-click (or long press) a message and use "Get snapshot" to get a message with snapshots (or use the private option for a message only you can see) or select "Take snapshot" to take a fresh snapshot of the live page.

This is a pretty good way to get around paywalls to read articles for free.

⁠Commands

Configure the bot:

/settings

Get a snapshot for one URL in a message visible only to you (It will ask if you want to try to find an existing snapshot or take a new one):

/archive

Get this help message:

/help

⁠NOTES
  • It can take up to a few minutes for archive.org to save a page, so if you don't get a link immediately, please be patient.

⁠Development

Create a .env file with your configuration, at the bare minimum you need a Discord token for TOKEN and an Archive.org Cookie for COOKIE (Need at least PHPSESSID, logged-in-sig and logged-in-user, looks like: PHPSESSID=12345; logged-in-sig=54321; logged-in-user=example%40example.com).

Logins are currently good for a year. You can either docker compose up --build to run with a mysql database, or just go run main.go to run with a sqlite database.

Tag summary

Content type

Image

Digest

sha256:2f3c6493d…

Size

8.6 MB

Last updated

over 1 year ago

docker pull tyzbit/go-discord-archiver