GithubHelp home page GithubHelp logo

b1ue-dev / articuno Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 5.0 3.37 MB

A fun (parody) Discord Bot, written with interactions.py.

Home Page: https://blue.is-a.dev/Articuno/

License: GNU General Public License v3.0

Python 99.79% Dockerfile 0.21%
discord discord-bot bot python interactions-py discord-py-interactions discord-py-slash-command interactions hacktoberfest

articuno's People

Contributors

b1ue-dev avatar nattadasu avatar thrzl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

articuno's Issues

[ISSUE] GitHub

GitHub and Microsoft, thanks for the down time so it is not possible for me to solve the issue #1.

Thanks for the down time at a very best moment.

To do:

  • Wait until GitHub is fully operate again.
  • GitHub Codespaces (Cloud deployment/building).
  • Git Operations (local git usage).
  • GitHub Pages (pages for projects).
  • Issues (How could this be made?).
  • Pull Requests (Again?).

image

About your `/help` command...

Heya! I noticed while exploring some interactions.py repos to look some inspiration on how implementing help command... your /help command wouldn't index last commands since you're using multiples of 10 in your i var, so it'd orphan some commands, like if you have 36 commands, embed only shows 30 commands instead. Then those commands aren't sorted alphabetically globally, but per pages.

I tried to patch using what I've wrote similarly, but with languages index, and it works properly. Below is my patch, feel free to use it :D

@interactions.slash_command(
    name="help",
    description="Get a list of all available commands."
)
async def help(self, ctx: interactions.SlashContext) -> None:
    """Get a list of all available commands."""
    help_list = []
    commands = sorted(self.client.application_commands,
                      key=lambda x: str(x.name))

    for i in range(0, len(commands), 10):
        listed = []
        for command in commands[i:i + 10]:
            cmd_name = f"/{command.name}"
            group_name = f" {command.group_name}" if command.group_name else ""
            sub_cmd_name = f" {command.sub_cmd_name}" if command.sub_cmd_name else ""
            name = f"{cmd_name}{group_name}{sub_cmd_name}"
            description = command.sub_cmd_description if command.sub_cmd_name else command.description
            listed.append(interactions.EmbedField(name=name, value=description))

        help_list.append(
            interactions.Embed(
                title="List of available commands.",
                color=0x7CB7D3,
                thumbnail=interactions.EmbedAttachment(
                    url=self.client.user.avatar.url),
                fields=listed
            )
        )

    paginator = Paginator.create_from_embeds(
        self.client, *help_list, timeout=30)
    await paginator.send(ctx)

For this, I used range() as it will do the same job with i = 0; i +=1 stuff, but better and makes the code even smaller.

Rewrite `exts.core`

Rewrite exts.core.

Current planned:

  • eval.py
    • Support autocomplete when using slash command.
    • Remove codeblock on response.
    • Strip codeblock when using prefixed $eval.

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.