Skip to content

Commit

Permalink
Merge pull request #1434 from mraniki/dev
Browse files Browse the repository at this point in the history
⚡ update cex_exchange_plugin.py and dex_exchange_plugin.py
  • Loading branch information
mraniki authored Apr 8, 2024
2 parents dcfb5e6 + 2edafe8 commit 10702c9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ ping3 = "^4.0.4"
talkytrend = "2.0.8"
iamlistening = "5.1.5"
findmyorder = "1.9.19"
dxsp = "10.0.1"
cefi = "4.4.11"
dxsp = "10.0.2"
cefi = "4.4.12"
myllm = "4.8.1"


Expand Down
15 changes: 7 additions & 8 deletions tt/plugins/default_plugins/cex_exchange_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ async def handle_message(self, msg):
"""
if not self.should_handle(msg):
return
if (settings.bot_ignore not in msg or settings.bot_prefix not in msg) and (
await self.fmo.search(msg) and self.should_handle_timeframe()
):
order = await self.fmo.get_order(msg)
if order and settings.trading_enabled:
trade = await self.exchange.submit_order(order)
if trade:
await send_notification(trade)
if settings.bot_ignore not in msg or settings.bot_prefix not in msg:
if await self.fmo.search(msg) and self.should_handle_timeframe():
order = await self.fmo.get_order(msg)
if order and settings.trading_enabled:
trade = await self.exchange.submit_order(order)
if trade:
await send_notification(trade)

if msg.startswith(settings.bot_prefix):
command, *args = msg.split(" ")
Expand Down
15 changes: 7 additions & 8 deletions tt/plugins/default_plugins/dex_exchange_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ async def handle_message(self, msg):
if not self.should_handle(msg):
return

if (settings.bot_ignore not in msg or settings.bot_prefix not in msg) and (
await self.fmo.search(msg) and self.should_handle_timeframe()
):
order = await self.fmo.get_order(msg)
if order and settings.trading_enabled:
trade = await self.exchange.submit_order(order)
if trade:
await send_notification(trade)
if settings.bot_ignore not in msg or settings.bot_prefix not in msg:
if await self.fmo.search(msg) and self.should_handle_timeframe():
order = await self.fmo.get_order(msg)
if order and settings.trading_enabled:
trade = await self.exchange.submit_order(order)
if trade:
await send_notification(trade)

if msg.startswith(settings.bot_prefix):
command, *args = msg.split(" ")
Expand Down
2 changes: 1 addition & 1 deletion tt/talky_settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ iamlistening_enabled = true
# Bot Prefix
bot_prefix = "/"
# Character to ignore
bot_ignore = "ℹ️ 🦄 ⚠️ 📊 🏦 📺 ⬆️ 💬 🐻"
bot_ignore = "ℹ️ ⚠️ 📊 🏦 📺 ⬆️ 💬 🐻"
# Command for help
bot_command_help = "help"
# Command for info
Expand Down
5 changes: 4 additions & 1 deletion tt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,15 @@ async def send_notification(msg):
if not settings.apprise_url:
logger.warning("No Apprise URL set")
return
if msg is None:
logger.warning("No message to send")
return
aobj = Apprise(settings.apprise_url)
msg_format = settings.apprise_format or NotifyFormat.MARKDOWN
try:
await aobj.async_notify(body=msg, body_format=msg_format)
except Exception as error:
logger.error("Verify Apprise URL: ", error)
logger.error("Verify Apprise URL", error)


async def run_bot():
Expand Down

0 comments on commit 10702c9

Please sign in to comment.