This is a Discord bot for our server which is meant for centralized resource aggregation, management, and search. Saving useful and unique resources together as a group for various topics is now significantly easier with this bot. No more keeping track of arbitrary links buried across DMs.
- Weekly backups of resource database
- On-demand export to CSV or JSON
- Submit links or attachments with keywords and an optional description
- SEO data pulled for improved search results
- Batch import from a file of links
- Search using author and query filters
- Custom limit option
- Paginated 12 records per page using new interactions library
- Immutable records with a constant log of newly added submissions
- Supplemental cross-browser extension to make it easier & faster to submit records
Pull the repository and install dependencies:
git clone https://github.com/kamui-fin/res-bank.git
cd res-bank
pip install -r requirements.txt
Add a .env
file with the discord token for the bot. Make sure to replace {token}
with your actual token.
echo "TOKEN={token}" >> .env
Run the bot:
python src/bot.py
Adds a single submission to the resource database.
"[keyword(s)]" "[description]" [link]
Keywords can be separated with any delimiter. Description and keywords must be wrapped within quotes, but the link should not be. There is no specific command for this functionality, you can simply send a message with this format to the designated channel, like #submissions. As there should be no duplicate resources in the database, the bot will notify you if there was a collision.
"Programming" "Ask and view programming questions" https://stackoverflow.com/
Batch imports resources to the database using a file of links.
>importlinks
with an attached text file. The file must include only links on separate lines. It optionally receives a string keywords
to tag all the links.
Sends a search query to the database given a set of parameters and returns the result. Limit must be a valid integer greater than 0.
Optional: [user]
and [limit]
. An empty query "" means no text filtering.
>search "[query]" [user] [limit]
Exports a list of saved resources into a given filetype parameter (either json or csv).
>export
Backups of the database are automatically generated every Monday with the script in the form of JSON files. They are placed in the backups/
directory.
This repository includes an extension that works on Firefox and Chrome to make it easier to send the current tab to the resource bank.