发送信息到钉钉群

 

from dingtalkchatbot.chatbot import DingtalkChatbot


class SendText:
    def __init__(self, webhook):
        # 初始化机器人小丁
        self.xiaoding = DingtalkChatbot(webhook)

    def send(self):
        # Text消息@所有人
        self.xiaoding.send_text(msg='我是机器人!', is_at_all=False)

        self.xiaoding.send_link(title='测试', text='测试环境', message_url=https:xxx.com')
        self.xiaoding.send_link(title='测试', text='测试环境', message_url='https:xxx.com')


if __name__ == '__main__':
    # WebHook地址
    webhook = 'https://oapi.dingtalk.com/robot/send?access_token=xxxxx'
    send_text = SendText(webhook)
    send_text.send()

 

相关文章:

  • 2022-12-23
  • 2021-11-16
  • 2021-10-31
  • 2022-02-13
  • 2022-12-23
  • 2021-11-19
  • 2022-01-23
  • 2022-02-20
猜你喜欢
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2021-06-17
  • 2022-12-23
相关资源
相似解决方案