Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Embedded alert message
Browse files Browse the repository at this point in the history
  • Loading branch information
kodycode committed Jan 27, 2018
1 parent d56ade7 commit 27bd708
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions cogs/modules/alert_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,18 +298,21 @@ async def alert_user(self):
raised_alerts[user].append(alert)
user_obj = await self.bot.get_user_info(user)
if alert_currency in self.market_list:
msg = ("Alert **{}**! **{}** is **{}** **{}** "
"in **{}**".format(alert,
alert_currency.title(),
alert_operator,
alert_price,
alert_fiat))
msg = ("**{}** is **{}** **{}** "
"**{}**".format(alert_currency.title(),
alert_operator,
alert_price,
alert_fiat))
else:
msg = ("**{}** is no longer a valid currency "
"according to the coinmarketapi api. Alerts "
"related to this currency will be removed."
"".format(alert_currency.title()))
await self.bot.send_message(user_obj, msg)
em = discord.Embed(title="Alert **{}**".format(alert),
description=msg,
colour=0xFF9900)
await self.bot.send_message(user_obj,
embed=em)
if raised_alerts:
for user in raised_alerts:
for alert_num in raised_alerts[user]:
Expand Down

0 comments on commit 27bd708

Please sign in to comment.