Skip to content

Commit

Permalink
fix typo twilio_account_sid
Browse files Browse the repository at this point in the history
  • Loading branch information
devxpy committed Jul 16, 2024
1 parent d7d4a3b commit 3575dd3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions daras_ai_v2/twilio_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, data: dict):
if account_sid == settings.TWILIO_ACCOUNT_SID:
account_sid = ""
bi = BotIntegration.objects.get(
account_sid=account_sid, twilio_phone_number=data["To"][0]
twilio_account_sid=account_sid, twilio_phone_number=data["To"][0]
)
self.convo = Conversation.objects.get_or_create(
bot_integration=bi, twilio_phone_number=data["From"][0]
Expand Down Expand Up @@ -93,19 +93,19 @@ def from_data(cls, data: dict):
account_sid = data["AccountSid"][0]
if account_sid == settings.TWILIO_ACCOUNT_SID:
account_sid = ""

account_sid
logger.debug(data)
user_number, bot_number = data["From"][0], data["To"][0]
try:
# cases where user is calling the bot
bi = BotIntegration.objects.get(
account_sid=account_sid, twilio_phone_number=bot_number
twilio_account_sid=account_sid, twilio_phone_number=bot_number
)
except BotIntegration.DoesNotExist:
# cases where bot is calling the user
user_number, bot_number = bot_number, user_number
bi = BotIntegration.objects.get(
account_sid=account_sid, twilio_phone_number=bot_number
twilio_account_sid=account_sid, twilio_phone_number=bot_number
)

convo = Conversation.objects.get_or_create(
Expand Down

0 comments on commit 3575dd3

Please sign in to comment.