Releases: nexy7574/nio-bot
v1.1.0
Finally! The long awaited v1.1.0 release!
(I was waiting for matrix-nio to support Python 3.12, which took a lot longer than expected)
What's Changed
(since v1.0.2)
- Fixed pypi link by @ESHARK22 in #2
- Replaced niobot with nio-bot for pip install guide by @ESHARK22 in #3
- Prioritise event_id over room_id for the _get_id function by @ESHARK22 in #4
- Add Context.invoking_prefix by @Matthieu-LAURENT39 in #8
- Type hinting and code refactoring by @Matthieu-LAURENT39 in #6
- Change license to LGPL by @nexy7574 in #9
- Support for python 3.12
- Added
is_ready
asyncio.Event
to the NioBot class, which fires one time - Added additional exception types
- DM Rooms properly implemented
- Added command-level checks
- Many, many quality of life improvements
New Contributors
- @ESHARK22 made their first contribution in #2
- @Matthieu-LAURENT39 made their first contribution in #8
Other contributions
- Massive thanks to @samn:snowcovered.world for being a repeated financial backer on KoFi!
Full Changelog: v1.0.2...1.1.0
v1.0.2.post1
This release simply brings the README up to date for the stable version on PyPi. There is nothing new in this release.
If you're wanting newer features, install the latest pre-release: pip install --pre --upgrade nio-bot
.
v1.1.0b1.post1
Identical to v1.1.0b1 except with code for the NioBot.unmount_module
function (it was previously an empty method that I literally forgot to add code to)
v1.1.0b1
Major Changes
You should look out for the following things when updating:
- Converters have been completely rewritten - see the docs
- The library has (courtesy of @Matthieu-LAURENT39) had a typing rewrite, so you may notice some typing issues with some older code due to changed/added type signatures
Still no 3.12 support!
As aiohttp (and matrix-nio) do not support python 3.12 yet, neither do we. You will receive a build error trying to build from source on python3.12, and wheels are not supplied for 3.12 on PyPi.
Changelog
- Added some tests to the library
- Rewrote how argument parsers work (and made them extensible, see docs)
- Updated
matrix-nio
to0.22.0
- Added the ability to control whether the client's own messages are ignored - this means you can now use commands when running a self bot (running niobot under your own account instead of a dedicated bot account)
- Added support for
typing.Annotated[x, y]
argument types - Removed
Module.log
property - Deprecated
Module.client
Full Changelog: 1.1.0a3...1.1.0b1
v1.1.0a3
What's Changed
- Prioritise event_id over room_id for the _get_id function by @ESHARK22 in #4
- Add Context.invoking_prefix by @Matthieu-LAURENT39 in #8
- Type hinting and code refactoring by @Matthieu-LAURENT39 in #6
New Contributors
- @Matthieu-LAURENT39 made their first contribution in #8
Full Changelog: 1.1.0a2...1.1.0a3
As matrix-nio 0.22.0 has been released, this will be the last 1.1.0 alpha. From now, only a few new things built on nio will be added, things tested with the new version, in following betas. Once all is tested, and python 3.12 support is released by matrix-nio (aiohttp), then 1.1.0 will be released.
As of now, neither nio-bot, nor the libraries supporting it (matrix-nio, which in turn depends on aiohttp) support python 3.12. As such, you will not find them supported on PyPi.org, and the wheels below will not work with anything above python 3.11.
Support is, as listed, python 3.9 to 3.11.
v1.1.0a2
The second beta pre-release for v1.1.0
.
Key changes:
- Support for python 3.9 and 3.10
- Fixed a bug where disabled commands could crash the command parser
- cleaned up a couple documentation issues
- Removed the examples on github (will be re-added later)
- Fix pypi link by @ESHARK22 in #2
- Replaced niobot with nio-bot for pip install guide by @ESHARK22 in #3
New Contributors
Full Changelog: 1.1.0a1...1.1.0a2
v1.1.0a1
Alpha pre-release for v1.1.0
.
Key changes:
- Changed supported matrix-nio versions to <0.22.0 (from
0.20.*
) - Performance logging for
attachments
(will be removed in final release) - Added documentation for events
- Added
which
function to attachments.py - Added hacky "DM Room" support
- Added easier ways to customise the client help command
- Command arguments now properly raise the correct errors
- Added more specific error classes
- Added checks & a check framework
- Added more parsers (event_parser, room_parser)
- force_await now just awaits coroutines rather than casting them to a task
Full Changelog: v1.0.2...1.1.0a1
[URGENT] v1.0.2
All users should upgrade to v1.0.2 immediately, regardless of previous version!
This update fixes a critical bug where anybody could crash the running process simply by sending the client's prefix.
This happened because NioBot.parse_message
did not account for edge cases where someone happens to send only the bot's prefix, without anything else. This meant if your bot's prefix was !
, and someone sent a message with the content being exclusively !
, your bot would hard crash.
Now, NioBot simply emits an info
message into logging to notify of seemingly early-terminated messages.
Workaround
If you are unable to upgrade to v1.0.2 for any reason, you can apply the below patch:
import niobot
class PatchedClient(niobot.NioBot):
async def process_message(self, *args):
try:
await super().process_message(*args)
except IndexError: # IndexError is the only error thrown during parsing
pass # or print, whatever
# bot = niobot.NioBot(...)
bot = PatchedClient(...) # use your patched version
This will simply ignore the error that's raised during parsing
v1.0.2 notable changes:
- Fixed
ImageAttachment
being unable to detect image streams - Added
get_metadata_imagemagick
to allow for fetching image metadata more reliably throughimagemagick
.- Note that
get_metadata
has been changed to use the imagemagick function when it is installed and the file is an image - for anything else, it still uses ffprobe (including when imagemagick isn't installed, for images).
- Note that
- Fixed
BaseAttachment
incorrectly setting file properties, in turn using the wrong instance of the file to fetch data ImageAttachment
no longer strictly fails on an unknown format - it simply emits a warning, in line withVideoAttachment
.AudioAttachment
still does not support dynamic stream selection and codec verification.niocli version
now shows the current CPU architecture, and linux distro where available.niobot.attachment.*
now always imports into rootniobot
, regardless of whether dependencies are installed.- Fixed the bug that caused the process to crash on unexpected chat input
Full changelog & diff:
v1.0.1
Version 1.0.0
In this version, a few breaking changes from v0.1.0, namely:
- Massive attachment overhaul
- Split up attachment types (
VideoAttachment
,ImageAttachment
,AudioAttachment
,FileAttachment
, vsMediaAttachment
andThumbnail
) - Automatic metadata detection (i.e. height, width, duration)
- Better thumbnailing support
- Automatic blurhash generation
- e2ee support
- Automatic codec verification (for web-safe codecs)
- Split up attachment types (
- Automatic command parameterisation
- Automatic help command sanitisation
- Additional requirements
- Several re-shuffling and re-naming of parameters throughout the client
A few other changes include:
- Adding + removing reactions
- More customisation options for
NioBot
- Docs! (domain will be changed eventually)
__repr__
added to most objects in the library- More helper functions
Full Changelog (auto-generated commit history): v0.1.0...v1.0.0