Skip to content

Commit

Permalink
woldofwb
Browse files Browse the repository at this point in the history
  • Loading branch information
AdoNunes committed May 7, 2024
1 parent f36335d commit d3595fc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions DiscordAlertsTrader/server_alert_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def server_formatting(message):
message = jpa_formatting(message)
elif message.channel.id in [1216951944933933137]:
message = prophi_alerts(message)
elif message.channel.id in [968629663394058270, 1141877368877760552]:
message = wolfwebull_formatting(message)
elif message.guild.id in [826258453391081524, 1093339706260979822,1072553858053701793, 898981804478980166, 682259216861626378]:
message = aurora_trading_formatting(message)
else:
Expand Down Expand Up @@ -828,6 +830,29 @@ def ddking_formatting(message_):
message.content = alert
return message

def wolfwebull_formatting(message_):
"""
Reformat Discord message from wolfwebull_formatting
"""
message = MessageCopy(message_)

alert = ''
for mb in message.embeds:
alert = mb.description.replace(" Call ", "C").replace(" Put ", "P")

pattern = r'([A-Z]+)\s+\$([\d.]+)(C|P)\s+@\s*([\d.]+)'
match = re.search(pattern, alert, re.IGNORECASE)
if match:
ticker, strike, otype, price = match.groups()
expDate= "0DTE" if ticker in ["SPY", "QQQ"] else 'weeklies'
alert = f"BTO {ticker} {strike.upper()}{otype.upper()} {expDate} @{price}"
alert = format_0dte_weeklies(alert, message, False)
else:
alert = f"{mb.description}"

if len(alert):
message.content = alert
return message

def crimson_formatting(message_):
"""
Expand Down

0 comments on commit d3595fc

Please sign in to comment.