Closed aspwil closed 3 years ago
I figured out the problem, instead of running jid_to_username(chat_message.body)
which calls this
def jid_to_username(jid):
return jid.split('@')[0][0:-4]
I added a
def jid_to_message(jid):
return jid.split('@')[0]
and called that when fetching the message
looking back on this jid_to_message
is redundant, what actually need to be done is the changing of jid_to_username(chat_message.body)
under def on_group_message_received
to just chat_message.body
Yep, nice catch. I fixed this in d64551195c5afb5b03c854a5e7f84a77c98fe06c.
whenever a message from a group is received it is displayed with the last 4 characters missing.
an example is if someone sends the message "Hello World" the terminal prints out something like this Math helpers - t373(long string): Hello W the last 4 chars are lost
this does not affect the messages received via dm though, only in group messages. leading me to believe it might be caused by
jid_to_username(chat_message.body)
underdef on_group_message_received
and its malforming the string somehow.I have tried to fix this myself but I have just started python today so I'm not sure exactly how to fix it.