Answer the question
In order to leave comments, you need to log in
How to expect a random number input?
I have a python script, it asks to enter some message, after that it asks to enter a number in the range from 1 to 139, how can I get this number? discord.py library
if message.content == '!Databook':
channel = message.channel
await channel.send('Введите номер датабука (1-4)')
await channel.send('В таком формате: "Датабук 1" вместо 1 номер датабука')
def check(m):
return m.content == 'Датабук 1' and m.channel == channel
msg = await bot.wait_for('message', check=check)
await channel.send('Введите страницу (1-139)'.format(msg))
def check_two(m):
return m.content == # Вот тут надо получить число которое вводит пользователь(оно из диапазона 1-139)
Answer the question
In order to leave comments, you need to log in
def check_two(m):
m = m.content
return m.isdigit() and (1 <= int(m) <= 139)
def check_two(m):
m = m.content
return m.isdigit() and (1 <= int(m) <= 139)
DataBook_Page = await client.wait_for('message', check=check_two)
well and so on
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question