调用飞书机器人webhook进行打卡提醒
import yaml
import os,re
import requests
import json
import logging
import time
import urllib3
urllib3.disable_warnings()
import datetime
import schedule
def load_yaml(config_file):
try:
with open(config_file, 'r') as f:
config=yaml.safe_load(f)
return config
except Exception as e:
print(str(e))
return None
try:
JSONDecodeError = json.decoder.JSONDecodeError
except AttributeError:
JSONDecodeError = ValueError
class FeiShuBot(object):
def __init__(self):
'''
机器人初始化
:param webhook: 飞书群自定义机器人webhook地址
:param secret: 机器人安全设置页面勾选“加签”时需要传入的密钥
:param pc_slide: 消息链接打开方式,默认False为浏览器打开,设置为True时为PC端侧边栏打开
:param fail_notice: 消息发送失败提醒,默认为False不提醒,开发者可以根据返回的消息发送结果自行判断和处理
'''
super(FeiShuBot, self).__init__()
self