CactusDev / CactusBot

An open source, community-written service-agnostic chat bot
MIT License
30 stars 6 forks source link

Default Arguments for Variables #148

Closed Alkali-Metal closed 7 years ago

Alkali-Metal commented 7 years ago

When assigning a variable in a custom command there is a possibility of it not receiving anything from the user command and some command look weird when those variables are missing, so it would be cool if there was a way to make a default which replaced empty variables and it was assigned on a per command basis so that you could have different defaults for each command.

[Alkali_Metal] !command add test Alkali is a %args[Metal!]%
[CactusBot] Command added!
[Alkali_Metal] !test potato!
[CactusBot] Alkali is a potato!
[Alkali_Metal] !test
[CactusBot] Alkali is a Metal!
2Cubed commented 7 years ago

This has been implemented for a while; the issue was somehow left open, though.

!command add test Alkali is a %ARG1=Metal!%