후에엥 드디어 투표 메시지 날리는데 성공했다
봇이 너무 귀엽다
import discord
from discord.ext import commands
class Vote(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name='vote')
async def vote(self, ctx, *options):
question = ' '.join(options[:-1]) #띄어쓰기를 기준으로 질문과 답변을 나누는 듯,,,인덱스 0부터 end-1까지
answers = options[-1] #마지막 인덱스
봇이 보내는 특별한 메시지로 컬러 테두리, 포함된 이미지, 텍스트 필드 및 기타 속성을 가질 수 있다.
embed = discord.Embed(title = question, description=answers)
message = await ctx.send(embed = embed)
for arg in range(len(options)-1):
await message.add_reaction(chr(127462 + i))
async def setup(bot):
await bot.add_cog(Vote(bot))
