summaryrefslogtreecommitdiff
path: root/src/utils/stripWebhookURL.ts
diff options
context:
space:
mode:
author8cy <[email protected]>2020-06-27 22:52:54 -0700
committer8cy <[email protected]>2020-06-27 22:52:54 -0700
commit80951013e391aab140800e4f386867e6c391553f (patch)
tree3d7101237ef1cd8d6fe2a2fab751a2dc55ae7d84 /src/utils/stripWebhookURL.ts
parentmore config shit (diff)
downloaddep-core-80951013e391aab140800e4f386867e6c391553f.tar.xz
dep-core-80951013e391aab140800e4f386867e6c391553f.zip
add ts defs so not a lot of errors left
- made .todo file for epic error tracking
Diffstat (limited to 'src/utils/stripWebhookURL.ts')
-rw-r--r--src/utils/stripWebhookURL.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils/stripWebhookURL.ts b/src/utils/stripWebhookURL.ts
index fa8c240..73a227c 100644
--- a/src/utils/stripWebhookURL.ts
+++ b/src/utils/stripWebhookURL.ts
@@ -3,9 +3,10 @@
* @param {string} url URL for the webhook from the Discord client
* @returns {Object} Object with the webhook ID and token
*/
-module.exports = url => {
+module.exports = (url: string) => {
const regex = /https:\/\/discordapp\.com\/api\/webhooks\/(\d{1,})\/([\w-_]{1,})/;
const matches = regex.exec(url);
+ //@ts-ignore dont care if null
return { id: matches[1], token: matches[2] };
}; \ No newline at end of file