Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands do not yell in #yelling #160

Open
49Indium opened this issue Aug 31, 2023 · 3 comments
Open

Commands do not yell in #yelling #160

49Indium opened this issue Aug 31, 2023 · 3 comments
Labels
enhancement update an existing command or cog for some new functionality good first issue Good for newcomers

Comments

@49Indium
Copy link
Member

Commands such as /weekisit do not yell in #yelling.

@andrewj-brown andrewj-brown added the enhancement update an existing command or cog for some new functionality label Oct 9, 2023
@49Indium 49Indium added the good first issue Good for newcomers label Mar 27, 2024
@andrewmeme
Copy link

I've decided to comb through the code for a bit. I discovered that commands that output texts calls yelling_exemptor from yelling.py. I wonder if that's blocking the bot from yelling out commands.

@49Indium
Copy link
Member Author

Thanks for looking into this! I don't think that this is the issue, as yelling_exemptor just allows you to run commands with lowercase arguments. For example, /whatsdue has yelling_exemptor, so you don't get blocked when you search for whats due in csse1001 (note the lowercase). In contrast, /cowsay does not have the yelling_exemptor, so trying to run /cowsay hello will get blocked by the bot in #yelling (try it for yourself).

I don't blame you for being confused. I think the documentation for yelling_exemptor is lacking, both in the codebase and on the GitHub wiki. Given the complexity of yelling exemptor (in the sense that it is a decorator with also a wrapping function), this is a bit of a problem. I might try to write something up this weekend if no-one beats me to it.

Once again, thank you for having a look into this. If you want to have a go at making certain commands yell, I'd suggest looking haiku.py, specifically how it responds to haikus:

        if message.channel == discord.utils.get(
            self.bot.uqcs_server.channels, name=YELLING_CHANNEL_NAME
        ):
            await message.reply(f"Nice haiku:\n{haiku}".upper())
        else:
            await message.reply(f"Nice haiku:\n{haiku}")

Hopefully it should just be about going through all the interesting commands and doing something similar. Feel free to assign yourself to this issue if you want to have a crack.

@andrewj-brown
Copy link
Member

Ah, not quite (yet another example of how the @yelling_exemptor is confusing and silly).

What it actually does is checks through every argument on the command it's attached to, and then if its a string, requires it to be UPPERCASE in the yelling channel. Effectively, ensures that someone can't /echo lower case text - they have to /echo UPPER CASE TEXT or else uqcsbot will still :disapproval: them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement update an existing command or cog for some new functionality good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants