Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
links = ["https", "http", "://", ".com", ".ru", ".net", ".org", ".gg"] @bot.event async def on_message(message): WARN = links guild = message.guild channel = bot.get_channel( ТУТ АЙДИ КАНАЛА ЛОГОВ ) administrator = discord.utils.get(message.author.guild.roles, id= ТУТ АЙДИ РОЛИ) if administrator in message.author.roles: pass else: for i in range(0, len(WARN)): if WARN[i] in message.content.lower(): await message.delete() embed = discord.Embed( title='Warn', description=f"Warning link from {message.author}", timestamp=message.created_at ) embed.add_field(name='Channel', value=message.channel.mention, inline = True) embed.add_field(name='User', value=message.author.mention, inline = True) embed.add_field(name='Type', value="Links", inline = True) embed.add_field(name='Message', value=message.content) await get(message.guild.text_channels, id= ТУТ АЙДИ КАНАЛА ЛОГОВ).send(embed=embed) await message.channel.send(f"{message.author.mention}, links are not allowed here! ❌") await bot.process_commands(message)
channel = ctx.message.channel.id await ctx.send(f'<#{channel}>')