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

update(license): for example/**/*.ts

上级 19e4a465
/**
* 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')
......
/**
* 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.
*
*/
......
/**
* 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.
*
*/
......
/**
* 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.
*
*/
......
/**
* 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
*/
/**
......
/**
* 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.
*
*/
......
/**
* 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.
*
*/
......
/**
* 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.
*
*/
......
/**
* 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');
......
/**
* 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();
......
/**
* 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`);
}
/**
* 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
}
/**
* 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
}
/**
* 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.
*
*/
......
/**
* 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.
*
*/
......
#!/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.
*
......
/**
* 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.
*
*/
......
/**
* 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
......
/**
* 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 */
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册