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
[x ] If code changes were made then they have been tested.
[ x] I have updated the documentation to reflect the changes.
This PR fixes an issue.
[x ] This PR adds something new (e.g. new method or parameters).
This PR is a breaking change (e.g. methods or parameters removed/renamed)
This PR is not a code change (e.g. documentation, README, ...)
Now, when doing
```py
for word in message:
print(word)
```
it will print all the words of the message, which are separated by a space!
## Summary
<!-- What is this pull request for? Does it fix any issues? -->
It is a PR so that the discord.Message can now be used in a for loop!
## Checklist
<!-- Put an x inside [ ] to check it, like so: [x] -->
- [x ] If code changes were made then they have been tested.
- [ x] I have updated the documentation to reflect the changes.
- [ ] This PR fixes an issue.
- [x ] This PR adds something new (e.g. new method or parameters).
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
- [ ] This PR is **not** a code change (e.g. documentation, README, ...)
Weird behaviour for a default, in my opinion, this should be chosen in user code via for word in str(message).split() or for word in message.content.split(), and yes, I know it would return every letter, that is what for char in string does so why not for char in message
Weird behaviour for a default, in my opinion, this should be chosen in user code via `for word in str(message).split()` or `for word in message.content.split()`, and yes, I know it would return every letter, that is what `for char in string` does so why not `for 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.
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.
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.
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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.contentalthough that is a stretch. DisapproveMay I know why do u think it is unnecessary?
Also,
yield from self.contentwould 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 stringdoes so why notfor char in messageYes, 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.contentalso 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