❗❗ 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