Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pepebecker/pinyin-bot-core
Core module for my Telegram bot and my Messenger bot.
https://github.com/pepebecker/pinyin-bot-core
Last synced: 1 day ago
JSON representation
Core module for my Telegram bot and my Messenger bot.
- Host: GitHub
- URL: https://github.com/pepebecker/pinyin-bot-core
- Owner: pepebecker
- License: mit
- Created: 2017-05-24T15:53:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-30T13:04:54.000Z (over 4 years ago)
- Last Synced: 2024-10-30T18:18:11.773Z (15 days ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/pinyin-bot-core
- Size: 170 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pinyin Bot Core
[![npm version](https://img.shields.io/npm/v/pinyin-bot-core.svg)](https://www.npmjs.com/package/pinyin-bot-core)
[![Travis Build Status](https://travis-ci.org/pepebecker/pinyin-bot-core.svg)](https://travis-ci.org/pepebecker/pinyin-bot-core)
[![Greenkeeper badge](https://badges.greenkeeper.io/pepebecker/pinyin-bot-core.svg)](https://greenkeeper.io/)
[![dependency status](https://img.shields.io/david/pepebecker/pinyin-bot-core.svg)](https://david-dm.org/pepebecker/pinyin-bot-core)
[![dev dependency status](https://img.shields.io/david/dev/pepebecker/pinyin-bot-core.svg)](https://david-dm.org/pepebecker/pinyin-bot-core#info=devDependencies)
[![MIT-licensed](https://img.shields.io/github/license/pepebecker/pinyin-bot-core.svg)](https://opensource.org/licenses/MIT)
[![chat on gitter](https://badges.gitter.im/pepebecker.svg)](https://gitter.im/pepebecker)## Install
```shell
npm install pinyin-bot-core
```## Usage
```js
const botCore = require('pinyin-bot-core')// Default
botCore.processMessage('你的中文很好啊')
.then(console.log) // nǐ de zhōng wén hěn hǎo a// Pinyin (/p | /pinyin)
botCore.processMessage('/p 你的中文很好啊')
.then(console.log) // nǐ de zhōng wén hěn hǎo abotCore.processMessage('/p nǐ de zhōng wén hěn hǎo a')
.then(console.log) // ni3 de zhong1 wen2 hen3 hao3 abotCore.processMessage('/p ni3 de zhong1 wen2 hen3 hao3 a')
.then(console.log) // nǐ de zhōng wén hěn hǎo a// Split (/s | /split)
botCore.processMessage('/s nidezhongwenhenhaoa')
.then(console.log) // ni de zhong wen hen hao abotCore.processMessage('/s nǐdezhōngwénhěnhǎoa')
.then(console.log) // nǐ de zhōng wén hěn hǎo abotCore.processMessage('/s ni3dezhong1wen2hen3hao3a')
.then(console.log) // ni3 de zhong1 wen2 hen3 hao3 a
```## Related
- [`pinyin-utils`](https://github.com/pepebecker/pinyin-utils)
- [`pinyin-split`](https://github.com/pepebecker/pinyin-split)
- [`zhuyin`](https://github.com/pepebecker/zhuyin)
- [`find-hanzi`](https://github.com/pepebecker/find-hanzi)
- [`hsk-words`](https://github.com/pepebecker/hsk-words)
- [`cedict`](https://github.com/pepebecker/cedict)
- [`mdbg`](https://github.com/pepebecker/mdbg)
- [`pinyin-or-hanzi`](https://github.com/pepebecker/pinyin-or-hanzi)
- [`hanzi-to-pinyin`](https://github.com/pepebecker/hanzi-to-pinyin)
- [`pinyin-convert`](https://github.com/pepebecker/pinyin-convert)
- [`pinyin-rest`](https://github.com/pepebecker/pinyin-rest)
- [`pinyin-api`](https://github.com/pepebecker/pinyin-api)
- [`pinyin-telegram`](https://github.com/pepebecker/pinyin-telegram)
- [`pinyin-messenger`](https://github.com/pepebecker/pinyin-messenger)
- [`pinyin-line`](https://github.com/pepebecker/pinyin-line)
- [`pinyin-chrome`](https://github.com/pepebecker/pinyin-chrome)
- [`pinyin-cli`](https://github.com/pepebecker/pinyin-cli)
- [`hanzi-cli`](https://github.com/pepebecker/hanzi-cli)## Contributing
If you **have a question**, **found a bug** or want to **propose a feature**, have a look at [the issues page](https://github.com/pepebecker/pinyin-bot-core/issues).