簡體   English   中英

discord.py 機器人創建輸入嵌入

[英]discord.py bot create an input embed

我希望我的 discord.py 機器人在輸入成員后創建一個嵌入。 例如{,embed Hello there beauty},標題是hello there,描述是beauty: just a bit more usefull.D,就像每個變量上的多個單詞,用逗號分隔

import discord
from discord.ext import commands


class drops(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.command()
    @commands.has_any_role(795263101309681690, 795263101309681688, 779491292627468308)
    async def embed(self, ctx, *,dropalert, start, social, location, write): #don't mind the dropalert, take it as a title
        dropEmbed = discord.Embed(title = dropalert, colour = 0xFF0000)
        dropEmbed.add_field(name='Drop starts:', value = start)
        dropEmbed.add_field(name="Social club:", value = social)
        dropEmbed.add_field(name = "Location:", value = location)
        dropEmbed.set_footer(text = write)

        await ctx.send(embed=dropEmbed)

def setup(bot):
    bot.add_cog(drops(bot))

您必須使用!embed "Hello there" beauty並刪除, *,那里的 cmd args

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM