Skip to content

Commit da0b8b1

Browse files
committed
Merge branch 'hotfix/fix-discord-client-discord.py2.0' into main
2 parents 18a34ee + 8264b18 commit da0b8b1

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Pyttman Changelog
22

33

4+
# V 1.2.1.1
5+
This is a hotfix release, addressing an issue with the integration with discord.py 2.0 API
6+
were Pyttman incorrectly parsed the 'channel' property for the message.
7+
8+
9+
### **🐛 Splatted bugs and corrected issues**
10+
* Fixes the discord integration
11+
12+
413
# V 1.2.1
514
This release includes an important update for the discord client.
615
Any application using Pyttman will need to upgrade to this version for the

pyttman/clients/community/discord/client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,13 @@ async def on_message(self, message: DiscordMessage) -> None:
109109
:param message: discord.Message
110110
:return: None
111111
"""
112-
print("Message recieved:", message)
113112
if message.author == self.user:
114113
return
115114

116115
# Add the client to the attributes, passed on to the message object
117-
attrs = {"created": datetime.now(), "client": self}
116+
attrs = {"created": datetime.now(),
117+
"client": self,
118+
"channel": message.channel}
118119

119120
for attr_name in message.__slots__:
120121
try:
@@ -134,9 +135,10 @@ async def on_message(self, message: DiscordMessage) -> None:
134135
self.message_endswith):
135136
return
136137

137-
reply: Reply | ReplyStream = self.message_router.get_reply(
138-
discord_message)
139138
try:
139+
reply: Reply | ReplyStream = self.message_router.get_reply(
140+
discord_message)
141+
140142
if isinstance(reply, ReplyStream):
141143
while reply.qsize():
142144
await discord_message.channel.send(reply.get().as_str())

pyttman/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
__version__ = "1.2.1"
2+
__version__ = "1.2.1.1"

0 commit comments

Comments
 (0)