提交 517795c5 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

wechaty -> Chatie

上级 45689722
......@@ -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>
```
......
......@@ -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" \
......
......@@ -2,7 +2,7 @@
#
# Wechaty - Connect ChatBots
#
# https://github.com/wechaty/wechaty
# https://github.com/Chatie/wechaty
#
set -e
......
......@@ -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 |
| --- | --- | --- |
......
......@@ -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) {
......
......@@ -34,7 +34,7 @@ import {
const welcome = `
=============== Powered by Wechaty ===============
-------- https://github.com/wechaty/wechaty --------
-------- https://github.com/Chatie/wechaty --------
Hello,
......
......@@ -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...
......
......@@ -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')
......
......@@ -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
......@@ -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 {
RecommendInfo,
RecommendPayload,
} 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.
先完成此消息的编辑!
想要评论请 注册