#Error in Import

1 messages · Page 1 of 1 (latest)

olive lily
#

I have an error with this import: discord.ext import commmands

Code:

import discord
from discord.ext import commmands
from discord.commands import slash_command, Option


from datetime import datetime
import random
import qrcode
import os
import json

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



    @slash_command(name="avatar", description="Donne l'avatar d'un membre")
    async def _avatar(self, ctx: SlashContext, member : discord.Member = None):
        if member == None:
            member = ctx.author
        memberAvatar = member.avatar_url

        em = discord.Embed(title=f'Photo de profil de {member}', colour=discord.Colour.random())
        em.set_image(url=memberAvatar)

        await ctx.send(embeds=[em])

Someone can help me please ? Thanks for your answers !

#

Pycord version: 2.0.0rc1
And I don't have other Discord lib installed

haughty oriole
#

are you even using that import?

olive lily
#

I use it in the: class utils(commands.Cog): (line 11)

haughty oriole
#

oh right

olive lily
#

I made a mistake in the import and now it works !

#

Thank you for answering me

haughty oriole
#

yeah you have an extra m