- Make sure you’re logged on to the Discord website.
- Navigate to the application page.
- Click on the bot you want to enable privileged intents for.
- Navigate to the bot tab on the left side of the screen.
- Scroll down to the “Privileged Gateway Intents” section and enable the ones you want.
By default, this function will return the data as encoded bytes. The actual encoding of the output data may depend on the command being invoked, so the decoding to text will often need to be handled at the application level.
bot = discord.ext.commands.Bot(command_prefix = "|");
bot.run("ТОКЕН")
client = discord.Client()
client.run('ТОКЕН')
class discord.ext.commands.Bot
Represents a discord bot.
This class is a subclass of discord.Client and as a result anything that you can do with a discord.Client you can do with this bot.
This is a dictionary that maps module names to modules which have already been loaded. This can be manipulated to force reloading of modules and other tricks.
This function should be called if any modules are created/installed while your program is running to guarantee all finders will notice the new module’s existence.
import time
for i in range(100):
time.sleep(1)
print($"{i}%")
import time
def run_script(on_progress):
for i in range(100):
time.sleep(1)
on_progress(i)
if __name__ == '__main__':
run_script(lambda i: print($"{i}%"))
from script_a import run_script
def my_progress(i):
pass # показываешь прогресс скрипта
run_script(my_progress)