Merge branch 'master' of https://git.p2p.legal/axiom-team/ssb-g1like into dev-fred

This commit is contained in:
qo-op 2020-03-14 21:40:29 +01:00
commit 09e2f102c2
1 changed files with 4 additions and 8 deletions

View File

@ -3,23 +3,19 @@
# Authors:
# [@cel](@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519)
# [@Fred](@9BbJwPDjcyIqrOUPNn0nJZBduWdIrpMk3Cjz5MP361s=.ed25519)
# [@Boris](@l5nYExWYIgDLV6BYHOJPoI97jIUyTdSm8CTLpQ0XeOg=.ed25519)
# Version: 1.0
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
###########################################################################################
# ADD G1 Layer 10 LOVE to message writer you like !
# INSTALL silkaj sbotc
# PREVENT DOUBLE PAYEMENT
############################################################################################
fn_exists() {
# appended double quote is an ugly trick to make sure we do get a string -- if $1 is not a known command, type does not output anything
[ `type -t $1`"" == 'file' ]
}
###########################################################################################
####################### G1 SSB ACCOUNT MANAGER ############################################
###########################################################################################
##########################################################################################
# Let's get G1 public and private keys
g1pub=$(cat ~/.ssb/secret.dunikey | grep "pub" | cut -d ' ' -f 2)
g1priv=$(cat ~/.ssb/secret.dunikey | grep "sec" | cut -d ' ' -f 2)
@ -144,8 +140,8 @@ do
#### SEND 10 LOVE = 0.1 DU to $g1_author wallet
silkaj -p "$duniter_server" -af --file ~/.ssb/secret.dunikey tx --output $g1_author --amountUD 0.1 --comment "_SSB:LIKE:$target_id" -y 2>/dev/null
#### WRITE RESPONSE MESSAGE
sbotc publish '{"type":"post","text":"Thanks for this post ; I have just sent you G1 #libremoney. Claim it! ", "branch": "'"$target_id"'", "root": "'"$root_id"'"}'
sleep 60 # DO NOT OVER CHARGE DUNITER
sbotc publish '{"type":"post","text":"Thanks for this post ; I have just sent you G1 libre money. Use it with [Cesium](https://cesium.app). Get it from [https://git.p2p.legal/Axiom-Team/ssb-g1like](https://git.p2p.legal/Axiom-Team/ssb-g1like) ", "branch": "'"$target_id"'", "root": "'"$root_id"'"}' 2>&1>/dev/null
sleep 20 # DO NOT OVER CHARGE DUNITER
else
echo "I LIKE MY MESSAGE $target_id"
fi