Comme je relance une campagne massive concernant la Principauté, notamment du cÎté de #DUO, mais pas que, j'alloue une partie de mon temps pour le site web.
J'ai dĂ©jĂ refais en partie la page de garde de https://principalityofbastion.org, mais j'ai Ă©galement rendu le marchĂ© plus autonome dans son reporting puisque dĂšs Ă prĂ©sent, chaque mouvement sur le marchĂ© MiNaVA (Micro Nation Virtual Assets) est monitorĂ© sur notre discord, sans l'aide de MAKE qui n'arrĂȘtait pas de se mettre en indisponible pour nous faire comprendre que "La vie est plus jolie quand t'es abonnĂ©"...
Je vous partage le code avec plaisir:
Dans le code vous trouverez l'adresse d'un webhook, vous devrez créer le votre.
language JavaScript
async function envoyerWebhook({
typeTransaction,
categorie,
detail,
prix = null,
token = null,
vendeur = null,
acheteur = null,
envoyeur = null,
destinataire = null,
proprietaire = null
}) {
const webhookUrl = "https://discord.com/api/webhooks/votrepropre/lienwebhook";
const imageUrl = `https://votresiteweb/${categorie}${detail}.png`;
let title = "";
let fields = [];
switch (typeTransaction) {
case "Mise en vente":
title = "đ Mise en vente d'un NFT";
fields.push(
{ name: "Prix", value: `${prix} ${token}`, inline: true },
{ name: "Vendeur", value: vendeur, inline: true }
);
break;
case "Achat":
title = "đ Achat d'un NFT";
fields.push(
{ name: "Prix", value: `${prix} ${token}`, inline: true },
{ name: "Vendeur", value: vendeur, inline: true },
{ name: "Acheteur", value: acheteur, inline: true }
);
break;
case "Transfert":
title = "đ Transfert d'un NFT";
fields.push(
{ name: "Envoyeur", value: envoyeur, inline: true },
{ name: "Destinataire", value: destinataire, inline: true }
);
break;
case "Annulation de vente":
title = "đ« Annulation de vente d'un NFT";
fields.push(
{ name: "Propriétaire", value: proprietaire, inline: true }
);
break;
default:
console.error("Type de transaction inconnu");
return;
}
const payload = {
embeds: [
{
title: title,
description: "Mouvement dĂ©tectĂ© sur les NFT MiNAVA đš",
color: 0x5865F2, // Un joli bleu Discord
thumbnail: {
url: imageUrl
},
fields: fields
}
]
};
try {
const response = await fetch(webhookUrl, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload)
});
if (response.ok) {
console.log("â
Message envoyé avec succÚs !");
} else {
console.error(`â Erreur : ${response.status}`, await response.text());
}
} catch (error) {
console.error("â Erreur d'envoi :", error);
}
}
AprÚs j'ai simplement du installer un call vers "envoyerwebhook" selon les 4 actions possibles dans le marché : Achat, mise en vente, annulation de vente et transfert...
Comme vous pouvez le voir, c'est assez simple, cela Ă©vite d'ĂȘtre dĂ©pendant, et cela fonctionne bien :
Ainsi, si notre campagne atteint son but et que le Bastion rencontre enfin son public, on aura au moins l'information en direct :)
Dans les jours qui suivront, je m'attacherai à terminer la page de garde, ensuite nous verrons pour intégrer le pricing de l'ECU en live, et pourquoi pas tenter d'avoir des outils d'achat vente liés à l'ECU.
J'avance à mon aise... Car de l'autre cÎté, je planche toujours sur l'activité artistique possible et la recherche d'un emploi en simultané, l'un ou l'autre me conviendrait fort bien...
A demain donc, et belle journée à tous...
Si vous aimez mon travail ou mes projets, n'hésitez pas à visiter notre marché aux NFT :)
Accessible depuis https://www.principalityofbastion.org, ou en direct sur https://nft.bastion.city/Market.html
Best regards,
âđŽđđđđđ đČđĂŻđđâ Prince of Principality of Bastion
ââââââââââââââââââââââââââââââââââââââââ
Discord : https://discord.principalityofbastion.org
Website : https://principalityofbastion.org / https://nft.bastion.city
Social Networks: See on our website.
Founder of the Principality of Bastion
C'est bien, ça avance !
!PIZZA
!LOL
!HUG
journalier
!hivebits
florenceboens, you mined 1.0 đ§ HBIT. If you'd replied to another Hive user, the HBIT would be split: 0.9 to you and 0.1 to them as a tip. When you mine HBIT, you're also playing the Wusang: Isle of Blaq game. đŽââ ïž
Sorry, but you didn't find a bonus treasure token today. Try again tomorrow...they're out there! Your random number was 0.8608501832019156, also viewable in the Discord server, #hbit-wusang-log channel. | tools | wallet | discord | community | daily <><
Check for bonus treasure tokens by entering your username at a block explorer A, explorer B, or take a look at your wallet.
There is a treasure chest of bitcoin sats hidden in Wusang: Isle of Blaq. Happy treasure hunting! đ Read about Hivebits (HBIT) or read the story of Wusang: Isle of Blaq.
lolztoken.com
Single service.
Credit: reddit
@itharagaian, I sent you an $LOLZ on behalf of florenceboens
(3/10)
Farm LOLZ tokens when you Delegate Hive or Hive Tokens.
Click to delegate: 10 - 20 - 50 - 100 HP
Faut espérer que cela fasse effet aussi, si personne n'utilise ou joue avec les nft, ben ... j'aurai fait tout cela pour rien, mdr
!LOL
lolztoken.com
She's not sick, or anything - I just think she can get better..
Credit: reddit
@florenceboens, I sent you an $LOLZ on behalf of itharagaian
(2/10)
Farm LOLZ tokens when you Delegate Hive or Hive Tokens.
Click to delegate: 10 - 20 - 50 - 100 HP
$PIZZA slices delivered:
faustine.books tipped itharagaian
hivecurious tipped itharagaian
@itharagaian(1/10) tipped @hivecurious
isiksenpalvoja tipped itharagaian
florenceboens tipped itharagaian
Come get MOONed!
bonne continuation pour la suite.
!PIZZA
!LOL
!HUG
lolztoken.com
You will be mist.
Credit: reddit
@itharagaian, I sent you an $LOLZ on behalf of isiksenpalvoja
(2/10)
Farm LOLZ tokens when you Delegate Hive or Hive Tokens.
Click to delegate: 10 - 20 - 50 - 100 HP
MErci
!ALIVE
on travaille un peu, puis on se détend un peu ;)
!PIZZA
!LOL
!HUG
lolztoken.com
That was a very fuelish thing to do.
Credit: reddit
@itharagaian, I sent you an $LOLZ on behalf of faustine.books
(2/10)
Delegate Hive Tokens to Farm $LOLZ and earn 110% Rewards. Learn more.
c'est cela mĂȘme
!LOL
lolztoken.com
He'll stop at nothing to avoid them.
Credit: reddit
@faustine.books, I sent you an $LOLZ on behalf of itharagaian
(3/10)
Farm LOLZ tokens when you Delegate Hive or Hive Tokens.
Click to delegate: 10 - 20 - 50 - 100 HP
!LOLZ
!ALIVE
lolztoken.com
Bartender: Are you positive?
Credit: theabsolute
@itharagaian, I sent you an $LOLZ on behalf of gestion.alive
(7/10)
Delegate Hive Tokens to Farm $LOLZ and earn 110% Rewards. Learn more.
!ALIVE
!LOLZ
!ALIVE
!LOLZ
lolztoken.com
He was convicted for mass murder.
Credit: reddit
@itharagaian, I sent you an $LOLZ on behalf of hive-103505
(5/10)
Delegate Hive Tokens to Farm $LOLZ and earn 110% Rewards. Learn more.
!LOL
lolztoken.com
Every judge knows bananas splits.
Credit: reddit
@hive-103505, I sent you an $LOLZ on behalf of itharagaian
(7/10)
Farm LOLZ tokens when you Delegate Hive or Hive Tokens.
Click to delegate: 10 - 20 - 50 - 100 HP
!PIZZA
!BBH
!INDEED đ
!INDEED
!PIZZA