1// 1. 引入 createClient 工厂函数
2import { createClient } from 'icqq'
3
4// 2. 创建一个机器人实例
5const bot = createClient()
6
7// 3. 监听群消息事件,实现简单的 ping-pong 回复
8bot.on('message.group', (e) => {
9 if (e.raw_message === 'ping')
10 e.reply('pong')
11})
12
13// 4. 输入账号密码登录
14bot.login(10086, 'password')