Alertas¶
Las alertas son mensajes personalizados para una tarea con un nivel de alerta
, título
y mensaje
.
Las alertas se muestran en el menú Alertas
del portal BotMaestro y pueden proporcionar información clara y rápida sobre el estado de una tarea y automatización.
Emitiendo Alertas¶
Una alerta se puede emitir con uno de los siguientes tipos:
INFO
: Alerta de información.WARN
: Alerta de advertencia.ERROR
: Alerta de error.
Aquí es cómo emitimos alertas para la tarea creada en el paso anterior:
maestro.alert(
task_id=task.id,
title="Info Alert",
message="This is an info alert",
alert_type=AlertType.INFO
)
maestro.alert(task.id, "Alerta de Información", "Esta es una alerta de información", AlertType.INFO);
const alert = await maestro.alert(task.id, "Alerta de Información", "Esta es una alerta de información", "INFO")
const alerta: Alerta = await maestro.alerta(task.id, "Alerta de información", "Esta es una alerta de información", "INFO")
Mensajes¶
Usando el SDK de BotMaestro, los usuarios pueden enviar mensajes entre ellos o incluso a direcciones de correo electrónico externas de una manera muy sencilla.
El SDK de Maestro puede enviar dos tipos de mensajes:
TEXTO
: Cuerpo del mensaje en texto plano.HTML
: Cuerpo del mensaje en HTML.
Aquí te mostramos cómo enviar mensajes a través del SDK de Maestro:
# List of emails, if not using, pass an empty list
emails = ["your_email@your_provider.com"]
# List of usernames, if not using, pass an empty list
users = ["maestro_user1", "maestro_user2"]
subject = "Test Message"
body = "This is the message content."
maestro.message(emails, users, subject, body, MessageType.TEXT)
List<String> emails = new ArrayList<>();
emails.add("your_email@your_provider.com");
String subject = "Test Message";
String body = "This is the message content.";
maestro.message(emails, subject, body, MessageType.TEXT);
const emails = ["your_email@your_provider.com"]
// List of usernames, if not using, pass an empty list
const users = ["maestro_user1", "maestro_user2"]
const subject = "Test Message"
const body = "This is the message content."
await maestro.message(emails, users, subject, body, "TEXT")
const emails: array = ["your_email@your_provider.com"]
// List of usernames, if not using, pass an empty list
const users: array = ["maestro_user1", "maestro_user2"]
const subject: string = "Test Message"
const body: string = "This is the message content."
await maestro.message(emails, users, subject, body, "TEXT")