适用于著名反破坏插件 CoreProtect 的 Discord 集成。
功能特性
• 查询玩家执行的命令;
• 查询玩家发送的消息;
• 查询玩家登录和登出记录;
• 查询玩家放置和破坏的方块;
• 查询存入和取出容器的物品;
• 查询掉落和拾取的物品;
• 使用 b:for a:block 进行方块白名单查询;
• 对部分消息支持 PlaceholderAPI;
• 可自定义 Discord BOT 前缀;
• 支持 MySQL 与 SQLite;
• 可自定义日期格式;
• 可自定义 Discord 消息输出内容;
• 可自定义允许使用命令的角色;
• 可自定义消息和嵌入(embed)样式;
• 将结果输出到日志文件;
• 通过 Webhook 记录操作日志;
关于
DISCORD 命令用法
co!lookup u:用户名 a:命令 t:时间
co!lookup user:用户名 action:命令 time:时间
时间变量可以定义为:
不加分隔符:time:2h30m、t:1m16s 等。
逗号分隔:time:1d,30m、t:2h,30m,10s 等。
目前仅支持同时查询一个用户。
其他功能
查询命令过滤器
你可以使用 f: 或 filter: 参数来过滤发出的命令及其他结果:
用法:co!lookup u:M0dii a:command f:gmc,gmsp t:24h
反转结果
你可以在命令末尾添加 -r 或 -reverse 来反转查询结果:
用法:co!lookup u:M0dii a:command t:24h -reverse
你可以通过以下方式重新加载配置:
co!reload —— 在 Discord 中。
/corecord reload —— 在游戏中。
你可以通过以下方式查看插件和服务端版本:
co!version —— 在 Discord 中。
/corecord version —— 在游戏中。
日志文件
你可以使用 -f 或 -file 参数将结果上传到日志文件,而不是以嵌入消息形式显示:
用法:co!lookup u:M0dii a:command t:24h -f
待实现功能:
区块排除(e:<exclude>)
从特定 XYZ 坐标开始的半径回滚;
玩家交互(按钮点击等);
生物击杀;
告示牌消息;
回滚操作;
要创建 Discord 机器人,请前往 Discord 开发者门户 ,使用你的账户登录并创建一个新应用。
之后,进入其设置菜单,添加一个机器人用户,你也将在此处找到需要填入配置的令牌(token)。
从这里你可以进入 OAUTH 部分,并将你的机器人邀请到你的 Discord 服务器。
如需了解更多信息和更详细的流程,请访问 GitHub 上的 wiki 页面:
Discord BOT · M0diis/M0-CoreCord Wiki
配置
配置非常简单且易于理解。
如需更详细的说明,请访问 GitHub 维基页面:
Configuration · M0diis/M0-CoreCord Wiki (github.com)
## MySQL 配置
# 请确保这些值与你的 CoreProtect 配置中的完全一致。
# 默认表前缀为 co_
# 你也可以使用 SQLite,但我强烈建议使用 MySQL。
use-mysql: true
mysql-host: "host-name"
mysql-port: 3306
mysql-database: "database-name"
mysql-username: "database-user"
# 如果不需要密码,请留空 ''
mysql-password: "user-password"
## Discord BOT Token
# https://discord.com/developers/applications
discord-bot-token: "your-token"
command-prefix: "co!"
## Embed 配置
# Embed 页面的按钮使用 Unicode 符号
# 如果你不知道自己在做什么,请保持原样
# 不要在一页中使用过高的行数
# 日期格式使用 Java SimpleDateFormat
# https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
date-format: "yyyy-MM-dd HH:mm:ss"
# 是否在按下关闭按钮时删除 Embed
# 如果为 false,则仅隐藏按钮。
delete-on-close: false
embed-page-left: '⬅️'
embed-page-right: '➡️'
embed-close: '❌'
rows-in-page: 5
# 是否始终在 Embed 描述中显示结果数量
# 无需使用 #count 命令
always-show-count: true
# 允许使用命令的角色 ID
# 你需要在 Discord 中启用开发者模式
# 要获取 ID,请在角色上右键并复制
allowed-roles:
- 'role-one-id'
- 'role-two-id'
## 调试
# 仅在需要排查问题时启用
# 会向控制台发送大量额外消息
debug: false
webhook-loggers:
1:
url: 'webhook-url-goes-here'
actions:
- '+block' # 放置方块 (+block, place)
- '-block' # 破坏方块 (-block, break)
# - '+item' # 拾取物品 (+item, pickup, pickupitem)
# - '-item' # 丢弃物品 (-item, drop, dropitem)
# - '-session' # 玩家加入 (-session, quit, playerquit)
# - '+session' # 玩家退出 (+session, join, playerjoin)
# - 'container' # 打开容器
# - 'chat' # 发送消息
# - 'command' # 执行命令
# - 'kill' # 击杀怪物/动物 (kill, mobkill)
如果插件按预期工作,请留下正面评价;如果有问题,请通过提供的 Discord 联系或提交 GitHub Issue。
METRICS
M0-CoreCord 通过 bStats(一个面向 Minecraft 软件的开源统计服务)收集匿名的服务器统计数据。
如果您希望禁用通过 bStats 进行的指标收集,可以编辑 /plugins/bStats/config.yml 文件。
Discord integration for the famous Anti-Griefing plugin CoreProtect.
FEATURES
• Lookups for player issued commands;
• Lookups for player messages;
• Lookups for log ins and log outs;
• Lookups for player placed and destroyed blocks;
• Lookups for items taken and placed into containers;
• Lookups for dropped and picked up items;
• Block whitelist using b: for a:block lookups;
• PlaceholderAPI support for certain messages;
• Customizable Discord BOT prefix;
• MySQL & SQLite support;
• Customizable date format;
• Customizable discord message output;
• Customizable allowed roles to use the commands;
• Customizable messages, embed;
• Output results into a log file;
• Action logging via webhooks;
ABOUT
DISCORD COMMAND USAGE
co!lookup u:username a:command t:time
co!lookup user:username action:command time:time
Time variable can be defined as:
unseparated: time:2h30m, t:1m16s, etc.
comma separated: time:1d,30m t:2h,30m,10s, etc.
Currently only supports one user lookup at a time.
ADDITIONAL FEATURES
LOOKUP COMMAND FILTER
You can filter issued commands and other results using f: or filter: flag:
Usage: co!lookup u:M0dii a:command f:gmc,gmsp t:24h
REVERSE RESULTS
You can reverse the lookup results using -r or -reverse at the end of command:
Usage: co!lookup u:M0dii a:command t:24h -reverse
You can reload the configuration with:
co!reload - in discord.
/corecord reload - in game.
You can check plugin and server version with:
co!version - in discord.
/corecord version - in game.
LOG FILE
You can upload results into a log file instead of an embed using -f or -file flag:
Usage: co!lookup u:M0dii a:command t:24h -f
FEATURES TO BE IMPLEMENTED:
Block excludes (e:<exclude>)
Radius rollbacks from specific XYZ coordinates;
Player interactions (button clicks, etc.);
Mob kills;
Sign messages;
Rollbacks;
To create a discord bot head to Discord Developer Portal at log in with your account and create a new application.
After, go to its settings menu and add a bot user, here you will also find the token that has to be put in the config.
From there you can go to OAUTH section and invite your bot to your discord server.
For more information and more detailed process, go to the wiki page on github:
Discord BOT · M0diis/M0-CoreCord Wiki
CONFIGURATION
Configuration is pretty simple and easy to understand.
For more detailed explanation, visit Github wiki page:
Configuration · M0diis/M0-CoreCord Wiki (github.com)
## MySQL Configuration
# Make sure the values are the exact same
# as in your CoreProtect config.
# By default table prefix is co_
# You can also use SQLite, but I strongly recommend
# using MySQL instead.
use-mysql: true
mysql-host: "host-name"
mysql-port: 3306
mysql-database: "database-name"
mysql-username: "database-user"
# Leave '' if password not required
mysql-password: "user-password"
## Discord BOT Token
# https://discord.com/developers/applications
discord-bot-token: "your-token"
command-prefix: "co!"
## Embed configuration
# Embed page buttons use unicode symbols
# Leave them as it is if you don't know what you're doing
# Do not use high values for rows in one page
# Date format uses Java SimpleDataFormat
# https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
date-format: "yyyy-MM-dd HH:mm:ss"
# Whether to delete the embed when close button pressed
# If false, it will only hide the buttons.
delete-on-close: false
embed-page-left: '⬅️'
embed-page-right: '➡️'
embed-close: '❌'
rows-in-page: 5
# Whether to always show number of results in embed description
# without need to #count
always-show-count: true
# Role IDs that are allowed to use the commands
# You have to have developer mode enabled on discord
# To get the ID right click on the role and copy
allowed-roles:
- 'role-one-id'
- 'role-two-id'
## Debugging
# Only enable if you need to find out what's wrong
# Sends a lot of extra messages to the console
debug: false
webhook-loggers:
1:
url: 'webhook-url-goes-here'
actions:
- '+block' # Place a block (+block, place)
- '-block' # Break a block (-block, break)
# - '+item' # Item pickup (+item, pickup, pickupitem)
# - '-item' # Item drop (-item, drop, dropitem)
# - '-session' # Player join (-session, quit, playerquit)
# - '+session' # Player quit (+session, join, playerjoin)
# - 'container' # Open a container
# - 'chat' # Message send
# - 'command' # Command execution
# - 'kill' # Monster/animal kill (kill, mobkill)
Please leave a positive review if the plugin works as intended, if you have an issue contact me on discord provided or open an issue on github.
METRICS
M0-CoreCord collects anonymous server statistics through bStats, an open-source statistics service for Minecraft software.
If you'd like to disable metrics collection via bStats, you can edit the /plugins/bStats/config.yml file.
评论 0
登录后参与评分
还没有评论,来抢沙发吧