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
@ -452,6 +452,10 @@ class Message(Hashable):
|
|||||||
|
|
||||||
Returns the message's hash.
|
Returns the message's hash.
|
||||||
|
|
||||||
|
.. describe:: iter(x)
|
||||||
|
|
||||||
|
Returns an iterator of words of the message, separated by a space
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
-----------
|
-----------
|
||||||
tts: :class:`bool`
|
tts: :class:`bool`
|
||||||
@ -607,6 +611,9 @@ class Message(Hashable):
|
|||||||
def __int__(self):
|
def __int__(self):
|
||||||
return self.id
|
return self.id
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
yield from self.content.split()
|
||||||
|
|
||||||
def __repr__(self):
|
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)
|
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