This repository has been archived on 2025-01-14. You can view files and clone it, but cannot push or open issues or pull requests.
messagearr/app/create_message.py
Parker 237aec245e
Large Overhaul - Jellyfin Temp Accounts
Temporary jellyfin accounts can now be made through messaging. Commands were moved out and into their own files and functions for organization.
2024-03-22 22:09:55 -05:00

22 lines
666 B
Python

import telnyx
from twilio.rest import Client
import initialize_variables
def create_message(number, message):
if initialize_variables.sms_service == 'telnyx':
telnyx.api_key = initialize_variables.telnyx_api_key
telnyx.Message.create(
from_=initialize_variables.api_number,
to=number,
text=message
)
if initialize_variables.sms_service == 'twilio':
client = Client(initialize_variables.twilio_account_sid, initialize_variables.twilio_auth_token)
client.messages.create(
body=message,
from_=initialize_variables.api_number,
to=number
)