ClemBot
ClemBot copied to clipboard
Fixed spongebob command
fixes #778
result = ''.join(choice((str.upper, str.lower))(char) for char in args)
explanation: choice() picks a random item from the tuple of (str.upper, str.lower) and applies to each character in the string which are then joined together
Static type linting failed: Please see CI error output for details and fix the PRs typing
Black linting failed: Please run poetry run black bot from the ClemBot.Bot folder
@xcelr8 you don't have to close the PR, fix the errors and just commit the fix and push it, the PR will automatically Revalidate the code
@Jay-Madden This is basically my first contribution, I don't understand the error and how to setup the whole env yet. Thought the little bit of python code would be enough. Maybe I'll share the idea in the issue thread itself.
Thats fine, this feature can be done with botonly mode enabled which makes the env very easy to setup, follow the Contributing.md file to get it setup, its very simple. Drop a question in #bot-dev-discussion if you have any questions.
I think the error might be importing random and using choice directly instead of random.choice in the code as when I coded it I imported choice directly.
- Left the code for totally random UC/LC as a comment
- Applied the code for alternating short random spans of UC/LC
The spongebob command has been moved to SockBot, so if you would still like to fix the issue, you are more than welcome to open a PR there.