У меня есть бот-диск, запрограммированный на python.Я хочу, чтобы бот произнес первую часть шутки, time.sleep, а затем вторую часть шутки (обе в одной переменной).Это мой код:
if message.content.startswith('!joke'):
a = 'Can a kangaroo jump higher than a house?' + time.sleep(3) + 'Of course, a house doesn’t jump at all.'
b = 'Anton, do you think I’m a bad mother?' + time.sleep(3) + 'My name is Paul.'
c = 'Why can\'t cats work with a computer?' + time.sleep(3) + 'Because they get too distracted chasing the mouse around, haha!'
d = 'My dog used to chase people on a bike a lot.' + time.sleep(3) + 'It got so bad, finally I had to take his bike away.'
e = 'What do Italian ghosts have for dinner?' + time.sleep(3) + 'Spook-hetti!'
msg = random.choice([a, b, c, d, e]).format(message)
await client.send_message(message.channel, msg)
А это вывод консоли:
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Python\Python36\lib\site-packages\discord\client.py", line 307, in _run_event
yield from getattr(self, event)(*args, **kwargs)
File "archie_official.py", line 138, in on_message
a = 'Can a kangaroo jump higher than a house?' + time.sleep(3) + 'Of course, a house doesn’t jump at all.'
TypeError: must be str, not NoneType
Можете ли вы мне помочь?Спасибо.