Pārlūkot izejas kodu

Comments, comments, comments

DeadTOm 1 nedēļu atpakaļ
vecāks
revīzija
80a84ddfd5
1 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 4 4
      owncastcom.py

+ 4 - 4
owncastcom.py

@@ -10,12 +10,12 @@ import os
 logging.basicConfig(filename=config.log_file, level=logging.INFO)
 
 
-def get_now():  # This creates and returns a time stamp
+def get_now():  # This creates a timestamp for the log
     now = str(time.strftime("%Y/%m/%d %H:%M:%S"))
     return now
 
 
-def send_ownchat(msg):
+def send_ownchat(msg):  # Sends the message to Owncast chat
     msg_body = {'body': msg}
     headers = {'Authorization': config.auth_bearer}
     response = requests.post(f'{config.api_url}/api/integrations/chat/send', data=json.dumps(msg_body),
@@ -23,7 +23,7 @@ def send_ownchat(msg):
     return response.json()
 
 
-class CommandBot(ClientXMPP):
+class CommandBot(ClientXMPP):  # The XMPP bot
 
     def __init__(self, jid, password):
         ClientXMPP.__init__(self, jid, password)
@@ -45,7 +45,7 @@ class CommandBot(ClientXMPP):
         if msg['type'] in ('chat', 'normal'):
             self.msg = msg
             self.cmd = self.msg['body']  # Get the body out of the message
-            self.cmd = self.cmd.lower()  # Convert it to lower case to avoid problems looking up available commands
+            self.cmd = self.cmd.lower()
             self.sender = self.msg['from']  # Get sender
             self.sender = str(self.sender)  # Convert to string so split() can work with it
             self.sender = self.sender.split('/')[0]  # Only save the information before the forward slash