コード例 #1
0
async def embed(ctx, col, arg1, arg2, arg3):
    try:
        if col == "red":
            embedcolor = Color.red()
        if col == "orange":
            embedcolor = Color.orange()
        if col == "yellow":
            embedcolor = Color.yellow()
        if col == "green":
            embedcolor = Color.green()
        if col == "blue":
            embedcolor = Color.blue()
        if col == "purple":
            embedcolor = Color.purple()
        if col == "black":
            embedcolor = Color.black()
        if col == "none":
            embedcolor = "none"
        if embedcolor == "none":
            embed=discord.Embed(title=arg1, description=arg2)
            embed.set_footer(text=arg3)
            await ctx.send(embed=embed)
            await ctx.message.delete()
        if embedcolor != "none":
            embed=discord.Embed(title=arg1, description=arg2, color=embedcolor)
            embed.set_footer(text=arg3)
            await ctx.send(embed=embed)
            await ctx.message.delete()
    except:
        print(Fore.RED+"[>] Failed to send embed")
コード例 #2
0
async def poll(ctx, col, arg2):
    try:
        if col == "red":
            embedcolor = Color.red()
        if col == "orange":
            embedcolor = Color.orange()
        if col == "yellow":
            embedcolor = Color.yellow()
        if col == "green":
            embedcolor = Color.green()
        if col == "blue":
            embedcolor = Color.blue()
        if col == "purple":
            embedcolor = Color.purple()
        if col == "black":
            embedcolor = Color.black()
        if col == "none":
            embedcolor = Color.default()
        embed=discord.Embed(title="POLL:", description=arg2, color=embedcolor)
        embed.set_footer(text="Vote by reacting")
        embedmsg = await ctx.send(embed=embed)
        await ctx.message.delete()
        await embedmsg.add_reaction("👍")
        await embedmsg.add_reaction("👎")
        print(Fore.GREEN+f'[>] Poll "{arg2}" sent!')
    except:
        print(Fore.RED+"[>] Poll failed")
    print(Fore.RESET)