opened
shantung
username_0
idk which one is incorrect, I'm new with coding plz halp

import discord
import asyncio
from discord.ext import commands

class Tester:
    """My custom cog that does stuff!"""

    def __init__(self, bot):
        self.bot = bot

        @commands.command(pass_context=True)
        async def tester(self, ctx):

            author_name = ctx.message.author
            description = ("Short little description with a link to")
            field_name = "Generic Name"
            field_contents = "Example contents for this field"
            footer_text = "Hi. I am a footer text. I look small when displayed."

            embed = discord.Embed(colour=0xFF0000, description=description)
            embed.title = "title test"
            embed.set_author(name=str(author.name), icon_url=author.avatar_url)
            embed.add_field(name=field_name, value=field_contents)
            embed.set_footer(text=footer_text)

            await self.bot.say(embed=embed)
        
def setup(bot):
    bot.add_cog(Tester(bot))
Command doesn't show
issue
created
NotSoSuper
username_1
do you actually load the cog/extension in your main bot file?
comment
created
shantung
username_0
I loaded it, but when I run the command, it shows nothing.
comment
created
nitros12
username_2
dedent the command block by one level, it's being created inside __init__ and then thrown away, it needs to be in the class definition.
comment
created
shantung
username_0
still, it could be loaded, but if I type the command, nothing happened

```
import discord
import asyncio
from discord.ext import commands

class Tester:
    """My custom cog that does stuff!"""

    def __init__(self, bot):
        self.bot = bot

    @commands.command(pass_context=True)
    async def tesu(self, ctx):

        author_name = ctx.message.author
        description = ("Short little description with a link to")
        field_name = "Generic Name"
        field_contents = "Example contents for this field"
        footer_text = "Hi. I am a footer text. I look small when displayed."

        embed = discord.Embed(colour=0xFF0000, description=description)
        embed.title = "title test"
        embed.set_author(name=str(author.name), icon_url=author.avatar_url)
        embed.add_field(name=field_name, value=field_contents)
        embed.set_footer(text=footer_text)

        await self.bot.say(embed=embed)
        
def setup(bot):
    bot.add_cog(Tester(bot))
```
comment
created
martmists
username_3
Could you show a screenshot of what you're typing?
comment
created
nitros12
username_2
Check your variable names, you declare `author_name` but then proceed to use `author`
comment
created
shantung
username_0
OMG, I'm much obligated to you. You've saved my life thanks so much!
comment
closed
Rapptz
username_4
issue