๐ค๐๐๐๐๐๐ฉ.๐ฅ๐ฎ
๐ถ๐๐๐๐๐ ๐ต๐๐๐๐๐๐๐๐ (๐๐๐๐๐๐๐) ๐ฎ๐๐๐๐๐๐๐๐
ใชใใ ใใใฏ
Go่ฃฝใใผใซojichatใฎPython็งปๆค็ใงใ
้็บ็ฐๅข
Python 3.11
*ๆตทๅคใฎๆนใฎๅฉ็จใ1ใใชใๆณๅฎใใฆใใชใใใใdocstringใๅซใใในใฆๆฅๆฌ่ชใงๆดๅใใฆใใพใใฎใงใไบๆฟใใ ใใใ
ใคใณในใใผใซ
pip install ojichat-py
ojichat
ใจใใใใใฑใผใธใใใใพใใๅฅใฎใใใฑใผใธใงใใฎใงใๆณจๆใใ ใใใ
ใใใใใง็ฐๅขใๆฑใใใฎใๅซใชๆนใฏไปฎๆณ็ฐๅขใงใๅฉ็จใใ ใใใ
WindowsใฎๆนใฏReleasesใซ.exeใใใใพใใ
ไฝฟใๆน
CLI
Usage:
ojichat [options]
Options:
-h, --help ใใซใใ่กจ็คบ
-V, --version ใใผใธใงใณใ่กจ็คบ
-s, --seed <Any> ใทใผใๅคใๆๅฎใใ
-n, --name <Any> ๅฅณใฎๅญใฎๅๅใๆๅฎใใ(-1ใงใฉใณใใ )
-e <number> ็ตตๆๅญ/้กๆๅญใฎๆๅคง้ฃ็ถๆฐ [default: 4]
-p <level> ๅฅ่ชญ็นๆฟๅ
ฅ้ ปๅบฆใฌใใซ [min:0, max:3] [default: 0]
-q, --quiet ๅบๅใ็ตๆใฎใฟใซใใพใ ใใใใฐใขใผใใจไฝต็จไธๅฏ
-d, --debug ใใใใฐใขใผใ
--json ็ตๆใJSONๅฝขๅผใง่ฟใ
std I/O:
ๆจๆบๅ
ฅๅใใๅ
ฅๅใใใฃใๅ ดๅใ--nameใๆๅฎใใฆใๆจๆบๅ
ฅๅใฎๅคใซไธๆธใใใใพใ
ใพใใๅบๅใฏ็ตๆใฎใฟใๆจๆบๅบๅใซๅบๅใใใพใ
example:
ๅบๆฌ
$ ojichat
ใญใฐใๅบใใชใ
$ ojichat -q
->ใใใใฃใณใไปๆฅใใไปไบใใช๐ต๐ๅบๅผตใงๆ็ฅใซ่กใฃใฆใใใ(^_^)่ฆณๅ
ใงใใ่กใใใใชใ๐ใขใใญใณใใใใใฃใณใใ
JSONใงๅบๅใใ
$ ojichat -q --json
->{"name": "ใฏใฌใ", "seed": 53304354378, "punc_level": 0, "emoji_num": 4,
"message": "ใฏใฌใใใฃใณใใ็ฒใๆงใ๐ต๐๏ผ็ฌ๏ผใกใใฃใจ้ป่ฉฑใงใใใใชโ๏ผ๏ฟฃใผ๏ฟฃ?๏ผ๐คโใใฎใใใซ๐จใใฏใฉใใตใณใใคใใ๐ฅชใใชใคใทใคใใ ใฃใฆโ๐๐๏ฝต๏พใจไธ็ทใซ่กใใใ๐๐ใชใใฆใญ๐๐โ "}
ไธใฎๆ
ๅ ฑใๅ
ใซๅๅใ ใๅคๆดใใ
$ ojichat -q -n ใใณ -s 53304354378 --json
->{"name": "ใใณ", "seed": 53304354378, "punc_level": 0, "emoji_num": 4,
"message": "ใใณใใฃใณใใ็ฒใๆงใ๐ต๐๏ผ็ฌ๏ผใกใใฃใจ้ป่ฉฑใงใใใใชโ๏ผ๏ฟฃใผ๏ฟฃ?๏ผ๐คโใใฎใใใซ๐จใใฏใฉใใตใณใใคใใ๐ฅชใใชใคใทใคใใ ใฃใฆโ๐๐๏ฝต๏พใจไธ็ทใซ่กใใใ๐๐ใชใใฆใญ๐๐โ "}
ๅๅใ ใใใฉใณใใ ใซๅคๆดใใ
$ ojichat -q -n -1 -s 53304354378 --json
->{"name": "่็พ", "seed": 53304354378, "punc_level": 0, "emoji_num": 4,
"message": "่็พใใฃใณใใ็ฒใๆงใ๐ต๐๏ผ็ฌ๏ผใกใใฃใจ้ป่ฉฑใงใใใใชโ๏ผ๏ฟฃใผ๏ฟฃ?๏ผ๐คโใใฎใใใซ๐จใใฏใฉใใตใณใใคใใ๐ฅชใใชใคใทใคใใ ใฃใฆโ๐๐๏ฝต๏พใจไธ็ทใซ่กใใใ๐๐ใชใใฆใญ๐๐โ "}
ๆจๆบๅ
ฅๅใใๅๅใๆธกใ(ใใ ใใPowerShellใงๆฅๆฌ่ชใใใคใใงๆธกใใจๆๅญๅใใใพใ)
$ echo ใชใณ | ojichat
->ใชใณใกใใใใชใใใผ(^ะท<)โใๅผๅฝใฎใใฌใณใใใผในใ๐ใ็พๅณใใใฆใใใใจไธ็ทใซใชใณใกใใใฎใใจใ้ฃในใกใใใใใใ๏ผ็ฌ๏ผ๐ต๐โฅใชใใกใใฃใฆ๐๐โ
ใฉใณใใ ใงๅบๅใใใใจใใฏ็ฉบๆๅญใๆธกใใพใ
$ echo "" | ojichat
ใซใบใ๏พ๏ฝฌ๏พใใใใช้
ใๆ้๐คใซไฝใใใฆใใใฎใใช๐คโไปๆฅใฏใใๅฏใกใใฃใใฎใใช(๏ผ๏ฟฃะ๏ฟฃ)๐๏ผ๏ฟฃโฝ๏ฟฃ๏ผ๐ช๏ฝต๏ฝผ๏พ๏ฝป๏พใฏใใฉใคใใผใใงใใซใบใ๏พ๏ฝฌ๏พใ็ใใใฆ๏ผ็ฌ๏ผ๐ใใใใ๐ใฃใฆๆใฃใฆใใจ๐๐๐ค(^^;;
็ตใฟ่พผใฟ
from ojichat import OjichatGenerator
ojichat = OjichatGenerator()
# ๆปใๅคใฏOjiMessageใฏใฉใน
result = ojichat.generator()
print(result)
# ๆฐใใชๆ็ซ ใ็ๆใใ
ojichat.reset()
result = ojichat.generator()
# ๅผๆฐใซTrueใไธใใใจ็ๆๅพใซใใญใใใฃใๅๆๅคใซๆปใใพใ
for i in range(10):
print(ojichat.generator(True))
# ็ๆใใๆ็ซ ใฎๅๅใ ใๅคๆดใใ
result1 = ojichat.generator()
ojichat.set_props(name="ใฒใช")
result2 = ojichat.generator()
# ใทใผใๅคใงๆ็ซ ใๅบๅฎใใคใคๅๅใใฉใณใใ ใซๅคๆดใใ
result1 = ojichat.generator()
ojichat.set_props(name=-1)
result2 = ojichat.generator()
# ็ๆใใๆ็ซ ใฎๅๅใ ใๅฉ็จใใฆๆฐใใชๆ็ซ ใ็ๆใใ
result1 = ojichat.generator()
ojichat.set_props(name=result1.name, seed=-1)
result2 = ojichat.generator()
# ใคใณในใฟใณใน็ๆๆใซใใญใใใฃใๆธกใ
ojichat = OjichatGenerator(name="ใใช")
result = ojichat.generator()
# ๆธกใใๅผๆฐ็ญใฏdocstringใใ่ฆงใใ ใใ
ๆณจๆไบ้
- ๅผๆฐใฏๅบๆฌ็ใซๆฌๅฎถใๅ่ใซใใฆใพใใฎใงๆฌๅฎถใฎ่ชฌๆใๅใใใฆใ่ฆงใใ ใใใ
- ใใใใใฏไธ้ใชใฎใงๆฌๅฎถใฎๅคๆดใซ่ฟฝ้ใใฆใใใคใใใงใใใใใใใใฏๆฐใพใใใงใใใใฎใง้ใ้ใ่ตฐใๅงใใใใใใใพใใใ