Closed klikevil closed 3 years ago
Ah, so the protocol is prpl-eionrobb-discord
(since it's not a built-in protocol, they get namespaced with the author of the plugin, generally)
The discord:goim
syntax won't work with the plugin, since that's trying to do some uri handling, but the plugin doesn't have any uri's to handle
Ah sweet!
229
Well that solved part of my question, would be cool to have some purple-remote/purple-send features documented for sending messages to others to this, but I understand that I'm probably like the only person that is asking for this so if you want to close it with prejudice you are more than welcome to. I really appreciate all your hard work on the project, it always impresses everyone seeing discord inside a console LOL.
From the looks of it, the goim will TRY to work, but it gives some weird results.
purple-remote attempted message send.
This user isn't directly on my friend's list but we are in mutual servers.
What I'm betting it is having trouble with is the 'discriminator'
Because manually through finch I can pull this information it just appears to be struggling with it when sent over the message bus for whatever reason.
All other functionalities work normally, can message this user fine without being mutual friends.
Figured it out gotta use %23 instead of # in the discriminator, thanks so much for your help @EionRobb !!
For anyone trying to figure out sending messages on discord via purple-remote the following works:
convert_to_bytecode ()
{
if [[ ! -x $(which hexdump) ]]; then
echo "Doesn't have hexdump, in PATH, bailing out." && return 1;
else
if [[ ! -n $(sed --help |& grep -i regexp.extended) ]]; then
echo "You are using a non-gnu version of sed that does not support extended regular expressions and i am too lazy to write the check for this and make it switch to perl, bailing out." && return 1;
fi;
fi && if [[ $# -lt 1 ]] && [[ ! -p /dev/fd/0 ]]; then
echo -e "Input what you want converted to hex followed by EOF [ ^D ] ( ctrl + d )\n";
cat - | hexdump -x | awk '{$1="";if($0) print $0}' | sed -re 's/([a-fA-F0-9]{2})([a-fA-F0-9]{2})/\\x\2\\x\1/g;s/\s//g' | tr -d '\n';
echo;
else
if [[ $# -gt 0 ]]; then
local shit_to_gethex=($@);
fi;
( if [[ ! -z ${shit_to_gethex[@]} ]]; then
echo -ne "${shit_to_gethex[@]}";
else
cat -;
fi ) | hexdump -x | awk '{$1="";if($0) print $0}' | sed -re 's/([a-fA-F0-9]{2})([a-fA-F0-9]{2})/\\x\2\\x\1/g;s/\s//g' | tr -d '\n';
echo;
fi
}
export username=their_user_name
export discriminator=their_4_digit_id
FOO=$(echo -e $'message' | convert_to_bytecode | sed -e 's/.x/%/g' -e 's/%00//g')
purple-remote "eionrobb-discord:goim?message=${FOO}&screenname=${username}%23${discriminator}"
I have not been able to figure out how to get chat messages to send though.
OS: gentoo software: Finch 2.13.0 (f07927902113041d6fa291293d9205ea4f05e9e6) order ~/h4x # ls -lash /usr/lib64/purple-2/libdiscord.so 792K -rwxr-xr-x. 1 root root 792K Sep 23 09:26 /usr/lib64/purple-2/libdiscord.so order ~/h4x # md5sum !$ md5sum /usr/lib64/purple-2/libdiscord.so 9828797d49339f1c2954c9e1cde491b6 /usr/lib64/purple-2/libdiscord.so
I'm not sure if I am just doing this wrong or what, I cannot seem to get purple-remote to send statuses.
This is the function i use to wrap purple remote and I launch finch with 'dbus-run-session finch'
purple-remote can getstatus
But oddly it cannot seem to get active accounts
purple-send seems to be able to return something:
Anyway I was wondering if you could help me out with the correct syntax or documentation for purple-send/purple-remote for your discord plugin thanks a million!