Discord.pyで天気を表示するボットを作っていたところ以下のようなエラーが出ました
実際のコード
import discord
import urllib.request
import json
import re
client = discord.Client()
citycode = '016010'
resp = urllib.request.urlopen('http://weather.livedoor.com/forecast/webservice/json/v1?city=%s'%citycode).read()
resp = json.loads(resp.decode('utf-8'))
@client.event
async def on_ready():
print("logged in as " + client.user.name)
@client.event
async def on_message(message):
if message.author != client.user:
if message.content == "weather":
msg = resp['location']['city']
msg += "の天気は、\n"
for f in resp['forecasts']:
msg += f['dateLabel'] + "が" + f['telop'] + "\n"
msg += "です。"
await message.channel.send(message.channel, message.author.mention + msg)
client.run("token")
表示されたエラー
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\yoich\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\client.py", line 227, in _run_event
await coro(*args, **kwargs)
File "C:\Users\yoich\OneDrive\Desktop\bot総合\Weathertest.py", line 27, in on_message
await message.channel.send(message.channel, message.author.mention + msg)
TypeError: send() takes from 1 to 2 positional arguments but 3 were given
どこをどうすれば正常に起動するのでしょうか?Pythonはpython3を使っています