Example #1
0
 def weather(self, mess, args):
     """ Shows weather info for given location.
     Example: !weather San Francisco, CA
     or !weather brussels
     """
     if not args:
         return 'Am I supposed to guess the location?...'
     return get_weather_for_location(args.strip())
Example #2
0
    def weather(self, mess, args):
        """ Shows weather info for given location.
        Example: !weather San Francisco, CA
        or !weather brussels
        """
        if not args:
            return 'Am I supposed to guess the location?...'

        logging.debug("asking for weather. location = {}, args: {}".format(args.strip(), str(self.config)))
        return weather.get_weather_for_location(location=args.strip(),
                                                **self.config)
Example #3
0
    def weather(self, mess, args):
        """ Shows weather info for given location.
        Example: !weather San Francisco, CA
        or !weather brussels
        """
        if not args:
            return 'Am I supposed to guess the location?...'

        try:
            api = self.config['api_key']
        except:
            return 'Please set an api key'

        return get_weather_for_location(args.strip(), api)