示例#1
0
    async def convert(self, ctx, argument):
        timeframe = argument.lower()
        if timeframe not in ['day', 'week']:
            raise errors.BadArgument(
                "<timeframe> argument must be day or week")

        return timeframe
示例#2
0
 async def convert(self, ctx, coin_name):
     valid = rally_api.valid_coin_symbol(coin_name)
     if not valid:
         raise errors.BadArgument("Coin '" + coin_name +
                                  "' does not seem to exist.")
     return coin_name
示例#3
0
    async def convert(self, ctx, argument):
        currencyType = argument.upper()
        if currencyType != "USD" and currencyType != "COIN":
            raise errors.BadArgument("<currencyType> must be USD or COIN")

        return currencyType