From 0d23eaba09a4878520bf346af4cead90d76829fc Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Sun, 25 Sep 2022 18:24:21 +1000 Subject: Refactor to mono-repo + upgrade packages --- scripts/stresstest/src/message/send.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 scripts/stresstest/src/message/send.js (limited to 'scripts/stresstest/src/message/send.js') diff --git a/scripts/stresstest/src/message/send.js b/scripts/stresstest/src/message/send.js new file mode 100644 index 00000000..d21560d7 --- /dev/null +++ b/scripts/stresstest/src/message/send.js @@ -0,0 +1,23 @@ +const fetch = require("node-fetch"); +const fs = require("fs"); +var config = require("../../config.json"); +module.exports = sendMessage; +async function sendMessage(account) { + var body = { + fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw", + content: "Test", + tts: false + }; + var x = await fetch(config.url + "/channels/" + config["text-channel"] + "/messages", { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: account.token + }, + body: JSON.stringify(body) + }); + console.log(x); + x = await x.json(); + console.log(x); + return x; +} -- cgit 1.5.1