xgerhard/nbheaders 问题修复 & 功能扩展

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

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

xgerhard/nbheaders

Composer 安装命令:

composer require xgerhard/nbheaders

包简介

Easily parse Nightbot headers

README 文档

README

Easily handle Nightbot headers

Example:

require 'vendor/autoload.php';

$nbheaders = new xgerhard\nbheaders\nbheaders;

if($nbheaders->isNightbotRequest())
    echo 'Platform: '. $nbheaders->getProvider() .' | User: '. http_build_query($nbheaders->getUser(), '', ', ') .' | Channel: '. http_build_query($nbheaders->getChannel(), '', ', ') .' | Timer: '. ($nbheaders->isTimer() ? 'Yes' : 'No') .' | Moderator: '. ( $nbheaders->isUserModerator() ? 'Yes' : 'No');
else
    echo 'Not a Nightbot request';

// Available functions:
// getUser() retrieve user info who called the command
// getChannel() retrieve channel info where the command was used
// getResponseUrl() retrieve response url to use with Nightbot API
// getProvider() retrieve the provider e.g. twitch, youtube, discord
// isNightbotRequest() checks if the command was called by Nightbot
// isTimer() checks if the command is called from a timer (Returns false if its called by a user)
// isUserModerator() checks if the user calling the command is a moderator

Test example above:

!commands add !nb $(urlfetch https://2g.be/twitch/Nightbot/headers.php)

Install nbheaders in your project:

composer require xgerhard/nbheaders

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固