Giter Site home page Giter Site logo

didyoumean-discordpy's Introduction

didyoumean-discordpy

PyPI GitHub license

description

discord.pyのcommandsフレームワークの拡張ライブラリです。
画像のように、間違ったコマンドを打ったとき、似たコマンドが見つかった場合にそのコマンドを表示させることができます。

デフォルトでは3件まで似たコマンドを表示させることができます。

how to use

  1. インストール
    • python3 -m pip install didyoumean-discordpy
    • (Windowsの場合)py -3 -m pip install didyoumean-discordpy
  2. 拡張機能として追加
    例:
    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

didyoumean-discordpy's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.