feat(discord): use bot auth instead of user

This commit is contained in:
Ali BARIN
2022-10-30 22:25:11 +01:00
parent 798769d5ae
commit c2b020fc94
5 changed files with 31 additions and 4 deletions

View File

@@ -1,9 +1,9 @@
import { TBeforeRequest } from '@automatisch/types';
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
const { tokenType, accessToken } = $.auth.data;
if (tokenType && accessToken) {
requestConfig.headers.Authorization = `${tokenType} ${accessToken}`;
const { tokenType, botToken } = $.auth.data;
if (tokenType && botToken) {
requestConfig.headers.Authorization = `Bot ${botToken}`;
}
return requestConfig;

View File

@@ -1,3 +1,3 @@
const scopes = ['identify', 'email'];
const scopes = ['bot', 'identify'];
export default scopes;