2022-12-24 12:31:39 +00:00
|
|
|
|
import { Api } from 'telegram';
|
2022-02-19 07:39:40 +00:00
|
|
|
|
|
2022-10-17 13:19:24 +00:00
|
|
|
|
const preSetupCommands = [
|
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'setup',
|
|
|
|
|
description: '执行初始化配置',
|
2022-10-17 13:19:24 +00:00
|
|
|
|
}),
|
|
|
|
|
];
|
2022-03-16 14:34:11 +00:00
|
|
|
|
|
|
|
|
|
// 这里的 group 指群组模式,Private 指在与机器人的私聊会话中
|
|
|
|
|
const groupPrivateCommands = [
|
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'add',
|
|
|
|
|
description: '添加新的群转发',
|
2022-03-16 14:34:11 +00:00
|
|
|
|
}),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const personalPrivateCommands = [
|
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'addfriend',
|
|
|
|
|
description: '添加新的好友转发',
|
2022-03-16 14:34:11 +00:00
|
|
|
|
}),
|
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'addgroup',
|
|
|
|
|
description: '添加新的群转发',
|
2022-03-16 14:34:11 +00:00
|
|
|
|
}),
|
2022-10-26 10:50:00 +00:00
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'login',
|
|
|
|
|
description: '当 QQ 处于下线状态时,使用此命令重新登录 QQ',
|
2022-10-26 10:50:00 +00:00
|
|
|
|
}),
|
2022-03-16 14:34:11 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// 服务器零号实例的管理员
|
|
|
|
|
const groupPrivateSuperAdminCommands = [
|
|
|
|
|
...groupPrivateCommands,
|
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'newinstance',
|
|
|
|
|
description: '创建一个新的转发机器人实例',
|
2022-03-16 14:34:11 +00:00
|
|
|
|
}),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const personalPrivateSuperAdminCommands = [
|
|
|
|
|
...personalPrivateCommands,
|
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'newinstance',
|
|
|
|
|
description: '创建一个新的转发机器人实例',
|
2022-03-16 14:34:11 +00:00
|
|
|
|
}),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// inChat 表示在关联了的转发群组中的命令
|
2022-08-29 09:11:20 +00:00
|
|
|
|
const inChatCommands = [
|
2022-03-16 14:34:11 +00:00
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'info',
|
|
|
|
|
description: '查看本群或选定消息的详情',
|
2022-03-16 14:34:11 +00:00
|
|
|
|
}),
|
2023-03-01 14:16:54 +00:00
|
|
|
|
new Api.BotCommand({
|
|
|
|
|
command: 'search',
|
|
|
|
|
description: '搜索消息',
|
|
|
|
|
}),
|
2022-08-29 09:11:20 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const groupInChatCommands = [
|
|
|
|
|
...inChatCommands,
|
2022-08-14 04:09:30 +00:00
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'forwardoff',
|
|
|
|
|
description: '暂停消息转发',
|
2022-08-14 04:09:30 +00:00
|
|
|
|
}),
|
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'forwardon',
|
|
|
|
|
description: '恢复消息转发',
|
|
|
|
|
}),
|
|
|
|
|
new Api.BotCommand({ command: 'disable_qq_forward', description: '停止从QQ转发至TG' }),
|
|
|
|
|
new Api.BotCommand({ command: 'enable_qq_forward', description: '恢复从QQ转发至TG' }),
|
|
|
|
|
new Api.BotCommand({ command: 'disable_tg_forward', description: '停止从TG转发至QQ' }),
|
|
|
|
|
new Api.BotCommand({ command: 'enable_tg_forward', description: '恢复从TG转发至QQ' }),
|
|
|
|
|
new Api.BotCommand({
|
|
|
|
|
command: 'recover',
|
|
|
|
|
description: '恢复离线期间的 QQ 消息记录到 TG(不稳定功能,管理员专用)',
|
2022-08-14 04:09:30 +00:00
|
|
|
|
}),
|
2022-03-16 14:34:11 +00:00
|
|
|
|
];
|
|
|
|
|
|
2022-04-07 07:06:50 +00:00
|
|
|
|
const personalInChatCommands = [
|
2022-08-29 09:11:20 +00:00
|
|
|
|
...inChatCommands,
|
2022-03-16 14:34:11 +00:00
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'refresh',
|
|
|
|
|
description: '刷新头像和简介',
|
2022-03-16 14:34:11 +00:00
|
|
|
|
}),
|
2022-04-07 07:06:50 +00:00
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'poke',
|
|
|
|
|
description: '戳一戳',
|
2022-04-07 07:06:50 +00:00
|
|
|
|
}),
|
2022-09-02 03:41:24 +00:00
|
|
|
|
new Api.BotCommand({
|
2022-12-24 12:31:39 +00:00
|
|
|
|
command: 'nick',
|
|
|
|
|
description: '获取/设置群名片',
|
2022-09-02 03:41:24 +00:00
|
|
|
|
}),
|
2022-03-16 14:34:11 +00:00
|
|
|
|
];
|
|
|
|
|
|
2022-02-19 07:39:40 +00:00
|
|
|
|
export default {
|
2022-03-16 14:34:11 +00:00
|
|
|
|
preSetupCommands,
|
|
|
|
|
groupPrivateCommands,
|
|
|
|
|
personalPrivateCommands,
|
|
|
|
|
groupPrivateSuperAdminCommands,
|
|
|
|
|
personalPrivateSuperAdminCommands,
|
|
|
|
|
groupInChatCommands,
|
2022-04-07 07:06:50 +00:00
|
|
|
|
personalInChatCommands,
|
2022-02-19 07:39:40 +00:00
|
|
|
|
};
|