asafespace/logic.py
def broadcast_message(bot, message, recipients, skip):
    """
    Broadcasts only text messages to everyone

    Parameters
    ----------
    bot: a Telegram bot object
    message: str
        Message should already be set with usernames at the beginning of the message
    recipients: list
        List of all chat_id
    """
    
    for chat_id in recipients:
        if chat_id == skip:
            continue
        try:
            bot.send_message(chat_id=chat_id, text=message)
        except Exception as error:
            logger.error("Message could not be sent to user with chat_id " + str(chat_id) + ". " + str(error))
    logger.info("Message has been sent to all users")

    Broadcasts only text messages to everyone

    Parameters
    ----------
    bot: a Telegram bot object
    message: str
        Message should already be set with usernames at the beginning of the message
    recipients: list
        List of all chat_id
    
Broadcasts only text messages to everyone
Parameters

a Telegram bot object
message: str
Message should already be set with usernames at the beginning of the message
recipients: list
List of all chat_id
Broadcasts only text messages to everyone Parameters a Telegram bot object message : str Message should already be set with usernames at the beginning of the message recipients : list List of all chat_id
def broadcast_message(bot, message, recipients, skip):
    for chat_id in recipients:
        if chat_id == skip:
            continue
        try:
            bot.send_message(chat_id=chat_id, text=message)
        except Exception as error:
            logger.error("Message could not be sent to user with chat_id " + str(chat_id) + ". " + str(error))
    logger.info("Message has been sent to all users")
def broadcast_message ( bot , message , recipients , skip ) : for chat_id in recipients : if chat_id == skip : continue try : bot . send_message ( chat_id = chat_id , text = message ) except Exception as error : logger . error ( "Message could not be sent to user with chat_id " + str ( chat_id ) + ". " + str ( error ) ) logger . info ( "Message has been sent to all users" )
Broadcasts only text messages to everyone
Parameters
Broadcasts only text messages to everyone Parameters
"""
    Broadcasts only text messages to everyone

    Parameters
    ----------
    bot: a Telegram bot object
    message: str
        Message should already be set with usernames at the beginning of the message
    recipients: list
        List of all chat_id
    """
bot
message
recipients
skip