I'm making a voting bot. By the way, the emoji should be added to the article written by the bot, but the emoji is added to the article I wrote.
import discord
import asyncio
import random
client = discord.Client()
#Confirm preparation
@client.event
async def on_ready():
print(client.user.id)
print(client.user.name)
print("ready")
game = discard.Game ("!command")
await client.change_presence(status=discord.Status.online, activity=game)
@client.event
async def on_message(message):
#Voting
If message.content.startswith ("!vote"):
vote = message.content[4:].split(" / ")
wait message.channel.send ("★vote - " + vote[0])
for i in range(1, len(vote)):
await message.channel.send("```" + vote[i] + "```")
await message.add_reaction('👍')
client.run ("token")
I think I need to do something more on awit message.add_reaction, but I don't know how to do it, so I'm asking like this.
python
Did you solve it? Your reply is late.
I looked it up and found that the send()
method returned the object of the message you just sent
@client.event
async def on_message(message):
#Voting
If message.content.startswith ("!vote"):
vote = message.content[4:].split(" / ")
channel = message.channel
wait channel.send ("start voting")
for i in range(0, len(vote)):
lastsend = await channel.send("```" + vote[i] + "```")
await lastsend.add_reaction('👍')
client.run ("String Again")
It works well this way.
Thanks to you, I started raising a discode bot. 😁
570 Uncaught (inpromise) Error on Electron: An object could not be cloned
556 Who developed the "avformat-59.dll" that comes with FFmpeg?
578 GDB gets version error when attempting to debug with the Presense SDK (IDE)
818 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.