if str(member.status) == 'online':
d = "<:online2:842130462038425653> В сети"
elif str(member.status) == 'idle':
d = "<:away:842130479339667497> Не активен"
elif str(member.status) == 'dnd':
d = "<:dnd2:842130417406181436> Не беспокоить"
elif str(member.status) == 'offline':
d = "<:offline2:842130438209536000> Не в сети"
elif str(member.status) == "streaming":
d = "<:streaming:846048619571314719> Стримит"
@bot.command(name = "get-users") # Вместо bot пишете то, как вы обозвали его (client, app, mybot и т.п.)
async def get_users_(ctx, id):
guild = bot.get_guild(id)
members = guild.members
# Дальше делаете что вам нужно
@bot.command(name = "get-users")
async def get_users_(ctx, id):
guild = await bot.fetch_guild(id)
members = guild.members
# Дальше делаете что вам нужно
@bot.command(name = "get-users") # Вместо bot пишете то, как вы обозвали его (client, app, mybot и т.п.)
async def get_users_(ctx, id):
for guild in bot.guilds:
if guild.id == id:
members = guild.members
break
# Дальше делаете что вам нужно
users_list = []
for member in members:
users_list.append(member.id)
@commands.cooldown(1, (Время задержки), commands.BucketType.user)
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
embed = discord.Embed(
title = 'Команда на задержке.',
description = f'Повторить через `{error.retry_after :.0f} секунд',
colour = discord.Color.red()
)
return await ctx.send(embed = embed)
import mss
import vk_api
import requests
from random import randint
FILE_NAME = "1.png"
vk_session = vk_api.VkApi(token = 'ТУТ_ТОКЕН') # Можно получить вбив в Google
vk = vk_session.get_api()
with mss.mss() as sct:
sct.shot(output = FILE_NAME)
url = vk.photos.getMessagesUploadServer()['upload_url']
photo = requests.post(url, files = {'photo': open(FILE_NAME, 'rb')}).json()
save_ = vk.photos.saveMessagesPhoto(server = photo['server'], photo = photo['photo'], hash = photo['hash'])[0]
vk.messages.send(
user_id = 0, # ТУТ ID ЮЗЕРА
random_id = randint(-2147483648, 2147483647),
attachment = "photo%s_%s" % (save_['owner_id'], save_['id'])
)
import json
from discord import Embed
def get_embed(json_):
embed_json = json.loads(json_)
embed = Embed().from_dict(embed_json)
return embed
@bot.command(name = 'embed')
async def embed_send(ctx, channel: discord.TextChannel, *, args):
embed = get_embed(args)
if channel == "-":
await ctx.send(embed = embed)
else:
await channel.send(embed = embed)
def minus_heal(message):
while True:
time.sleep(5)
...
import discord
client = discord.Client()
Matrix = "▢"
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
global Matrix
if message.content.startswith("#on"):
Matrixsend = Matrix.replace(Matrix[0], "▣")
Matrix = Matrixsend
await message.channel.send(''+str(Matrix))
if message.content.startswith("#off"):
Matrixsend = Matrix.replace(Matrix[0], "▢")
Matrix = Matrixsend
await message.channel.send(''+str(Matrix))
client.run("Тут могла быть ваша реклама")