Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.www.
wechaty
提交
517795c5
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,体验更适合开发者的 AI 搜索 >>
提交
517795c5
编写于
5月 01, 2018
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wechaty -> Chatie
上级
45689722
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
29 addition
and
33 deletion
+29
-33
CONTRIBUTING.md
CONTRIBUTING.md
+3
-3
Dockerfile.alpine
Dockerfile.alpine
+2
-2
bin/entrypoint.sh
bin/entrypoint.sh
+1
-1
docs/index.md
docs/index.md
+1
-1
examples/contact-bot.ts
examples/contact-bot.ts
+2
-4
examples/friend-bot.ts
examples/friend-bot.ts
+1
-1
examples/gist-bot/index.ts
examples/gist-bot/index.ts
+1
-1
examples/room-bot.ts
examples/room-bot.ts
+6
-8
scripts/pre-push.sh
scripts/pre-push.sh
+1
-1
src/puppet-puppeteer/puppeteer-friend-request.ts
src/puppet-puppeteer/puppeteer-friend-request.ts
+11
-11
未找到文件。
CONTRIBUTING.md
浏览文件 @
517795c5
...
...
@@ -6,18 +6,18 @@ Thank you for your time on Wechaty.
Contribute by marketing: Add
**Powered by Wechaty**
Badge to your Project Homepage:
[
![Powered by Wechaty
](
https://img.shields.io/badge/Powered%20By-Wechaty-green.svg
)
](https://github.com/
wechaty
/wechaty)
[
![Powered by Wechaty
](
https://img.shields.io/badge/Powered%20By-Wechaty-green.svg
)
](https://github.com/
Chatie
/wechaty)
## Markdown
```
markdown
[
![Powered by Wechaty
](
https://img.shields.io/badge/Powered%20By-Wechaty-green.svg
)
](https://github.com/
wechaty
/wechaty)
[
![Powered by Wechaty
](
https://img.shields.io/badge/Powered%20By-Wechaty-green.svg
)
](https://github.com/
Chatie
/wechaty)
```
## Html
```
html
<a
href=
"https://github.com/
wechaty
/wechaty"
target=
"_blank"
>
<a
href=
"https://github.com/
Chatie
/wechaty"
target=
"_blank"
>
<img
src=
"https://img.shields.io/badge/Powered%20By-Wechaty-green.svg"
alt=
"Powered by Wechaty"
border=
"0"
>
</a>
```
...
...
Dockerfile.alpine
浏览文件 @
517795c5
...
...
@@ -72,11 +72,11 @@ LABEL org.label-schema.license="ISC" \
org.label-schema.schema-version="$(wechaty-version)" \
org.label-schema.name="Wechaty" \
org.label-schema.description="Wechat for Bot" \
org.label-schema.usage="https://github.com/
wechaty
/wechaty/wiki/Docker" \
org.label-schema.usage="https://github.com/
Chatie
/wechaty/wiki/Docker" \
org.label-schema.url="https://www.chatie.io" \
org.label-schema.vendor="AKA Mobi" \
org.label-schema.vcs-ref="$SOURCE_COMMIT" \
org.label-schema.vcs-url="https://github.com/
wechaty
/wechaty" \
org.label-schema.vcs-url="https://github.com/
Chatie
/wechaty" \
org.label-schema.docker.cmd="docker run -ti --rm zixia/wechaty <code.js>" \
org.label-schema.docker.cmd.test="docker run -ti --rm zixia/wechaty test" \
org.label-schema.docker.cmd.help="docker run -ti --rm zixia/wechaty help" \
...
...
bin/entrypoint.sh
浏览文件 @
517795c5
...
...
@@ -2,7 +2,7 @@
#
# Wechaty - Connect ChatBots
#
# https://github.com/
wechaty
/wechaty
# https://github.com/
Chatie
/wechaty
#
set
-e
...
...
docs/index.md
浏览文件 @
517795c5
...
...
@@ -82,7 +82,7 @@ console.log(Wechaty.instance().version(true)) // return '0.7.9'
**Kind**
: instance method of
[
<code>Wechaty</code>
](
#Wechaty
)
**Returns**
:
[
<code>Wechaty</code>
](
#Wechaty
)
- - this for chain
More Example Gist:
[
Examples/Friend-Bot
](
https://github.com/
wechaty
/wechaty/blob/master/examples/friend-bot.ts
)
More Example Gist:
[
Examples/Friend-Bot
](
https://github.com/
Chatie
/wechaty/blob/master/examples/friend-bot.ts
)
| Param | Type | Description |
| --- | --- | --- |
...
...
examples/contact-bot.ts
浏览文件 @
517795c5
...
...
@@ -28,15 +28,13 @@ const QrcodeTerminal = require('qrcode-terminal')
* when you are runing with Docker or NPM instead of Git Source.
*/
import
{
config
,
// Contact,
Wechaty
,
log
,
}
from
'
../src/
'
const
welcome
=
`
=============== Powered by Wechaty ===============
-------- https://github.com/
wechaty
/wechaty --------
-------- https://github.com/
Chatie
/wechaty --------
Hello,
...
...
@@ -54,7 +52,7 @@ Please wait... I'm trying to login in...
`
console
.
log
(
welcome
)
const
bot
=
Wechaty
.
instance
(
{
profile
:
config
.
default
.
DEFAULT_PROFILE
}
)
const
bot
=
Wechaty
.
instance
()
bot
.
on
(
'
login
'
,
function
(
this
,
user
)
{
...
...
examples/friend-bot.ts
浏览文件 @
517795c5
...
...
@@ -34,7 +34,7 @@ import {
const
welcome
=
`
=============== Powered by Wechaty ===============
-------- https://github.com/
wechaty
/wechaty --------
-------- https://github.com/
Chatie
/wechaty --------
Hello,
...
...
examples/gist-bot/index.ts
浏览文件 @
517795c5
...
...
@@ -34,7 +34,7 @@ import { onRoomJoin } from './on-room-join'
const
welcome
=
`
=============== Powered by Wechaty ===============
-------- https://github.com/
wechaty
/wechaty --------
-------- https://github.com/
Chatie
/wechaty --------
Please wait... I'm trying to login in...
...
...
examples/room-bot.ts
浏览文件 @
517795c5
...
...
@@ -62,7 +62,7 @@ import {
const
welcome
=
`
=============== Powered by Wechaty ===============
-------- https://github.com/
wechaty
/wechaty --------
-------- https://github.com/
Chatie
/wechaty --------
Hello,
...
...
@@ -303,11 +303,9 @@ async function checkRoomJoin(room: Room, inviteeList: Contact[], inviter: Contac
try
{
// let to, content
const
user
=
bot
.
userSelf
()
if
(
!
user
)
{
throw
new
Error
(
'
no user
'
)
}
if
(
inviter
.
id
!==
user
.
id
)
{
const
userSelf
=
bot
.
userSelf
()
if
(
inviter
.
id
!==
userSelf
.
id
)
{
await
room
.
say
(
'
RULE1: Invitation is limited to me, the owner only. Please do not invit people without notify me.
'
,
inviter
,
...
...
@@ -366,7 +364,7 @@ function getHelperContact() {
log
.
info
(
'
Bot
'
,
'
getHelperContact()
'
)
// create a new room at least need 3 contacts
return
Contact
.
find
({
name
:
HELPER_CONTACT_NAME
})
return
bot
.
Contact
.
find
({
name
:
HELPER_CONTACT_NAME
})
}
async
function
createDingRoom
(
contact
:
Contact
):
Promise
<
any
>
{
...
...
@@ -385,7 +383,7 @@ async function createDingRoom(contact: Contact): Promise<any> {
const
contactList
=
[
contact
,
helperContact
]
log
.
verbose
(
'
Bot
'
,
'
contactList: %s
'
,
contactList
.
join
(
'
,
'
))
const
room
=
await
Room
.
create
(
contactList
,
'
ding
'
)
const
room
=
await
bot
.
Room
.
create
(
contactList
,
'
ding
'
)
log
.
info
(
'
Bot
'
,
'
createDingRoom() new ding room created: %s
'
,
room
)
await
room
.
topic
(
'
ding - created
'
)
...
...
scripts/pre-push.sh
浏览文件 @
517795c5
...
...
@@ -50,7 +50,7 @@ _STR_
}
# must run this after the above `test` ([ -z ...]),
# or will whow a error: error: failed to push some refs to 'git@github.com:
wechaty
/wechaty.git'
# or will whow a error: error: failed to push some refs to 'git@github.com:
Chatie
/wechaty.git'
echo
"PRE-PUSH HOOK PASSED"
echo
src/puppet-puppeteer/puppeteer-friend-request.ts
浏览文件 @
517795c5
...
...
@@ -18,7 +18,7 @@
*/
/**
* request/accept: https://github.com/
wechaty
/wechaty/issues/33
* request/accept: https://github.com/
Chatie
/wechaty/issues/33
*
* 1. send request
* 2. receive request(in friend event)
...
...
@@ -38,7 +38,7 @@ import {
}
from
'
../puppet/
'
import
{
Recommend
Info
,
Recommend
Payload
,
}
from
'
./schema
'
import
PuppeteerContact
from
'
./puppeteer-contact
'
...
...
@@ -47,7 +47,7 @@ import PuppeteerContact from './puppeteer-contact'
*/
export
class
PuppeteerFriendRequest
extends
FriendRequest
{
public
info
:
RecommendInfo
public
payload
:
RecommendPayload
private
ticket
:
string
...
...
@@ -56,20 +56,20 @@ export class PuppeteerFriendRequest extends FriendRequest {
super
()
}
public
receive
(
info
:
RecommendInfo
):
void
{
log
.
verbose
(
'
PuppeteerFriendRequest
'
,
'
receive(%s)
'
,
info
)
public
receive
(
payload
:
RecommendPayload
):
void
{
log
.
verbose
(
'
PuppeteerFriendRequest
'
,
'
receive(%s)
'
,
payload
)
if
(
!
info
||
!
info
.
UserName
)
{
throw
new
Error
(
'
not valid RecommendInfo:
'
+
info
)
if
(
!
payload
||
!
payload
.
UserName
)
{
throw
new
Error
(
'
not valid RecommendInfo:
'
+
payload
)
}
this
.
info
=
info
this
.
payload
=
payload
const
contact
=
PuppeteerContact
.
load
(
info
.
UserName
)
const
contact
=
PuppeteerContact
.
load
(
payload
.
UserName
)
contact
.
puppet
=
this
.
puppet
this
.
contact
=
contact
this
.
hello
=
info
.
Content
this
.
ticket
=
info
.
Ticket
this
.
hello
=
payload
.
Content
this
.
ticket
=
payload
.
Ticket
// ??? this.nick = info.NickName
if
(
!
this
.
ticket
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录