From 5662546b6f72ee6596620e8463274c678030ae2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ma=C5=84czak?= <56172798+jakubmanczak@users.noreply.github.com> Date: Sun, 1 Aug 2021 14:46:46 +0200 Subject: [PATCH] add canary bot to bot status function & botcard component --- netlify/functions/bot-status.js | 10 ++++-- src/components/BotCard.vue | 58 ++++++++++++++++++++++++++++----- 2 files changed, 57 insertions(+), 11 deletions(-) diff --git a/netlify/functions/bot-status.js b/netlify/functions/bot-status.js index 82434ea..aa588fe 100644 --- a/netlify/functions/bot-status.js +++ b/netlify/functions/bot-status.js @@ -1,15 +1,21 @@ const axios = require('axios'); exports.handler = async function(event, context) { - let response = await axios.get(`https://discord.com/api/v9/users/@me`, { + let MainResponse = await axios.get(`https://discord.com/api/v9/users/@me`, { headers: { Authorization: `Bot ${process.env.token}`, }, }); + let CanaryResponse = await axios.get(`https://discord.com/api/v9/users/@me`, { + headers: { + Authorization: `Bot ${process.env.tokenCanary}`, + }, + }); return { statusCode: 200, body: JSON.stringify({ - info: response.data, + mainInfo: MainResponse.data, + canaryInfo: CanaryResponse.data, }), headers: { 'Content-Type': 'application/json', diff --git a/src/components/BotCard.vue b/src/components/BotCard.vue index 440e370..8cd2021 100644 --- a/src/components/BotCard.vue +++ b/src/components/BotCard.vue @@ -4,34 +4,74 @@
Gractwo bot current avatar -

{{ status.info.username + '#' + status.info.discriminator }}

+

+ {{ status.mainInfo.username + '#' + status.mainInfo.discriminator }} +

+
+ +
+
+ Gractwo Canary bot current avatar +

+ {{ + status.canaryInfo.username + '#' + status.canaryInfo.discriminator + }} +

bot card

Bot Name: - {{ status.info.username + '#' + status.info.discriminator }}
- Bot ID: {{ status.info.id }}
+ {{ status.mainInfo.username + '#' + status.mainInfo.discriminator }} +
+ Bot ID: {{ status.mainInfo.id }}
Bot Avatar:
- Bot Status: {{ status.status }}
- Bot Info: {{ status.info }} + Bot Info: {{ status.mainInfo }} +

+
+
+

sub bot card

+

+ Bot Name: + {{ status.canaryInfo.username + '#' + status.canaryInfo.discriminator }} +
+ Bot ID: {{ status.canaryInfo.id }}
+ Bot Avatar: + +
+ Bot Info: {{ status.canaryInfo }}