whos_there.senders
source package whos_there.senders
Classes
-
DebugSender — Initialize the Debug sender.
-
DiscordSender — Initialize the Discord sender.
-
EmailSender — Initialize the Email sender.
-
SlackSender — Initialize the Slack sender.
-
TeamsSender — Initialize the Teams sender.
-
TelegramSender — Initialize the Telegram sender.
source class DebugSender(print: bool = False)
Bases : Sender
Initialize the Debug sender.
Uses the Python logger. Performs logging on rank zero only in a distributed mode.
Parameters
-
print : bool — If enabled, outputs using the print command in addition. Defaults to False.. Defaults to False.
Methods
source method DebugSender.send(text: str) → Any
source class DiscordSender(webhook_url: str)
Bases : Sender
Initialize the Discord sender.
Parameters
-
webhook_url : str — The Discord webhook URL.
Methods
source method DiscordSender.send(text: str) → Any
source class EmailSender(host: str, port: int, sender_email: str, password: str, recipient_emails: list[str])
Bases : Sender
Initialize the Email sender.
Parameters
-
host : str — The SMTP host.
-
port : int — The SMTP port.
-
sender_email : str — The senders email adress.
-
password : str — The email password.
-
recipient_emails : list[str] — The recipients emails.
Attributes
-
server : smtplib.SMTP — SMTP server instance.
Methods
source property EmailSender.server: smtplib.SMTP
SMTP server instance.
Returns
-
smtplib.SMTP — The SMTP instance.
source method EmailSender.send(text: str) → Any
source
class
SlackSender(webhook_url: str, channel: str, user_mentions: list[str] | None = None, sender_username: str = 'Kock Knock', icon_emoji: str = '')
Bases : Sender
Initialize the Slack sender.
Parameters
-
webhook_url : str — The Slack webhook URL.
-
channel : str — The Slack channel name.
-
sender_username : str — User name used for notifications.
-
user_mentions : list[str] | None — The list of users to mention.
-
icon_emoji : str — Emoji to use for the notifications. See https://www.webfx.com/tools/emoji-cheat-sheet/ for options.
Methods
source method SlackSender.send(text: str) → Any
source class TeamsSender(webhook_url: str, user_mentions: list[str] | None = None)
Bases : Sender
Initialize the Teams sender.
Parameters
-
webhook_url : str — The Teams webhook URL.
-
user_mentions : list[str] | None — The list of users to mention.
Methods
source method TeamsSender.send(text: str) → Any
source class TelegramSender(token: str, chat_id: int)
Bases : Sender
Initialize the Telegram sender.
Parameters
-
token : str — The Telegram token.
-
chat_id : int — The Telegram chat id.
Methods
source property TelegramSender.bot: Bot
source method TelegramSender.send(text: str) → Any