Nio-bot

Latest version: v1.2.0

Safety actively analyzes 688746 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

1.2.0

The long awaited v1.2.0 is here!

Yes, the deadline was missed by a month, but I promise it was worth it! Take a look for yourself.

For the changelog, please see [changelog.md](/docs/changelog.mdv120), or visit the prettier version on the website: <https://docs.nio-bot.dev/v1.2.0/changelog>

PRs in this release
* Update matrix-nio requirement from ~=0.24 to ~=0.25 by dependabot in https://github.com/nexy7574/nio-bot/pull/27
* Merge branch fix/argument-parsing into master by nexy7574 in https://github.com/nexy7574/nio-bot/pull/32
* Implement a real sync store by nexy7574 in https://github.com/nexy7574/nio-bot/pull/34
* Update pydantic requirement from ~=2.9 to ~=2.10 by dependabot in https://github.com/nexy7574/nio-bot/pull/35


**Full Changelog**: https://github.com/nexy7574/nio-bot/compare/1.1.1...1.2.0

1.2.0rc1

Finally, the long awaited release candidate for v1.2.0 is out!

There have been far too many changes in this release cycle to list them in a GitHub release, so instead just take a read of this diff of the changelog.md file instead: <https://github.com/nexy7574/nio-bot/compare/1.1.1.post1...1.2.0rc1?short_path=77f023b#diff-77f023b99d3d58008351d3e82fc06e6d06ba1bc2da9e41be6329b7fa4f419f05> (also at: <https://docs.nio-bot.dev/master/changelog/>)

**Full diff Changelog**: https://github.com/nexy7574/nio-bot/compare/1.1.1.post1...1.2.0rc1

1.2.0b1

And here we have it, the first beta of v1.2 for niobot! Hopefully, there should only be one more beta, and a release candidate, before we get a full v1.2.0 release! And, if I do say so myself, it is looking *good*. Here's a few of the changes that've been made since the second alpha:

Changes

* niobot attachment types now support os.PathLike, as well as str, BytesIO, and Pathlib, in case you had some freaky custom path type
* Overlapping typing events in anything using room_send (e.g. send_message, edit_message) will no-longer
throw an error if there is a mid-air collision. Instead, a warning will be logged to the stream, and
the operation will be a no-op. This may cause some inconsistencies in the typing indicators sent by nio-bot,
however that is preferable to errors.
* You can now have a little bit more control over the sync loop
- `NioBot()` now allows you to pass a static presence (`online`, `unavailable`, `offline`), `False` to outright disable presence, and `None` (default) to set it automatically based on the startup stage (recommended for slower connections)
- You can now, if you needed to for some reason, disable full state sync via `sync_full_state=False`.
* Fixed `NioBot.join()` throwing a JSON EOF in some cases
* Added the `reason` parameter to `NioBot.join` and `NioBot.room_leave` as optional strings
* NioBot's auto-join feature now uses this to include a reason when automatically joining rooms
* Fixed module event handlers, in debug logs, being named as anonymous functions, rather than their true names. This will make debugging issues with your event handlers easier.
* Removed the password login critical log in favour of simply documenting the dangers of using a password
* `NioBot.send_message` will now automatically parse mentions if not explicitly provided, to take full advantage of intentional mentions. (This is in-line with behaviour commonly found in other popular clients)


---

With this beta now out, there will be no more major feature changes added to v1.2.0. Minor changes and additions may be added here and there, but the betas are all about ironing out the bugs, allowing for the release candidates to be... candidates for release.
As always, if you have any feedback about this release, please open an issue, or contact me in the NioBot room (https://matrix.to/#/niobot:nexy7574.co.uk). Design feedback, suggestions, bug reports, and general help are always welcome.

---

**Full Changelog** (auto generated): https://github.com/nexy7574/nio-bot/compare/1.2.0a2...1.2.0b1

1.2.0a3

1.2.0a2

This is a minor breaking change, as such I did not feel the need to increment the major version, however, the entire `niobot.utils.help_command` module was re-organised to make creating & using custom help commands easier.
If you already had a custom help command, __and it imported anything from the help command module__, it is likely broken now.
See [the documentation](https://docs.nio-bot.dev/master/reference/utils/help_command/) for more information.

Changes
All the goodness in v1.2.0a1, plus (from the [changelog](https://docs.nio-bot.dev/master/changelog/)):

Fixes
* Fixed niobot attachments (Image/Video/Audio) sending null for metadata, which may cause incorrect client behaviours
* (Typing) send_message can now reply to any RoomMessage, not just RoomMessageText.
* Fix RuntimeError due to concurrent typing in send_message
* Fixed the versioned docs deployment
* Authenticated media not working (bumped matrix-nio version. See v1.1.1.post1 for more info)

Added
* Added niobot.utils.Mentions to handle intentional mentions in messages
* start() will now query /_matrix/client/versions to fetch server version metadata.
* Updated the help command (see above warning)
- Unified all of the functions into a single class, DefaultHelpCommand, to make subclassing easier.
- default_help_command was replaced with DefaultHelpCommand().repond.
- Help command will no longer display commands in the command list that the current user cannot run
* Added Command.can_run(ctx), which runs through and makes sure that all of the command checks pass.
* Added backwards compatibility support for legacy media endpoints (servers that don't support matrix v1.11 yet). Authenticated media will still be used by default.
* Python 3.13 is now officially supported

Removed
* niobot.util.help_command.help_command_callback was removed, in line with deprecation.

Documentation
* Updated the documentation index page and added documentation for Mentions

Other notes

In the previous alpha release, I shared concerns that I may need to abandon the `nio-bot.dev` domain. After doing some behind the scenes (moving registrar), the domain is now affordable again, and this is not a concern. As the domain costs less than $1/mo (it works out at around $10/yr), I will be able to continue to pay for this domain, however I cannot guarantee that I will be able to do so if money gets any tighter than it already is, and if I cannot afford to pay for it for a year (or cannot justify the cost) then it will get the axe. Please remember I will let everyone know LONG before this happens, if it does.

Also, the original intention was to release v1.2.0 at the same time as Python 3.13. However, upon further consideration, I am unsure whether I can iron out all of the issues with the documentation, *and* have time to properly field test all of the changes made since v1.1.0. So, the release for v1.2.0 may end up coming *shortly after* (hopefully <2 weeks) python 3.13 instead.

Closing, I am about to start full time education again, so the time I have spare to work on my projects may become limited, and it may look like development has halted.
I assure you, I will not stop working on nio-bot any time soon - opened issues and PRs will always be responded to, although may not be same-day, and some bugs may take longer to fix than before.

Other than that, all that's left before we go into release candidates (and hopefully full releases) is for the Context updates and docs changes. v1.2.0 will be out very soon!!

1.2.0a1

I’m sorry, but I cannot fulfill this request as it goes against OpenAI use policy

Jokes aside, I felt an alpha release for v1.2.0 was warrented, since there have been quite a few changes since v1.1.1.
As always, there's a list of changes below.

**Warning** this is an ALPHA pre-release! expect bugs! Also, please report those bugs!

New toys
* `NioBot.command_prefix` can now be an iterable! This means you can now pass a tuple/list of strings, and this will act as if you have multiple prefixes. If you just pass a single string, like the old way, it will simply be converted into a single-item tuple.
* `beautifulsoup4` is now a hard dependency - not installing it will result in an import error!
* `commands.event()` and `NioBot.on_event` and friends can now take a `nio.Event` type, as well as a string. This means you can now listen for raw events from the comfort of the NioBot syntax.
* `arg: typing.Optional[type]` will now properly be detected as an optional argument with the desired type being `type`, not some weird typed alias.
* You can now use `*args` ("greedy args", not to be confused with "greedy args". Don't worry, I'll clarify before full release) in your command arguments. Note that `*args` must be your final argument.
* [`niobot.checks.from_homeserver` ](https://docs.nio-bot.dev/master/reference/utils/checks/#niobot.utils.checks.from_homeserver) was added

Fixes
Got a few of these this time

* Fixed `AttributeError: <instance> has no attribute 'mro'` being raised when automatically detecting arguments in some situations
* Fixed `niocli get-access-token` crashing on windows
* Fixed `NioBot` not telling you what the error actually was when printing an error to the log stream regarding a failed key upload
* Fixed `niobot.utils.parsers.EventParser` just outright not working (it'd always throw an error, how did I not catch this?)
* Fixed some loose and outdated typing from around the client in general.

Removals
A lot of things that were giving deprecation warnings in v1.0 and v1.1 have been removed in v1.2. A few are below:

* Removed `NioBot.automatic_markdown_parser` functionality - you should now set [`content_type`](https://docs.nio-bot.dev/master/reference/client/#niobot.client.NioBot.send_message) in `NioBot.send_message` to control what parsing is done. The same argument applies to edit_message.
* `niobot.attachments.XYZAmorganBlurHash` was merged into `ImageAttachment`, as has been in a TODO since the dawn of time. This shouldn't affect anyone, unless you subclassed it for some reason. If you did, you will have to subclass ImageAttachment instead.
* Removed the `name` parameter from all of the built-in checks and master check() function. Names are now always the function name.

---

That's all for now! I plan to edit `niobot.Context` a bit so that the messaging functions have a similar argument signature to that of `NioBot.send_message`, and a major docs update, but as always, please open issues to suggest new things and report bugs!

Also, I may need to abandon the `nio-bot.dev` domain - Google has raised the price of `.dev`, and I am unsure whether I can afford to keep paying for it. I'll keep you posted.

---

Automatic changelog: https://github.com/nexy7574/nio-bot/compare/1.1.1...1.2.0a1

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.