All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Nothing so far
- An info command for Aetol
- Changing the status now saves it
- The ability for the bot to work when user installed
- All the
if not ctx.response.is_done(): ... else: ...
message sends are now handled by a dedicated function instead of copy pasting the same code everywhere- This function also handles user installs because they cannot use
ctx.send()
- This function also handles user installs because they cannot use
- Updated dependencies in requirements file (most notably aiohttp)
- aiohttp-sse-client2 (0.3.0) and RapidFuzz (3.10.0) as dependencies
- RapidFuzz requires Visual C++ 2019 (:cvheadache:)
- SSE notification listening (Special Thanks: BerylRose/pierce-smith1)
- Currently handles
news_update
notifications fromhttps://fractalthorns.com/notifications
- Sends a message in specified news channels upon receiving such a notification
- Can be restarted by bot admin users
- Currently handles
- User agent can have
{VERSION_SHORT}
,{VERSION_LONG}
, or{VERSION_FULL}
to serve as a placeholder for the current version - Ability to load an Aetol dictionary
- Requires:
aetol/particle_dictionary.tsv
oraetol/word_dictionary.tsv
; Also supportsaetol/idiom_dictionary.tsv
- Expected particle format:
name
,meaning
,as verb
,as noun
,notes
,category
- Expected word format:
name
,meaning
,as verb
,as noun
,formation
,category
- Expected idiom format:
name
,meaning
- Dictionaries not included at this time(?)
- Expected particle format:
- Particles and words can be searched using
/aetol search
- Idioms are displayed separately using
/aetol idioms
- Alphabet can be displayed using
/aetol alphabet
- Requires:
- Bot admin command to save and reload bot data
- Reworked bot channel commands to also work for other channel types (currently news)
- Command group renamed to
channel
(frombotchannel
) - Subcommands renamed to
set
,clear
, andclearall
(fromadd
,remove
, andremoveall
)
- Command group renamed to
- All "bot admin" or otherwise restricted commands now use the
BOT_ADMIN_USERS
environment variable - All mentions of the version are now sourced from
src.fractalrhomb_globals
- Default user agent now includes the short version
- Bot data should be slightly easier to read
- Channel parameter description on /channel commands
- Logging now has proper formatting rather than using f-strings
- Sketch links should now properly link to the sketches
- Description of
/search records
and/search text
- Description of the
limit
parameter of/search records
and/search text
- API coroutines for getting sketches
- API coroutine for searching images, records, record lines
Sketch
andMatchResult
dataclassesItemsUngatheredError
andSketchNotFoundError
exceptionsformat_text
toRecordLine
(removes random whitespace)- Commands for getting sketches
- Commands for a random image, record, record line
- Commands for searching images, records, record lines
- Increased required message length for warning for chapters
- Purge commands are now a single command
- Lowered cache duration and purge cooldown for full record contents
- Renamed
NSIRP_EMOJIS
toNSIRP_EMOJI
- "Taking too long" message for searches
- Image contents cache not being saved
- Image and record related requests now include links to the images and records
- Those will need to be passed as a parameter to
from_obj()
- Deleting
.apicache
is recommended as the old cache will cause errors when loading.
- Those will need to be passed as a parameter to
- Emojis are now used through environment variables (because they won't be the same for every bot)
from_obj()
methods no longer require adding arbitrary keys to the objects; those keys have been turned into parameters forfrom_obj()
- Setting the
image
parameter tonone
for/image
no longer gives an exception
- A few private commands (-say, -status)
- Discord status
- The bot should no longer make a very high amount of concurrent requests, leading the server to think it's getting DDOSed (limited concurrent connections to 6 per host)
- The bot's standard exception handler should now work with exception groups correctly
- Corrected what exceptions are caught for the standard exception handler
- Logging for the fractalthorns API handler (mostly info logs regarding cache access (not part of the discord logger; require
-rv
to be logged)) FractalthornsAPI.save_all_caches()
method- Some protection against redundant cache saves
- File IO is now done with Aiofiles
- Requests are now done with Aiohttp
- All related functions (and some others) are now async and must be awaited
- All functions that make requests now expect an aiohttp.ClientSession as the first parameter and return an async request context manager
FractalthornsAPI.get_cached_items()
now returns a direct copy of the cache with an added expiry time rather than just the stored items- Search results can now be grouped by records
- API cache save and load are no longer private methods
- Saving cache to disk is no longer the API handler's responsibility (to avoid saving to disk 50 times for one request)
- Functions that use API should call
FractalthornsAPI.save_cache()
for the respective cache(s)- However, if unsure,
FractalthornsAPI.save_all_caches()
should be fine to use
- However, if unsure,
- Timeout for requests increased to 30s (to prevent high amounts of parallel async requests from timing out)
- Cache folder renamed to
.apicache
(from__apicache__
)
- Requests (2.32.3) dependency
- Domain search results should no longer spit out entire records for a single search result.
- Root logger should now log properly
- Updated
aiohttp
to 3.10.3
- Discord bot functionality
- Includes the following fractalthorns slash commands: /news, /image, /description, /all_images, /chapter, /record, /record_text, /domain_search
- As well as some miscellaneous slash commands: /license, /purge, /botchannel
DISCORD_BOT_TOKEN
to .env file (and setup)- Retrieving cached items (
FractalthornsAPI.get_cached_items()
) - A
CacheFetchError
if the above fails - Title to ImageDescription objects
- Replaced Discord.py (2.4.0) with Py-cord (2.6.0)
NEWS_ITEMS
value is now"news"
instead of"news items"
- Clearing
/__apicache__
is recommended to avoid errors - Although it might fix itself eventually
- Clearing
- Cache metadata is now saved whenever any other cache type is saved
- Certain other cache save/load details
- Search results cache dict keys are now tuple[str, Literal]
FractalthornsAPI.__get_all_images()
now purges the images cacheFractalthornsAPI.__get_full_episodic()
now purges the chapters and records caches
- Return type hinting for
FractalthornsAPI.get_single_image()
FractalthornsAPI.__get_all_images()
no longer returns theNone
imageNewsEntry.from_obj()
making itemsNone
if it doesn't exist- A few discord formatting issues
- Setup file for Linux
- This changelog
- Usage info in readme
- Dataclasses for the API handler (
fractalthorns_dataclasses
) - Exceptions for the API handler (
fractalthorns_exceptions
) - A persistent cache (this is mainly dev qol)
primary_color
andsecondary_color
fromsingle_image
- Moved .env out of src
- Moved some parts of the readme to wiki
- Massively rewrote parts of the API handler
- All of the public functions now return a dataclass in some way (e.g. by itself, in a list, in a tuple) instead of a string
- A string can be obtained by using the
__str__
,format
, orformat_inline
methods of the dataclass__str__
returns a newline-separated description of the class' contentsformat
returns a string with discord style formatting (some allow for customizing output by giving a dictionary toformatting
)format_inline
returns a string with discord style formatting but without line breaks (only available for a select few dataclasses)
- All exceptions directly raised by the API handler now inherit from
fractalthorns_exceptions.APIError
- How the cache timestamp is tracked (moved the duration from the timestamp itself to the check)
- Cache duration and purge cooldown constants
- Some changes may have been missed (sorry!)
First Public Release