@bot.event
async def on_message(m):
if m.content == "Привет":
await m.author.send("как дела?")
if m.guild is None and not m.author.bot:
if m.content == "нормально":
guild = bot.get_guild('906828207645392906')
member = discord.utils.get(guild.members, name=m.member.name)
role = discord.utils.get(member.guild.roles, id=908718776525135922)
await member.add_roles(role)
@bot.event
async def on_message(m):
if m.content == "Привет.":
await m.author.send("Как дела?")
if m.guild is None and not m.author.bot:
if m.content == "Нормально":
guild = bot.get_guild('906828207645392906')
member = discord.utils.get(guild.members, name='Foo')
role = discord.utils.get(member.guild.roles, id=908718776525135922)
await member.add_roles(role)