Reputation: 23
I have a particularly large and resource-intensive command that takes a while to actually output anything. I was wondering if it were possible to create an ASCII progress bar that is constantly edited by the bot to indicate progress, perhaps similar to this:
Could this be possible, and how?
Upvotes: 1
Views: 597
Reputation: 51
You can call .edit()
on a message to change its contents.
progress_bar = await some_channel.send('=>..')
# after some things finish
await progress_bar.edit(content = '==>.')
# after some more things finish
await progress_bar.edit(content = '===>')
Calling .send()
will return a message
object that can be manipulated with any of the message methods.
relevant stack overflow post about editing message.
Upvotes: 1