Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. import discord
  2. from discord.ext import commands
  3. import asyncio
  4.  
  5.  
  6. client = commands.Bot(command_prefix = "///", case_insensitive=True, self_bot=True)
  7. client.remove_command('help')
  8.  
  9.  
  10. def is_it_me(ctx):
  11. return ctx.author.id == client.user.id
  12.  
  13.  
  14. @commands.check(is_it_me)
  15. @client.command()
  16. async def dmall(ctx, *, message):
  17. await ctx.message.delete()
  18. for user in ctx.guild.members:
  19. try:
  20. embed = discord.Embed(title="Title", description="Desc", color=0x00ff00)
  21. embed.add_field(name="Field1", value="hi", inline=False)
  22. embed.add_field(name="Field2", value="hi2", inline=False)
  23. await user.send(embed=embed)
  24. print(f"{user.name} has recieved the message.\n")
  25. await asyncio.sleep(3)
  26. except Exception as e:
  27. print(f"{user.name} has NOT recieved the message.\n")
  28. await asyncio.sleep(3)
  29.  
  30. client.run("NjM0ODc3MjQzMjg5NjMyNzc5.Xk80wg.3Tmi6HjD339Sv4cexXd0lj4a-D8", bot=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement