-
Notifications
You must be signed in to change notification settings - Fork 72
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
Chat.deleteMessage() doesn't seem to work #14
Comments
I deleted the string check in Chat.deleteMessage() (chat.js line 149) and used number id instead. It worked but I could only delete user's messages, not the character's ones. I did try deleting both messages with Edited it but still couldn't delete character's messages. |
Ran a couple of times, sometimes I managed to delete the character's messages. Inconsistency in the POST request I guess? |
Hello, I'm investigating this issue, I will let you know. |
Hello, i've found an issue that is worth noting that i will fix: |
Hello, Its been around an hour i've been trying to mess around and fix the delete message stuff. For some reason, no matter what I try, I cannot find a way to fix the deletion. I've tried a lot of things so far, but I really cant fix it.... I will keep investigating but for now its broken. Sorry! |
Hello! ive seem to notice that the message ids that the website delete and the ones that are fetched then deleted are diferent.. Website json output: {
"messages": [
{
"id": 123372037927012370,
"text": "Shogun: No salutations needed. My exalted status shall not be disclosed as we travel among the common folk. I acknowledge that you are a person of superior ability. Henceforth, you will be my guard. Worry not. Should any danger arise, I shall dispose of it.",
"src": "12fb7ac8-1414-424a-96a4-20a9f28f973a",
"tgt": "15b2701a-7cc2-4347-99a6-1237f1351a26",
"is_alternative": false,
"image_rel_path": "",
"image_prompt_text": "",
"deleted": null,
"src__name": "Raiden Shogun and Ei",
"src__user__username": "internal_id:64965:9bede7ad-da75-4ad8-a2e3-9f2972ae7dad",
"src__is_human": false,
"src__character__avatar_file_name": "uploaded/2022/10/20/FcaryjLtFi7uJMs4OYvG_1A5vSyUA8u2pu05F3iyYoM.webp",
"src_char": {
"participant": {
"name": "Raiden Shogun and Ei"
},
"avatar_file_name": "uploaded/2022/10/20/FcaryjLtFi7uJMs4OYvG_1A5vSyUA8u2pu05F3iyYoM.webp"
},
"responsible_user__username": "Zap"
},
{
"id": 123372037927307650,
"text": "hello",
"src": "15b2701a-7cc2-4347-99a6-1237f1351a26",
"tgt": "12fb7ac8-1414-424a-96a4-20a9f28f973a",
"is_alternative": false,
"image_rel_path": "",
"image_prompt_text": "",
"deleted": null,
"src__name": "coloride",
"src__user__username": "oppsWalker",
"src__is_human": true,
"src__character__avatar_file_name": null,
"src_char": {
"participant": {
"name": "coloride"
},
"avatar_file_name": null
},
"responsible_user__username": null
},
{
"id": 123372037927307660,
"text": "Shogun: How dare you take liberty without addressing this superior entity as the Raiden Shogun. You are but an insignificant speck of dust on this earth. I suggest you refrain from disturbing further. Your ignorance makes me sick, but if you keep your nose to the ground and continue to work hard, one day, there may be a place for you in my rule. Until then, I'll keep my eye on you too, lest you prove to be a worthless underling.",
"src": "12fb7ac8-1414-424a-96a4-20a9f28f973a",
"tgt": "15b2701a-7cc2-4347-99a6-1237f1351a26",
"is_alternative": false,
"image_rel_path": "",
"image_prompt_text": "",
"deleted": null,
"src__name": "Raiden Shogun and Ei",
"src__user__username": "internal_id:64965:9bede7ad-da75-4ad8-a2e3-9f2972ae7dad",
"src__is_human": false,
"src__character__avatar_file_name": "uploaded/2022/10/20/FcaryjLtFi7uJMs4OYvG_1A5vSyUA8u2pu05F3iyYoM.webp",
"src_char": {
"participant": {
"name": "Raiden Shogun and Ei"
},
"avatar_file_name": "uploaded/2022/10/20/FcaryjLtFi7uJMs4OYvG_1A5vSyUA8u2pu05F3iyYoM.webp"
},
"responsible_user__username": null
},
{
"id": 123372037927327650,
"text": "okey",
"src": "15b2701a-7cc2-4347-99a6-1237f1351a26",
"tgt": "12fb7ac8-1414-424a-96a4-20a9f28f973a",
"is_alternative": false,
"image_rel_path": "",
"image_prompt_text": "",
"deleted": null,
"src__name": "coloride",
"src__user__username": "oppsWalker",
"src__is_human": true,
"src__character__avatar_file_name": null,
"src_char": {
"participant": {
"name": "coloride"
},
"avatar_file_name": null
},
"responsible_user__username": null
},
{
"id": 123372037927327660,
"text": "Shogun: Inappropriate! I do not recall allowing you to address me in such a casual manner! The lack of politeness you have shown me is the height of discourtesy. In return, I too shall show you my lack of courtesy by casting you down into oblivion!",
"src": "12fb7ac8-1414-424a-96a4-20a9f28f973a",
"tgt": "15b2701a-7cc2-4347-99a6-1237f1351a26",
"is_alternative": false,
"image_rel_path": "",
"image_prompt_text": "",
"deleted": null,
"src__name": "Raiden Shogun and Ei",
"src__user__username": "internal_id:64965:9bede7ad-da75-4ad8-a2e3-9f2972ae7dad",
"src__is_human": false,
"src__character__avatar_file_name": "uploaded/2022/10/20/FcaryjLtFi7uJMs4OYvG_1A5vSyUA8u2pu05F3iyYoM.webp",
"src_char": {
"participant": {
"name": "Raiden Shogun and Ei"
},
"avatar_file_name": "uploaded/2022/10/20/FcaryjLtFi7uJMs4OYvG_1A5vSyUA8u2pu05F3iyYoM.webp"
},
"responsible_user__username": null
}
],
"has_more": false,
"next_page": 0
} My program:
Website: {"history_id":"Mh8IVB-sIJFn3WBnNolSDVb3MgSWJ_SzpEM53If0t5Y","ids_to_delete":[123372037927307647,123372037927307661,123372037927327653,123372037927327664],"regenerating":false} |
For now, I will hold this ticket as a priority for the next update. |
Turns out you will lose some digits if you use large numbers: https://stackoverflow.com/questions/15529337/prevent-javascript-number-function-from-rounding-big-numbers Which is why our ids always end with 0, which are not actual ids. |
That makes sense, how do you think I should go around this? |
Weird that they want number ids instead of string. My solution is to use something like json-bigint to parse the response. That way we can get their ids as BigInt, then stringify those numbers back when we post the delete request. |
Ok thank you! I will try to do that tomorrow.
I will keep you up to date.
Le dim. 12 mars 2023 à 21:47, saki64 ***@***.***> a écrit :
… Weird that they want number ids instead of string. My solution is to use
something like json-bigint <https://github.com/sidorares/json-bigint> to
parse the response. That way we can get their ids as BigInt, then stringify
those numbers back when we post the delete request.
—
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZ4WO5MNUDHHQZCDFHYXA43W3YY6XANCNFSM6AAAAAAVXWGTSU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Tested it out, it kinda worked. Just needed to replace all |
Hello! I've ported to the JSONBig dependency and added it in the package.json for the next update. I will keep you updated. |
[Roadmap] Sum up of update goals:
This will be updated overtime. |
My code seems to be broken after the recent CAI maintenance. chat returns undefined. |
I think they're doing things to make it harder to scrap with cloudflare or
something. I will try to fix when I come home. Thanks for reporting the
issue, i will investigate.
Le mar. 14 mars 2023 à 08:12, saki64 ***@***.***> a écrit :
… My code seems to be broken after the recent CAI maintenance. chat returns
undefined.
—
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZ4WO5MZ3QDKWNWQHFPNSMTW4AK43ANCNFSM6AAAAAAVXWGTSU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Merging all updates for |
I tried deleting a message with
const response = await chat.sendAndAwaitResponse(message, true); ... await chat.deleteMessage(response.lastUserMessageId.toString());
Received no error, but the message was not deleted on the site.
The text was updated successfully, but these errors were encountered: