feat: better erroring for X

This commit is contained in:
Nevo David 2025-08-02 14:26:30 +07:00
parent da77c227c1
commit 69e39b91b3
1 changed files with 14 additions and 0 deletions

View File

@ -34,6 +34,20 @@ export class XProvider extends SocialAbstract implements SocialProvider {
value: string;
}
| undefined {
if (body.includes('usage-capped')) {
return {
type: 'refresh-token',
value:
'Posting failed - capped reached. Please try again later',
};
}
if (body.includes('duplicate-rules')) {
return {
type: 'refresh-token',
value:
'You have already posted this post, please wait before posting again',
};
}
if (body.includes('The Tweet contains an invalid URL.')) {
return {
type: 'bad-body',