1
votes

So I have a help command that sends you a list of commands on your DM's. After it's sent, I want it to send another embed in the same @bot or @client.command so.

import discord
from discord.ext import commands
import etc etc etc

@client.command() async def help(ctx, member: discord.Member=None):

embed=discord.Embed(title='Commands:',colour = discord.Colour.orange())

embed.add_field(name='Bomb', value=f'Deletes Messages in chat\n .bomb 100', inline=False)
embed.add_field(name='Luck', value=f'Like 8ball fourtune teller', inline=False)
embed.add_field(name='Tof', value=f'True or False', inline=False)

embed.add_field(name='Hitme', value=f'See me holy face', inline=False)
embed.add_field(name='Monkey', value=f'Random pic of monkey monkey', inline=False)
embed.add_field(name='Whois', value=f'Userinfo', inline=False)

embed.add_field(name='coin', value=f'Flips a coin', inline=False)
embed.add_field(name='Dice', value=f'Random number from 1 to 6', inline=False)
embed.add_field(name='Randomnumber', value=f'Gives you a random number from 1 to 100', inline=False)

embed.add_field(name='Meme', value=f'Random meme?', inline=False)
embed.add_field(name='Say', value=f'Says what ever you want the bot to say', inline=False)
embed.add_field(name='Kick', value=f'Kicks user (Needs Admin)', inline=False)

embed.add_field(name='Ban', value=f'Bans user (Needs Admin', inline=False)
embed.add_field(name='Unban', value=f'Revokes ban from user. (Needs Admin)', inline=False)
embed.add_field(name='Prefix', value=f'Changes prefix e.g .prefix !', inline=False)

em.set_author(name='***Commands list has been sent!***')
em.set_footer(name='Check Your DM's! ✅')

await ctx.author.send(embed=embed)

await ctx.send(embed=em)

#I want this to work so it would send this embed after it sent the embed on DM's to the channel 
  #where .help was used. this was my attempt I'm new to python

1
any errors on the console?Raphiel

1 Answers

3
votes

Three things:

  1. em was never defined
  2. em.set_footer has no object name - its text="Check Your DM's! ✅"
  3. ctx.author.send will send the embed to the author of the message -> member.send will send the embed to a certain user

Your code should look like:

@client.command()
async def help(ctx, member:discord.Member = None):
    embed=discord.Embed(title='Commands:',colour = discord.Colour.orange())
    ...

    em = discord.Embed(title="YOU NEED TO SET A TITLE")
    em.set_author(name='***Commands list has been sent!***')
    em.set_footer(text="Check Your DM's! ✅")

    await member.send(embed=embed)

    await ctx.send(embed=em)

Why do you use member:discord.Member = None? You do nothing with it?

If you want to check if a member is given use:

if member is None:
   await ctx.send("Please give me a user °_°")
else:
   YOUR CODE...