Answer the question
In order to leave comments, you need to log in
I want to display the weather in the chat using PyOWM, it gives an error, how to solve it?
Instead of API KEY, my key is hidden, just in case
Error:
raise MissingRequiredArgument(param)
discord.ext.commands.errors.MissingRequiredArgument: arg is a required argument that is missing.
The code:
# weather
@client.command()
async def w( ctx, *, arg ):
owm = pyowm.OWM( 'API KEY' )
city = arg
observation = owm.weather_at_place( city )
w = observation.get_weather()
temperature = w.get_temperature( 'celsius' )[ 'temp' ]
await ctx.send( f'Температура в { city } : { temperature }' )
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question