Advertisement
Guest User

Untitled

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