qsadfasdgfgads

Untitled

Apr 14th, 2020
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.77 KB | None | 0 0
  1. import discord
  2. import asyncio
  3. from discord.ext import commands
  4.  
  5.  
  6. class MyClient(discord.Client):
  7.     async def on_ready(self):
  8.         print("Logged as {0}!".format(self.user))
  9.  
  10.     async def on_message(self, message):
  11.         # print('699352136273887292' == str(message.guild.id))
  12.         # print('699352136273887292' + ' || ' + str(message.guild.id))
  13.         print("Message from {0.author}: {0.content}".format(message))
  14.         text = message.content.lower()
  15.         if "!разослать" in text and message.author.bot == False:
  16.             b = client.get_guild(699352136273887292)
  17.             print(b.members)
  18.             for member in b.members:
  19.                 user = self.get_user(member.id)
  20.                 await user.send("Hello")
  21.  
  22. client = MyClient()
Advertisement
Add Comment
Please, Sign In to add comment