Disnake | Python Why for loop automatically breaks when loop finds the user?
Im developing my discord bot on python and I wanted to make curse words filter. There is a problem: when bot detects a curseword bot automatically searches for a user to send a notification to. But when bot finds a user he sends him a notification and breaks loop automatically.
How do I get the creator of a channel in on_guild_channel_create?
@bot.event async def on_guild_channel_create(channel): guild = channel.guild embed = disnake.Embed(color=disnake.Color.dark_gray(), title = “”, description = f’`{channel.name}` **Was created**’) embed.set_author(name=guild.name, icon_url=guild.icon.url) embed.add_field(name=””, value=f’:house: Created channel: `{channel.name}`’, inline=False) embed.add_field(name=f”Responsible Moderator: {}”, value = ”) embed.set_footer(text=f”Legione Straniera • Date of creation: {datetime.now(tz=moscow_tz).strftime(‘%B %d, %Y %H:%M’)}”) await disnake.utils.get(channel.guild.text_channels, id=1240402311147290685).send(embed=embed) embed.add_field(name=f”Responsible Moderator: {}”, value = ”) I need to mark […]
A problem with on_voice_state_update, python, disnake
@bot.event async def on_voice_state_update(member, before, after): if before.channel is None and after.channel is not None: print(“Участник присоединился к голосовому каналу”) embed = disnake.Embed(title=”Участник присоединился к голосовому каналу”, color=0x00ff00) embed.add_field(name=”Участник”, value=member.mention) embed.add_field(name=”ID участника”, value=member.id) embed.add_field(name=”Канал”, value=after.channel.mention) embed.add_field(name=”ID канала”, value=after.channel.id) await disnake.utils.get(member.guild.text_channels, id=1240402311147290685).send(embed=embed) elif before.channel is not None and after.channel is None: join_time = member.voice.joined_at.astimezone(moscow_tz).strftime(‘%Y-%m-%d %H:%M:%S’) leave_time […]