Here's a command I created that can check the weather for a given location, and will return an error if not enough information is provided.
This command consists of two nested @if@ tests, basically looking for a city and country code.
- The first test checks if anything was provided to the command and returns help/about text if nothing was provided. If a city was provided, it moves on to the second test.
- The second test checks to see if a country code was provided and returns an error if one was not provided. If a country code was provided, it moves on to providing the weather.
NOTE: This command does not check for the validity of the information provided. That's up to DeepBot to handle. Literally anything can be provided, and DeepBot seems to take the first two characters of whatever is provided as the country code if it's unsure. For example, providing "junk data" to the command seems to have returned weather for somewhere in Denmark, as "DA" is a valid NATO or FIPS 2-letter code for Denmark
1.
!addcmd !myweather @if@[@target@[1]||||Get your local weather by providing a city and country code. Example: !myweather Copenhagen DNK||@if@[@target@[2]||||Missing Country Code. Refer to https://en.wikipedia.org/wiki/Country_code for codes.||@weather@[@target@[1], @target@[2]]]]
Reference:
1.
Country codes: D–E (Wikipedia)