async def warn(ctx, member: discord.Member, time: int, reason = None, user: discord.User = None):
if user is None:
user = ctx.author
role = discord.utils.get(ctx.guild.roles, id = warnrole)
await member.add_roles(role)
channel = Bot.get_channel(logchannel)
emb = discord.Embed(title = "Предупреждение", color = 0x2f3136)
emb.set_thumbnail(url = user.avatar_url)
emb.add_field(name = 'Модератор', value = ctx.message.author.mention, inline = False)
emb.add_field(name = 'Нарушитель', value = member.mention, inline = False)
emb.add_field(name = 'Причина', value = reason, inline = False)
emb.add_field(name = "Время", value = time, inline = False)
await channel.send(embed = emb)