A discord.py extension for command name suggestion
Project description
didyoumean-discordpy
description
discord.pyのcommandsフレームワークの拡張ライブラリです。
画像のように、間違ったコマンドを打ったとき、似たコマンドが見つかった場合にそのコマンドを表示させることができます。
デフォルトでは3件まで似たコマンドを表示させることができます。
how to use
- インストール
python3 -m pip install didyoumean-discordpy- (Windowsの場合)
py -3 -m pip install didyoumean-discordpy
- 拡張機能として追加
例:bot.load_extension("didyoumean-discordpy")
これだけで利用することができます。
modding
このライブラリでは、
- 似たコマンドの最大表示数
- 似たコマンドを表示させるときのメッセージ を変更することができます。
set max suggest
DidYouMean.max_suggestに最大表示数となる値を代入してください。
例:
bot.get_cog("DidYouMean").max_suggest = 2
change message generator
まず、MessageGeneratorを継承したクラスを作成してください。
sendメソッドをオーバーライドすることで自分好みのメッセージを出すことができます。
その後、DidYouMean.set_message_generatorを使用して自作したメッセージジェネレータを登録します。
例:
from didyoumean-discordpy.message_generator import MessageGenerator
class MyMessageGenerator(MessageGenerator):
async def send(self, ctx):
# do something...
bot.get_cog("DidYouMean").set_message_generator(MyMessageGenerator)
developers
- daima3629
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file didyoumean-discordpy-0.2.0.tar.gz.
File metadata
- Download URL: didyoumean-discordpy-0.2.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/53.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7492ce5865c3c0a37763c449cdedc95440fb4de747139bfbb5be0f58ad8b1c34
|
|
| MD5 |
2bed27b5d6b46d6db978ec18b1f8a34d
|
|
| BLAKE2b-256 |
f078ed3fc0aa4535ba045d964255d33f0ccbe51c1813331fc368df88acfb78f0
|
File details
Details for the file didyoumean_discordpy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: didyoumean_discordpy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/53.1.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
162c0e3b3d3de6d49770b8878ca35122130ae6044ca313400216e0ce44df75b4
|
|
| MD5 |
ae97ef50c34e123bdf1b6b1009c37805
|
|
| BLAKE2b-256 |
d0a38a450108067ed972a9701e38c4ab1cd3c39220541003ffdd03d9d2893ea2
|