Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- import asyncio
- client = commands.Bot(command_prefix = "///", case_insensitive=True, self_bot=True)
- client.remove_command('help')
- def is_it_me(ctx):
- return ctx.author.id == client.user.id
- @commands.check(is_it_me)
- @client.command()
- async def dmall(ctx, *, message):
- await ctx.message.delete()
- for user in ctx.guild.members:
- try:
- embed = discord.Embed(title="Title", description="Desc", color=0x00ff00)
- embed.add_field(name="Field1", value="hi", inline=False)
- embed.add_field(name="Field2", value="hi2", inline=False)
- await user.send(embed=embed)
- print(f"{user.name} has recieved the message.\n")
- await asyncio.sleep(3)
- except Exception as e:
- print(f"{user.name} has NOT recieved the message.\n")
- await asyncio.sleep(3)
- client.run("NjM0ODc3MjQzMjg5NjMyNzc5.Xk80wg.3Tmi6HjD339Sv4cexXd0lj4a-D8", bot=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement