Update message.py
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!
This commit is contained in:
parent
9356e385d8
commit
e04f3a1326
@ -451,6 +451,10 @@ class Message(Hashable):
|
||||
.. describe:: hash(x)
|
||||
|
||||
Returns the message's hash.
|
||||
|
||||
.. describe:: iter(x)
|
||||
|
||||
Returns an iterator of words of the message, separated by a space
|
||||
|
||||
Attributes
|
||||
-----------
|
||||
@ -606,6 +610,9 @@ class Message(Hashable):
|
||||
|
||||
def __int__(self):
|
||||
return self.id
|
||||
|
||||
def __iter__(self):
|
||||
yield from self.content.split()
|
||||
|
||||
def __repr__(self):
|
||||
return '<Message id={0.id} channel={0.channel!r} type={0.type!r} author={0.author!r} flags={0.flags!r}>'.format(self)
|
||||
|
Loading…
x
Reference in New Issue
Block a user