summary refs log tree commit diff
path: root/api/scripts/stresstest/src/message/send.js
diff options
context:
space:
mode:
authorSamuel <34555296+Flam3rboy@users.noreply.github.com>2021-12-09 17:37:36 +0100
committerGitHub <noreply@github.com>2021-12-09 17:37:36 +0100
commit14cf8495c7df357f8304f6da7c8dd5ac56cba47b (patch)
tree10f5af6473a25ce7ed115478b6601b387a5859e1 /api/scripts/stresstest/src/message/send.js
parentMerge pull request #538 from Thesourtimes/master (diff)
parentStresstest Script (diff)
downloadserver-14cf8495c7df357f8304f6da7c8dd5ac56cba47b.tar.xz
Merge pull request #539 from TimSchweiz/master
Diffstat (limited to 'api/scripts/stresstest/src/message/send.js')
-rw-r--r--api/scripts/stresstest/src/message/send.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/api/scripts/stresstest/src/message/send.js b/api/scripts/stresstest/src/message/send.js
new file mode 100644

index 00000000..1f8af8aa --- /dev/null +++ b/api/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; +}