#text length
1 messages · Page 1 of 1 (latest)
len()
With len()
There was a question "im bob?" but sends numbers. I do not understand something?
Did I do it right?
len(message) will give you the number of characters, including whitepsaces, in the string
This is understandable, but how can I get my question instead of numbers?
This cogs, you said to use len(), did I use it correctly? It's just that if yes, then I get numbers instead of a message and it doesn't matter how many messages I had
because you're sending the length of the message in your embed response.
and how to make it so that there is a message text instead, I can’t understand this
remove the len()
I highly suggest you stop what you're trying to do and go learn some python.
good idea, but I need to fix this error
It's a user error. See previously linked solution to resolve.
I highly suggest you actually do go read through that wiki and do some of those courses, however, the issue is mostly you not clearly explaining what you're after.
You asked for the "text length" then you're asking why it's now showing the length of the text instead of the text itself. This is confusing. Could you clearly state what it is you're trying to do?
hmm..
Could you provide a better explanation of the issue?
look, I need to make sure that the text is limited so that you can send not a large number of messages, but for example the answer to the ball "The weather is great?" , this is what is needed so that it is not just a flood, but a question
it's easier? I just don't know how to explain it

As I understand it, there is no answer to this question, if this bot has this then it will also be present in mine and this cannot be changed
ok, thanks for the help, topic closed
Then you need to check the length of the message.
something like:
if len(message) > 100:
# this block is executed if the length of the
# message exceeds 100 characters
return # some error message or something
embed = disnake.Ember(description = message)
I understand it worked, but how to notify a person who writes more than 100 messages that the maximum is 100?
just when I write more than 100 messages sends me
you need to respond if the len does exceed 100 characters
# trim any added whitespace at the end of the message
# "Hi, I'm DLCHAMP " becomes "Hi, I'm DLCHAMP"
message = message.strip()
if len(message) > 100:
return await inter.response.send_message('Messages cannot exceed 100 characters', ephemeral=True)
# message is good length, execute rest of code
good
only because of "message = message.trim()" gave an error, removed it and everything worked, thanks
it's strip() not trim() I'm working on something in excel and my brain mixed them up
Please use /solved if this has been solved.