Home>
I want to change the status every second in discord.py.
Error message
Corresponding source code
@ bot.event
for i in range (0, 100, 1):
time.sleep (1)
await bot.change_presence (activity = discord.Game (name = f "connecting | .help | made by @kocha! # 6958 | {len (bot.guilds)} server | {i} seconds passed"))
What I tried
Because it is an indentation error
for i in range (0, 100, 1):
I erased the indent before
SyntaxError: invalid syntax
Was a syntax error ...
python 3.9.0
discord 1.5.1.
VScode 2019
-
Answer # 1
Related articles
- about processing to exclude the character string group specified from list in python
- python about iterative processing with specified numbers
- python 3x - i'm not sure about asynchronous processing (asyncio)
- python - please tell me about the processing contents of opencv background subtraction
- about image output of python
- i don't know the order of processing higher-order functions in python
- json - question about jq → i want to divide the processing according to the presence or absence of the deep key
- multiple classification score calculation errors, python, svm
- python - about image display and position of main ()
- python 3x - [python] i want to compare multiple dictionaries and remove duplicate dictionaries
- python 3x - about the amount of data for object detection using machine learning
- python 3x - about functions used in python for statement
- php - about the multiple structure of laravel's many-to-many relations
- python 3x - please teach about the exchange of information with qthead
- about the cause of the error in python pdto_datetime
- python - about x-axis adjustment in matplotlib
- python - about "" "of" "" select === = "" "
- python, about the fire spread step of forest fire simulation
- python - about hamiltonian neural networks
Related questions
- python - i want to change the csv file name every time i loop with the for in syntax and save it in the specified folder
- python - about write loop to csv
- python - a program that converts ordinal data to paired comparison data (i want to create a winning/losing matrix by turning a d
- python - typeerror when calculating the array of images called by imageopen ()
Isn't it like this?
@ bot.event
Is a decorator, which is a rule to put before a function.And let's specify the block with indent for the part you want to iterate with the for statement.