ClemBot icon indicating copy to clipboard operation
ClemBot copied to clipboard

Fixed spongebob command

Open xcelr8 opened this issue 3 years ago • 7 comments
trafficstars

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

xcelr8 avatar Sep 06 '22 12:09 xcelr8

Static type linting failed: Please see CI error output for details and fix the PRs typing

github-actions[bot] avatar Sep 06 '22 12:09 github-actions[bot]

Black linting failed: Please run poetry run black bot from the ClemBot.Bot folder

github-actions[bot] avatar Sep 06 '22 12:09 github-actions[bot]

@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 avatar Sep 06 '22 13:09 Jay-Madden

@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.

xcelr8 avatar Sep 08 '22 11:09 xcelr8

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.

Jay-Madden avatar Sep 08 '22 12:09 Jay-Madden

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.

xcelr8 avatar Sep 08 '22 12:09 xcelr8

  • Left the code for totally random UC/LC as a comment
  • Applied the code for alternating short random spans of UC/LC

xcelr8 avatar Sep 10 '22 08:09 xcelr8

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.

jkriste avatar Jan 21 '23 02:01 jkriste