Update message.py #28
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "patch-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Now, when doing
it will print all the words of the message, which are separated by a space!
Summary
It is a PR so that the discord.Message can now be used in a for loop!
Checklist
This seems massively unnecessary. If anything this should be
yield from self.content
although that is a stretch. DisapproveMay I know why do u think it is unnecessary?
Also,
yield from self.content
would return every letter separately, not every wordWeird behaviour for a default, in my opinion, this should be chosen in user code via
for word in str(message).split()
orfor word in message.content.split()
, and yes, I know it would return every letter, that is whatfor char in string
does so why notfor char in message
Yes, but I don't really think a user would need every letter of the content separately, but instead he would be needing every word. I don't really think there is a use to return every single letter of the word. Can I know any one good use case, where a person will be needing every single letter? I can tell u a few in which the user will be needing every word in the message content.
Neither should be added, this should be left as is, being an opt in (via
str(message)
ormessage.content
).Well, I don't really think there is any harm in adding this as a feature. If that is your argument, then why
str(message)
is there?message.content
also speaks for itself, as to what it does.Just do
message.content.split()
, don't need the library to do a simple string argument for you.str(message) exists because this is an extra feature, changing how you iterate over a string is a python builtin which should speak for itself more.
Pull request closed