Tsbot

Latest version: v1.5.1

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

Scan your dependencies

Page 2 of 2

1.3.0

❗❗ Deprecation warning ❗❗
`ready` event is deprecated. Use `connect` instead.
When registering event handlers, change event to `connect`

python
bot.on("connect")
async def ...


Features

Connection refactor
All the connection related code has been moved off of `bot.TSBot` to `connection` package.

`TSConnection` will try to upkeep connection to the server.
If the connection goes down for what ever reason, the bot will try to establish new connection.

This behavior can be configured via `TSBot` arguments:
- `connection_retries`: How many connection attemps allowed.
- `connection_retry_timeout`: How long between each connection attemps.

New events
With new connection behavior comes new events:
- `connect`: Works the same as old ´ready´ event, which is now deprecated.
- `disconnect`: Emitted when connection is lost.
- `reconnect`: Emitted when connection is lost and regained.

New `TSBot` instance variables
Some useful information about the current bot instance has been added.

New instance variables:
- `bot.clid`: bots current client id.
- `bot.cldbid`: bots server database id.
- `bot.uid`: bots uid.

These can come handy when e.g. moving the bot to another channel.

Commands self check changes
Previously the bot was checking its `uid` against invokers `uid`.
This has been changed to the `clid` (*client_id*). issue: 47 pr: 49

Page 2 of 2

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.