Ridgure / TwitchBot

This is an irc bot written in python by Ridgure for Ridgure
https://www.twitch.tv/ridgure
MIT License
5 stars 4 forks source link

probable speedup #10

Closed kbigliar closed 5 years ago

kbigliar commented 5 years ago

one probable speedup would be to save text.lower().split()[0] to a var instead of performing 2 functions on every command check

so like firstStr = text.lower().split()[0] and replace all instances of text.lower().split()[0] with firstStr

kbigliar commented 5 years ago

while going through all the commands, change all but the first if to elif ... else

!uptime!commands!bugs

would run 3 commands at once... just as one example.

kbigliar commented 5 years ago

Just thought of this extra addition. Maybe have a check to see if '!' appears in the first word before checking against all the possible commands.

Ridgure commented 5 years ago

All three speedups have been implemented