定制 valgorithms/pzbot 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

valgorithms/pzbot

Composer 安装命令:

composer require valgorithms/pzbot

包简介

Valgorithm's offical Discord bot for Project Zomboid built in ReactPHP.

README 文档

README

This is a PZ BOT class for DiscordPHP. It provides functionalities for interacting with Discord using PHP.

Installation

Before you start, make sure you have PHP installed on your machine. This BOT class requires PHP CLI to run.

  1. Clone this repository to your local machine.
  2. Navigate to the project directory.
  3. Install the required dependencies. This project requires the Monolog library for logging and the BigInt extension for big integer operations. If you're using Composer, you can install these dependencies by running composer install.

Usage

To use the PZ BOT class, you need to create an instance of the class and pass an options array to the constructor. The options array should include the following keys:

  • discordToken: Your Discord bot token.
  • clientId: Your Discord client ID.
  • clientSecret: Your Discord client secret.
  • guild_id: The ID of the guild (server) that the bot is connected to.
  • channel_ids: An associative array mapping channel names to their IDs.
  • role_ids: An associative array mapping role names to their IDs.
  • loop: An instance of the ReactPHP event loop.
  • discord: An instance of the DiscordPHP client.
  • rcon: An instance of the RCON client.

Here's an example of how to use the PZ BOT class:

$options = [
    'discordToken' => 'your_discord_token',
    'clientId' => 'your_client_id',
    'clientSecret' => 'your_client_secret',
    'guild_id' => 'your_guild_id',
    'channel_ids' => [
        'pz-players' => 'channel_id', // Channel name will automatically update with the # of players
        // Add more channels as needed
    ],
    'role_ids' => [
        'role_name' => 'role_id',
        // Add more roles as needed
    ],
    'loop' => $loop,
    'discord' => $discord,
    'rcon' => $rcon,
];

$bot = new PZ\BOT($options);
$bot->run();

Replace 'your_discord_token', 'your_client_id', 'your_client_secret', 'your_guild_id', 'channel_name', 'channel_id', 'role_name', 'role_id', $loop, $discord, and $rcon with your actual values. Also, you might need to adjust the installation and usage instructions based on your actual project setup and requirements.

Contributing

Contributions are welcome! Please submit a pull request with any enhancements, bug fixes, or other contributions.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-04-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固