This commit is contained in:
dsyoon
2023-02-06 22:27:45 +09:00
parent 6af08b0f52
commit c3156e9f25
2 changed files with 19 additions and 0 deletions

View File

@@ -32,6 +32,21 @@ class SlackBot:
return
def sendMsg(self, msg):
try:
this_time = datetime.now()
text = "DATE TIME:" + this_time.strftime('%Y-%m-%d %H:%M:%S') + ", " + "msg:" + msg
result = self.client.chat_postMessage(
channel=self.CHANNEL_ID,
text=text
)
print(text)
except SlackApiError as e:
print(f"Error posting message: {e}")
return
if __name__ == "__main__":
this_time = datetime.now()