#Making a simple math
1 messages · Page 1 of 1 (latest)
your answer is already an int
why would it not be
protip you can see the types of variables if you hover over them in most editors
your issue boils down to this
content is a str
answer is an int
so I compile answer to str by str(answer)
you convert it
compiling is a completely seperate thing you don't even really do in python :P
but yes, your idea is correct
Bot still not say "Congratulations" 
by the way how can I handle the timeout (if no right answer on time)
try except
I have edited the code, is this right?
I guess it werks
although I think you have to be the first person in history to use else in try except
sorry I have edited it Again
the timeout is now work but the answer is still not working 
I just slapped it in my bot
it werks
sooo
do you have message content intent?
can your bot see the channel?
besides all of the warnings lul
isn't "Administrator" giving fully access to the server?
Why is some information about my messages from MessageCreateEvent unavailable?
You may have not enabled the Message Content Intent. This had been a thing for bots from August 31st, 2022 onward. For more info, refer to https://support-dev.discord.com/hc/en-us/articles/4404772028055
Firstly, go to your discord developer portal. In your bot application, in the bot section, tick this to be on. (check the attached screenshot: https://i.imgur.com/8Ps9Boi.png)
Secondly, in your bot's code, add the highlighted lines:
[2;31mbot[0m [2;33m=[0m [2;36m[4;36mhikari[0m[2;36m[0m[4;2m.[0m[2;34m[4;34mGatewayBot[0m[2;34m[0m[2;33m( [2;30m# or [1;30m[4;30mlightbulb[0m[1;30m[0m[2;30m[1;30m[4;30m.[0m[1;30m[0m[2;30m[1;30m[4;30mBotApp[0m[1;30m[0m[2;30m[0m[2;33m[0m
[2;32m"your token"[0m,
[2;35m[2;40mintents[0m[2;35m[0m[2;33m[2;40m=[0m[2;33m[0m[2;36m[2;40mhikari[0m[2;36m[0m[2;40m.[0m[2;34m[2;40mIntents[0m[2;34m[0m[2;40m.[0m[2;34m[2;40mALL_UNPRIVILEGED[0m[2;34m[0m[2;40m | [0m[2;36m[2;40mhikari[0m[2;36m[0m[2;40m.[0m[2;34m[2;40mIntents[0m[2;34m[0m[2;40m.[0m[2;34m[2;40mMESSAGE_CONTENT[0m[2;34m[0m [2;30m# [1;30mAdd this line[0m[2;30m[0m
[2;33m)[0m
You should now receive all information about such messages. :)
Note: You will still receive this information for messages in which the bot is pinged and for any message in DMs, regardless of the intent.
how do I avoid these? sorry i'm new to Python 
well not using bare except is p straightforward
it is a bad practice because it handles all errors, not just the ones you want to handle
which may lead to errors being unintentionally eaten
ok so I've edited it again now is it look fine?
if you imported asyncio, I guess
Yes I've it imported, it's worked fine now
by the way I add except TimeoutError is it ok?
and how to avoid "x" is possibly unbound
same as "answer" is possibly unbound
well the answer is p much in the error
:P
make it not possibly be unbound
can you do an example please
if foo > bar:
x = 5
# x is possibly unbound if foo > bar
print(x)
i get it
erm, by the way
view = miru.View()
view.add_item(miru.text_select(
placeholder="Choose a number",
options=[miru.SelectOption(label="One",value="1")]
))
await ctx.respond(components=view.build())```
do you know why is this not work?