-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AIP-16: Quote/reply messages #48
Comments
Not sure, if allow |
Good idea, new functionality can be added to bots with replies |
nice feature, agree with @MerdyNumber1 |
@adamant-al I think including nested JSON with another "rich" message is worth it. It will be easier to change UX/UI or add new functionality in the future. For example: adding an ETH icon for the reply message. Also the structure of reply_message that contains regular message can be changed to be more readable for checking. if (message.reply_message) {
/**
* {
* "replyto_id": "7452709338464950789",
* "reply_message": "I've got it. Will be there in time."
* }
*/
if (typeof message.reply_message === 'string') { // current version
// ...
} else if (message.reply_message.type.includes('transaction')) {
// ...
}
/**
* {
* "replyto_id": "7452709338464950789",
* "reply_message": {
* type: "text",
* text: "I've got it. Will be there in time."
* }
* }
*/
const { type: replyMessageType } = message.reply_message
// replyMessageType can be used in switch case statements
if (replyMessageType === 'text') {
// ...
} else if (replyMessageType.includes('transaction')) {
// ...
}
}
/**
* {
* "replyto_id": "7452709338464950789",
* "reply_text": "I've got it. Will be there in time."
* }
*/
if (message.reply_text) { // separate logic with rich objects
// ...
} else {
const { type: replyMessageType } = message.reply_message;
if (replyMessageType.includes('transaction')) {
// ...
}
} |
I've added a note in the AIP: field |
Don't you think that it's better to have only one field
|
It seems you mean {
"replyto_id": "7452709338464950789",
"type": "text",
"payload": "I've got it. Will be there in time."
}
{
"replyto_id": "7452709338464950789",
"type": "transfer",
"payload": {
"type": "ETH_transaction",
"amount": "0.002",
"comments": "I like to send it, send it",
"hash": "0xfa46d2b3c99878f1f9863fcbdb0bc27d220d7065c6528543cbb83ced84487deb"
},
} You'll have a code then
You expect {
"replyto_id": "7452709338464950789",
"type": "text",
"payload": { }
} or {
"replyto_id": "7452709338464950789",
"type": "text"
} So the field |
But exactly for this we'll validate the data, for example using validate.js |
Accepted as {
"replyto_id": "7452709338464950789",
"reply_message": "I've got it. Will be there in time."
} |
Discussing https://github.com/Adamant-im/AIPs/blob/master/AIPS/aip-16.md
The text was updated successfully, but these errors were encountered: