python으로 discord bot 만드는 중 타입 에러
조회수 1174회
python으로 디스코드 봇을 만들고 있던 도중 투표기능을 만들고 있었습니다.
#투표
if message.content.startswith("!투표"):
vote = message.content[4:].split(" / ")
await message.channel.send("★투표 - " + vote[0])
for i in range(1, len(vote)):
choose = await message.channel.send("```" + vote[i] + "```")
await message.add_reaction(choose, ('👍'))
이렇게 했는데 TypeError: add_reaction() takes 2 positional arguments but 3 were given 라며 오류가 뜹니다 검색해봐도 잘 모르겠어서 여기에 질문 남깁니다. 어떻게 해야합니까?
전체 코드는
import discord
import asyncio
import random
client = discord.Client()
#준비 확인
@client.event
async def on_ready():
print(client.user.id)
print(client.user.name)
print("ready")
game = discord.Game("!명령어")
await client.change_presence(status=discord.Status.online, activity=game)
@client.event
async def on_message(message):
#투표
if message.content.startswith("!투표"):
vote = message.content[4:].split(" / ")
await message.channel.send("★투표 - " + vote[0])
for i in range(1, len(vote)):
choose = await message.channel.send("```" + vote[i] + "```")
await message.add_reaction(choose, ('👍'))
client.run("토큰")
입니다.
댓글 입력