Skip to content

Commit

Permalink
update to deltabot-cli 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adbenitez committed Mar 10, 2024
1 parent eaf3681 commit 90970a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
8 changes: 5 additions & 3 deletions matterdelta/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
)

from .api import dc2mb, init_api
from .util import get_log_level

cli = BotCli("matterdelta", log_level=get_log_level())
cli = BotCli("matterdelta")


@cli.on_init
Expand All @@ -26,6 +25,7 @@ def _on_init(bot: Bot, _args: Namespace) -> None:
status = "I am a Delta Chat bot, send me /help for more info"
bot.rpc.set_config(accid, "selfstatus", status)
bot.rpc.set_config(accid, "delete_server_after", "1")
bot.rpc.set_config(accid, "delete_device_after", str(60 * 60 * 24 * 30))


@cli.on_start
Expand All @@ -36,7 +36,7 @@ def _on_start(bot: Bot, args: Namespace) -> None:
@cli.on(events.RawEvent)
def _log_event(bot: Bot, accid: int, event: AttrDict) -> None:
if event.kind == EventType.INFO:
bot.logger.info(event.msg)
bot.logger.debug(event.msg)
elif event.kind == EventType.WARNING:
bot.logger.warning(event.msg)
elif event.kind == EventType.ERROR:
Expand Down Expand Up @@ -74,6 +74,8 @@ def _id(bot: Bot, accid: int, event: AttrDict) -> None:

def _send_help(bot: Bot, accid: int, chatid: int) -> None:
text = (
"I'm a bot, I allow to bridge Delta Chat groups with groups in other platforms."
" Only the bot administrator can bridge groups.\n"
"**Available commands**\n\n"
"/id - send me this command in a group to get its ID."
)
Expand Down
10 changes: 0 additions & 10 deletions matterdelta/util.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ classifiers = [
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
]
dependencies = [
"deltabot-cli>=3.0.0,<4.0",
"deltabot-cli>=4.0.0,<5.0",
"requests",
]

Expand Down

0 comments on commit 90970a5

Please sign in to comment.