I am having some issues with my server-information command in discord.py. For the premium_tier
(Boost) if
calls, I am getting Undefined variable 'premium_tier'
. I believe that I am getting an error for the thumbnail, though I am not seeing it.
Code:
@bot.command() async def server(ctx, *, server: discord.Guild = None): embedVar = discord.Embed(color=0xfaa61a) date_format = "%a, %d %b %Y %I:%M %p" embedVar.add_field(name="Created at:", value=server.created_at.strftime(date_format)) embedVar.add_field(name="Humans", value=sum(not member.bot for member in ctx.guild.members)) embedVar.add_field(name="Bots", value=sum(member.bot for member in ctx.guild.members)) if premium_tier == "0": embedVar.add_field(name="Boost Level", value='None') if premium_tier == "1": embedVar.add_field(name="Boost Level", value='1') if premium_tier == "2": embedVar.add_field(name="Boost Level", value='2') if premium_tier == "3": embedVar.add_field(name="Boost Level", value='3') embedVar.add_field(name="Owner", value=server.owner) embedVar.set_thumbnail(url=server.icon_url) return await ctx.send(embed=embedVar)
https://stackoverflow.com/questions/67377568/server-information-command-discord-py May 04, 2021 at 09:08AM
没有评论:
发表评论