Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

dm command in discord.py

@bot.command()
@commands.has_permissions(administrator=True)
async def edm(ctx, users: commands.Greedy[discord.User], *, message):
    for user in users:
      embed =  discord.Embed(description=message, color = 4*5555 )
      embed.set_footer(text=f'{ctx.author}',icon_url=ctx.author.avatar_url)
      channel = ctx.channel
      await user.send(embed=embed)
      await channel.purge(limit=1)
      await ctx.send('Sent' ,delete_after=5)
Source by dsc.gg #
 
PREVIOUS NEXT
Tagged: #dm #command
ADD COMMENT
Topic
Name
9+8 =