async def type(ctx):
words = "Hello"
for x in words:
await ctx.send(x)
time.sleep(0.1)
Output:
H
e
l
l
o
They are not displayed in one line. What must I do to fix this problem?
async def type(ctx):
words = "Hello"
for x in words:
await ctx.send(x)
time.sleep(0.1)
Output:
H
e
l
l
o
They are not displayed in one line. What must I do to fix this problem?
Goldwave
On
This is not possible by sending messages, you need to edit them.
Example of editing your message. The only modification needed for your code, is to first send 'H' as a regular message. Then edit that message, appending a new character at a time.
Copyright © 2021 Jogjafile Inc.
You are sending a new message for every iteration of your loop, use Message.edit instead. Also, you need to use asyncio.sleep in place of
time.sleepin async functions.So something like:
Note that discord will likely rate limit you if you do this with longer messages.