ppeev/glechats 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ppeev/glechats

Composer 安装命令:

composer require ppeev/glechats

包简介

Small library for posting messages to Google Chat, using their webhooks.

README 文档

README

GleChatS (short from GoogLE CHAT WebhookS), is a small library for posting messages to Google Chat, using their webhooks.

Message Types

There are two message types: simple and card. For the simple one you need to provide only one section with the text you will send.

For the card type there are several params you can add to your message: * title -> text * headerTitle -> text * headerImageUrl -> Image URL * sections -> provide an array of paragraphs you want to include in the card message. * button -> array of KVP that contains text and link

Basic use

You create a new object by providing the Google Chat Webhook

$glechats = new glechats('https://chat.googleapis.com/v1/spaces/AAAA-EgR1hE/messages?....');

Once you have an object created, you can start posting messages:

$glechats->msg([
    'type'=>'simple',
    'sections' => ['Hello World!']
]);

Example

Simple message

$glechats = new glechats('https://chat.googleapis.com/v1/spaces/AAAA-EgR1hE/messages?....');
$params = [
    'type' => 'simple',
    'sections' => ['Hello World!']
];
$glechats->msg($params);

Card Message

$glechats = new glechats('https://chat.googleapis.com/v1/spaces/AAAA-EgR1hE/messages?....');
$params = [
    'type' => 'card',
    'title' => 'Hello!',
    'headerTitle' => 'World!',
    'headerImageUrl' => 'https://example/image',
    'sections' => [
        'Several',
        'Line',
        'Message With a button at the end'
    ],
    'button' => [
        'text' => 'Button Text',
        'link' => 'https://example/button/link'
    ]
];

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2020-10-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固