Giter Club home page Giter Club logo

x-dingtalk's Introduction

钉钉组件

自定义机器人

  1. 初始化
<?php 
use Fan\DingTalk\Application;

$config = [
    // HTTP 请求的超时时间(秒)
    'timeout' => 5.0,
    // 机器人模块
    'robot' => [
        'gateways' => [
            'test' => [
                'url' => $url,
            ],
            'test2' => [
                'url' => $url,
            ],
        ],
    ],
];

$ding = new Application($config);
  1. 发送消息
<?php

/** @var \Psr\Http\Message\ResponseInterface[] $res */
$res = $ding->robot->sendText('测试sendText方法', [], ['test']);

/** @var \Psr\Http\Message\ResponseInterface[] $res */
$res = $this->ding->robot->sendMarkdown(
    '杭州天气',
    "#### 杭州天气 @156xxxx8827\n" .
    "> 9度,西北风1级,空气良89,相对温度73%\n\n" .
    "> ![screenshot](https://avatars0.githubusercontent.com/u/16648551?s=460&v=4)\n" .
    "> ###### 10点20分发布 [天气](http://www.thinkpage.cn/) \n",
    [],
    ['test']
);

x-dingtalk's People

Contributors

limingxinleo avatar

Stargazers

Garrett Kisinger avatar allen.Liang avatar  avatar Agnes avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.