How to add an emoji to a post sent by a discord bot made of python

Asked 2 years ago, Updated 2 years ago, 14 views

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

2022-09-21 11:16

1 Answers

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.