Categorygithub.com/tyzbit/go-discord-archiver
modulepackage
0.0.0-20240923155004-f7a9483bdae7
Repository: https://github.com/tyzbit/go-discord-archiver.git
Documentation: pkg.go.dev

# README

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)
ADMINISTRATOR_IDSComma separated IDs of users allowed to use administrator commands
DB_NAMEDatabase name for database
DB_HOSTHostname for database
DB_PASSWORDPassword for database user
DB_USERUsername for database user
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.

# Packages

No description provided by the author
No description provided by the author