Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wechaty
wechaty
提交
95503a0a
W
wechaty
项目概览
wechaty
/
wechaty
上一次同步 大约 3 年
通知
305
Star
10499
Fork
6
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
152
列表
看板
标记
里程碑
合并请求
1
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wechaty
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
152
Issue
152
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
95503a0a
编写于
7月 30, 2018
作者:
L
lijiarui
提交者:
Huan (李卓桓)
7月 30, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove useless param type (#1514)
上级
2c797155
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
11 deletion
+11
-11
src/user/room.ts
src/user/room.ts
+3
-3
src/wechaty.ts
src/wechaty.ts
+8
-8
未找到文件。
src/user/room.ts
浏览文件 @
95503a0a
...
...
@@ -486,7 +486,7 @@ export class Room extends Accessory implements Sayable {
* // after logged in...
* const room = await bot.Room.find({topic: 'topic of your room'}) // change `event-room` to any room topic in your wechat
* if (room) {
* room.on('join', (room
: Room, inviteeList: Contact[], inviter: Contact
) => {
* room.on('join', (room
, inviteeList, inviter
) => {
* const nameList = inviteeList.map(c => c.name()).join(',')
* console.log(`Room got new member ${nameList}, invited by ${inviter}`)
* })
...
...
@@ -498,7 +498,7 @@ export class Room extends Accessory implements Sayable {
* // after logged in...
* const room = await bot.Room.find({topic: 'topic of your room'}) // change `event-room` to any room topic in your wechat
* if (room) {
* room.on('leave', (room
: Room, leaverList: Contact[]
) => {
* room.on('leave', (room
, leaverList
) => {
* const nameList = leaverList.map(c => c.name()).join(',')
* console.log(`Room lost member ${nameList}`)
* })
...
...
@@ -510,7 +510,7 @@ export class Room extends Accessory implements Sayable {
* // after logged in...
* const room = await bot.Room.find({topic: 'topic of your room'}) // change `event-room` to any room topic in your wechat
* if (room) {
* room.on('topic', (room
: Room, topic: string, oldTopic: string, changer: Contact
) => {
* room.on('topic', (room
, topic, oldTopic, changer
) => {
* console.log(`Room topic changed from ${oldTopic} to ${topic} by ${changer.name()}`)
* })
* }
...
...
src/wechaty.ts
浏览文件 @
95503a0a
...
...
@@ -380,35 +380,35 @@ export class Wechaty extends Accessory implements Sayable {
* @example <caption>Event:scan</caption>
* // Scan Event will emit when the bot needs to show you a QR Code for scanning
*
* bot.on('scan', (url
: string, code: number
) => {
* bot.on('scan', (url
, code
) => {
* console.log(`[${code}] Scan ${url} to login.` )
* })
*
* @example <caption>Event:login </caption>
* // Login Event will emit when bot login full successful.
*
* bot.on('login', (user
: ContactSelf
) => {
* bot.on('login', (user) => {
* console.log(`user ${user} login`)
* })
*
* @example <caption>Event:logout </caption>
* // Logout Event will emit when bot detected log out.
*
* bot.on('logout', (user
: ContactSelf
) => {
* bot.on('logout', (user) => {
* console.log(`user ${user} logout`)
* })
*
* @example <caption>Event:message </caption>
* // Message Event will emit when there's a new message.
*
* wechaty.on('message', (message
: Message
) => {
* wechaty.on('message', (message) => {
* console.log(`message ${message} received`)
* })
*
* @example <caption>Event:friendship </caption>
* // Friendship Event will emit when got a new friend request, or friendship is confirmed.
*
* bot.on('friendship', (friendship
: Friendship
) => {
* bot.on('friendship', (friendship) => {
* if(friendship.type() === Friendship.Type.RECEIVE){ // 1. receive new friendship request from new contact
* const contact = friendship.contact()
* let result = await friendship.accept()
...
...
@@ -425,7 +425,7 @@ export class Wechaty extends Accessory implements Sayable {
* @example <caption>Event:room-join </caption>
* // room-join Event will emit when someone join the room.
*
* bot.on('room-join', (room
: Room, inviteeList: Contact[], inviter: Contact
) => {
* bot.on('room-join', (room
, inviteeList, inviter
) => {
* const nameList = inviteeList.map(c => c.name()).join(',')
* console.log(`Room ${room.topic()} got new member ${nameList}, invited by ${inviter}`)
* })
...
...
@@ -433,7 +433,7 @@ export class Wechaty extends Accessory implements Sayable {
* @example <caption>Event:room-leave </caption>
* // room-leave Event will emit when someone leave the room.
*
* bot.on('room-leave', (room
: Room, leaverList: Contact[]
) => {
* bot.on('room-leave', (room
, leaverList
) => {
* const nameList = leaverList.map(c => c.name()).join(',')
* console.log(`Room ${room.topic()} lost member ${nameList}`)
* })
...
...
@@ -441,7 +441,7 @@ export class Wechaty extends Accessory implements Sayable {
* @example <caption>Event:room-topic </caption>
* // room-topic Event will emit when someone change the room's topic.
*
* bot.on('room-topic', (room
: Room, topic: string, oldTopic: string, changer: Contact
) => {
* bot.on('room-topic', (room
, topic, oldTopic, changer
) => {
* console.log(`Room ${room.topic()} topic changed from ${oldTopic} to ${topic} by ${changer.name()}`)
* })
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录