Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.www.
wechaty
提交
b67aab89
W
wechaty
项目概览
.www.
/
wechaty
与 Fork 源项目一致
Fork自
wechaty / wechaty
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wechaty
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b67aab89
编写于
6月 12, 2017
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update(license): for example/**/*.ts
上级
19e4a465
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
300 addition
and
51 deletion
+300
-51
example/api-ai-bot.ts
example/api-ai-bot.ts
+18
-4
example/contact-bot.ts
example/contact-bot.ts
+13
-3
example/ding-dong-bot.ts
example/ding-dong-bot.ts
+13
-3
example/friend-bot.ts
example/friend-bot.ts
+13
-3
example/gist-bot/index.ts
example/gist-bot/index.ts
+13
-4
example/gist-bot/on-friend.ts
example/gist-bot/on-friend.ts
+14
-3
example/gist-bot/on-message.ts
example/gist-bot/on-message.ts
+14
-3
example/gist-bot/on-room-join.ts
example/gist-bot/on-room-join.ts
+14
-3
example/hot-reload-bot/index.js
example/hot-reload-bot/index.js
+19
-1
example/hot-reload-bot/listener/friend.js
example/hot-reload-bot/listener/friend.js
+18
-0
example/hot-reload-bot/listener/login.js
example/hot-reload-bot/listener/login.js
+18
-0
example/hot-reload-bot/listener/message.js
example/hot-reload-bot/listener/message.js
+20
-2
example/hot-reload-bot/listener/scan.js
example/hot-reload-bot/listener/scan.js
+19
-1
example/media-file-bot.ts
example/media-file-bot.ts
+13
-3
example/roger-bot.ts
example/roger-bot.ts
+13
-3
example/room-bot.ts
example/room-bot.ts
+17
-7
example/speech-to-text-bot.ts
example/speech-to-text-bot.ts
+13
-3
example/the-worlds-shortest-chatbot-code-in-6-lines.js
example/the-worlds-shortest-chatbot-code-in-6-lines.js
+18
-0
example/tuling123-bot.ts
example/tuling123-bot.ts
+18
-3
script/update-license.ts
script/update-license.ts
+2
-2
未找到文件。
example/api-ai-bot.ts
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
* Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* Wechaty bot use a ApiAi.com brain
*
* Apply Your Own ApiAi Developer API_KEY at:
* http://www.api.ai
*
* Enjoy!
*
* Wechaty - https://github.com/zixia/wechaty
*
*/
/* tslint:disable:variable-name */
const
QrcodeTerminal
=
require
(
'
qrcode-terminal
'
)
...
...
example/contact-bot.ts
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
*
Wechaty - Wechat for Bot
*
Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Connecting ChatBots
* https://github.com/wechaty/wechaty
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
...
...
example/ding-dong-bot.ts
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
*
Wechaty - Wechat for Bot
*
Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Connecting ChatBots
* https://github.com/wechaty/wechaty
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
...
...
example/friend-bot.ts
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
*
Wechaty - Wechat for Bot
*
Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Connecting ChatBots
* https://github.com/wechaty/wechaty
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
...
...
example/gist-bot/index.ts
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
*
Wechaty - Wechat for Bot
*
Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Connecting ChatBots
* https://github.com/wechaty/wechaty
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* demo for modulize code for logic
*/
/**
...
...
example/gist-bot/on-friend.ts
浏览文件 @
b67aab89
/**
*
Wechaty - Wechat for Bot. Connecting ChatBots
*
Wechaty - https://github.com/chatie/wechaty
*
* Licenst: ISC
* https://github.com/wechaty/wechaty
* Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
...
...
example/gist-bot/on-message.ts
浏览文件 @
b67aab89
/**
*
Wechaty - Wechat for Bot. Connecting ChatBots
*
Wechaty - https://github.com/chatie/wechaty
*
* Licenst: ISC
* https://github.com/wechaty/wechaty
* Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
...
...
example/gist-bot/on-room-join.ts
浏览文件 @
b67aab89
/**
*
Wechaty - Wechat for Bot. Connecting ChatBots
*
Wechaty - https://github.com/chatie/wechaty
*
* Licenst: ISC
* https://github.com/wechaty/wechaty
* Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
...
...
example/hot-reload-bot/index.js
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
* Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* Wechaty hot load dots demo
*
...
...
@@ -5,7 +24,6 @@
* PROD: docker run -ti -e NODE_ENV=production --rm --volume="$(pwd)":/bot zixia/wechaty index.js
*
* @author: Gcaufy
*
*/
const
fs
=
require
(
'
fs
'
);
const
path
=
require
(
'
path
'
);
...
...
example/hot-reload-bot/listener/friend.js
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
* Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
exports
=
module
.
exports
=
async
function
onFriend
(
contact
,
request
)
{
if
(
request
){
let
name
=
contact
.
name
();
...
...
example/hot-reload-bot/listener/login.js
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
* Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
exports
=
module
.
exports
=
function
onLoging
(
user
)
{
console
.
log
(
`
${
user
}
login`
);
}
example/hot-reload-bot/listener/message.js
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
* Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
exports
=
module
.
exports
=
async
function
onMessage
(
message
)
{
const
room
=
message
.
room
();
const
sender
=
message
.
from
();
...
...
@@ -7,7 +25,7 @@ exports = module.exports = async function onMessage (message) {
console
.
log
(
`
${
topic
}
<
${
sender
.
name
()}
> :
${
message
.
toStringDigest
()}
`
);
if
(
message
.
self
()
||
room
)
{
console
.
log
(
'
message is sent from myself, or inside a room.
'
);
return
;
...
...
@@ -19,4 +37,4 @@ exports = module.exports = async function onMessage (message) {
sender
.
say
(
'
auto reply.
'
);
return
;
}
}
\ No newline at end of file
}
example/hot-reload-bot/listener/scan.js
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
* Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
exports
=
module
.
exports
=
function
onScan
(
url
,
code
)
{
let
loginUrl
=
url
.
replace
(
'
qrcode
'
,
'
l
'
);
require
(
'
qrcode-terminal
'
).
generate
(
loginUrl
);
console
.
log
(
url
);
}
\ No newline at end of file
}
example/media-file-bot.ts
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
*
Wechaty - Wechat for Bot
*
Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Connecting ChatBots
* https://github.com/wechaty/wechaty
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
...
...
example/roger-bot.ts
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
*
Wechaty - Wechat for Bot
*
Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Connecting ChatBots
* https://github.com/wechaty/wechaty
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
...
...
example/room-bot.ts
浏览文件 @
b67aab89
#!/usr/bin/env node
/**
* Wechaty - https://github.com/chatie/wechaty
*
*
Wechaty - Wechat for Bot
*
Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Connecting ChatBots
* https://github.com/wechaty/wechaty
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Known ISSUES:
* - BUG1: can't find member by this NickName:
* ' leaver: 艾静<img class="emoji emojiae" text="_web" src="/zh_CN/htmledition/v2/images/spacer.gif" />JOY
* - BUG2: leave event not right: sometimes can not found member (any more, because they left)
*/
/**
*
* Known ISSUES:
* - BUG1: can't find member by this NickName:
* ' leaver: 艾静<img class="emoji emojiae" text="_web" src="/zh_CN/htmledition/v2/images/spacer.gif" />JOY
* - BUG2: leave event not right: sometimes can not found member (any more, because they left)
* create a room need at least three people
* when we create a room, the following one is the 3rd people.
*
...
...
example/speech-to-text-bot.ts
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
*
Wechaty - Wechat for Bot
*
Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Connecting ChatBots
* https://github.com/wechaty/wechaty
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
...
...
example/the-worlds-shortest-chatbot-code-in-6-lines.js
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
* Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
const
{
Wechaty
}
=
require
(
'
wechaty
'
)
// import Wechaty from 'wechaty'
Wechaty
.
instance
()
// Singleton
...
...
example/tuling123-bot.ts
浏览文件 @
b67aab89
/**
* Wechaty - https://github.com/chatie/wechaty
*
* Copyright 2016-2017 Huan LI <zixia@zixia.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* Wechaty bot use a Tuling123.com brain
*
* Apply your own tuling123.com API_KEY
* at: http://www.tuling123.com/html/doc/api.html
*
* Enjoy!
*
* Wechaty - https://github.com/zixia/wechaty
*
*/
/* tslint:disable:no-var-requires */
/* tslint:disable:variable-name */
...
...
script/update-license.ts
浏览文件 @
b67aab89
...
...
@@ -136,8 +136,8 @@ async function glob(pattern): Promise<string[]> {
}
async
function
main
():
Promise
<
void
>
{
const
pattern
=
'
{bin/**/*.ts,src/**/*.{ts,js},test/**/*.ts}
'
// const pattern = '
src/**/*.{js,ts}
'
const
pattern
=
'
{bin/**/*.ts,
example/**/*.{js,ts},
src/**/*.{ts,js},test/**/*.ts}
'
// const pattern = '
t.ts
'
const
srcFileList
=
await
glob
(
pattern
)
const
promiseList
=
srcFileList
.
map
(
updateLicense
)
await
Promise
.
all
(
promiseList
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录