3. 한블럭으로 모아서 나타내기 (Embed)

오주석·2022년 6월 1일
0

디스코드봇

목록 보기
3/4

디스코드에서 임베드란?

(추가예정)

임베드 생성

import discord

embed = discord.Embed(
	title="Whitelist poll Bot",
    decription="Please choose it yourself :)",
    color=0x62c1cc
)

임베드에 필드 추가

embed.add_field(name='Nominee', value=nominees)

뽑은 인원수 만큼 버튼 만들기

# rand_select: list = [뽑은 인원리스트]
button = [Button(label=i+1, style=ButtonType().Primary, custom_id=f"b_{i+1}") for i in range(len(rand_select))]

임베드에 버튼 붙이기

btns = ButtonsClient(bot)
btns.send(
	content=None,
    embed=embed,
    channel=ctx.channel.id,
    components=[ActionRow(b)]
)
profile
def 9현

0개의 댓글