Exemplo n.º 1
0
	async def emoji(self, ctx, *, emoji:discord.Emoji):
		emoji_str = "<{0}:{1}:{2}>".format("a" if emoji.animated else "", emoji.name, emoji.id)
		title = ("Emoji Info " + emoji_str) if emoji.is_usable() else "Emoji Info"
		embed = discord.Embed(title=title, type="Rich", color=discord.Color.blue())
		embed.set_thumbnail(url=emoji.url)
		embed.add_field(name="Name", value=emoji.name)
		embed.add_field(name="ID", value=emoji.id)
		embed.add_field(name="Non-Nitro Copy-Paste (For badge creation)", value="`" + emoji_format(emoji_str) + "`", inline=False)
		await ctx.send(embed=embed)
Exemplo n.º 2
0
 async def _create_role_management(self, ctx: Context, role: Role,
                                   emoji: Emoji):
     if not role.mentionable:
         return await ctx.send("Error: role is not mentionable")
     if not emoji.is_usable():
         return await ctx.send("Error: I can't use that emoji")
     message = await ctx.send(f"React with {emoji} to join {role.mention}")
     await message.add_reaction(emoji)
     redis = get_redis()
     key = f"role_mgmt:{message.id}"
     redis.hset(key, "emoji_id", emoji.id)
     redis.hset(key, "role_id", role.id)
Exemplo n.º 3
0
async def emoji(ctx, emoji: discord.Emoji):
    await ctx.send(':{}:{}'.format(emoji.name, emoji.id))
    if not emoji.is_usable():
        await ctx.send('Unavailable')
    await ctx.send(emoji.url)