Skip to content

Commit 5ee2ce4

Browse files
committed
Send random string as DM to avoid overzealous abuse detection
1 parent e53bb4f commit 5ee2ce4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

twitter.test.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,20 @@ it("should unfollow user", async () => {
147147

148148
it("should DM user", async () => {
149149
const client = newClient();
150+
const randomString = Math.random()
151+
.toString(36)
152+
.substr(2, 11);
150153

151154
// POST with body and no parameters per https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/guides/direct-message-migration.html
152155
const response = await client.post("direct_messages/events/new", {
153156
event: {
154157
type: "message_create",
155158
message_create: {
156159
target: {
157-
recipient_id: "15008676"
160+
recipient_id: "50426068"
158161
},
159162
message_data: {
160-
text: "Hello from twitter-lite"
163+
text: randomString
161164
}
162165
}
163166
}
@@ -169,7 +172,7 @@ it("should DM user", async () => {
169172
created_timestamp: expect.any(String),
170173
message_create: {
171174
message_data: {
172-
text: "Hello from twitter-lite"
175+
text: randomString
173176
}
174177
}
175178
}

0 commit comments

Comments
 (0)