0
@client.event
async def on_message(message):
    await client.process_commands(message)

    with open ('C:расположение', 'r') as f:
        users = json.load(f)
    async def update_data(users,user):
        if not user in users:
            users[user] = {}
            users[user]['exp'] = 0
            users[user]['lvl'] = 1
    async def add_exp(users,user,exp):
        users[user]['exp'] += exp
    async def add_lvl(users, user):
        pls = users [user]['exp']
        vls = users [user]['lvl']
        if pls > vls:
            await message.channel.send(f'{message.author.mention}LVL UP!')
            users[user]['exp'] = 0
            users[user]['lvl'] = vls + 1

            
             
    await update_data(users, str(message.author.id))
    await add_exp(users,str(message.author.id),0.1)
    await add_lvl(users,str(message.author.id))
#await вызывает функцию
    with open ('C:\расположение ', 'w') as f:
        json.dump(users,f)

Я хочу, чтобы после LVL UP шла пременная vls. Как это сделать?

1 ответ 1

2
await message.channel.send(f'{message.author.mention}LVL UP {vls}!')

Если я правильно вас понимаю

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.