GithubHelp home page GithubHelp logo

pilot1782 / dynamic_help Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 10 KB

A dynamically generated help command for interactions.py

Home Page: https://pypi.org/project/interactions-dynamic-help/

Python 100.00%
discord-py-interactions extension interactions-py

dynamic_help's Introduction

Dynamic Help

Description

A dynamically generated help command for interactions.py that allows for >100 character command descriptions

Usage

Install via pypi

pip install interactions-dynamic-help

Then load the extension into your bot

from interactions import Client

bot = Client()

...

bot.load_extension("interactions.ext.dynhelp")
bot.start("Token")

Using longer descriptions

Longer description is done with a docstring.

If you are using a docstring longer than 100 chars, you MUST provide a description in the slash_command, otherwise the docstring will be used as the description

from interactions import Client, slash_command

bot = Client()


@slash_command(
    name="test",
    description="This is a test command",
)
async def test(ctx):
    """This is a test command (parsed as a short description and ignored if a long description is provided)

    This is a longer description that will be used in the help command and is longer than 100 chars
    - this is parsed as part of the long description
    """
    await ctx.respond("Test")


bot.load_extension("interactions.ext.dynhelp")
bot.start("Token")

You can specify to combine the short and long description by adding combine=True to the decorator

bot.load_extension("interactions.ext.dynhelp", combine=True)

Skipping commands and/or options

By defualt the ctx and bot parameters are skipped, but you can skip more by adding skip_coms adn skip_opts to the decorator

bot.load_extension("interactions.ext.dynhelp", skip_coms=["test"], skip_opts=["test"])

Custom args to the paginator

These can be added by adding paginator_args to the decorator, your args will be added to the default args which are

{
  "ephemeral": true,
  "delete_after": 60
}
bot.load_extension("interactions.ext.dynhelp", paginator_args={"timeout": 60})

dynamic_help's People

Contributors

pilot1782 avatar

Stargazers

 avatar

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.