fix(Discord Node): When using OAuth2 authentication, check if user is a guild member when sending direct message (#9183)

This commit is contained in:
Michael Kret
2024-04-25 11:41:53 +03:00
committed by GitHub
parent d9e74949c4
commit 00dfad3279
11 changed files with 48 additions and 18 deletions

View File

@@ -114,9 +114,9 @@ export function prepareOptions(options: IDataObject, guildId?: string) {
return options;
}
export function prepareEmbeds(this: IExecuteFunctions, embeds: IDataObject[], i = 0) {
export function prepareEmbeds(this: IExecuteFunctions, embeds: IDataObject[]) {
return embeds
.map((embed, index) => {
.map((embed) => {
let embedReturnData: IDataObject = {};
if (embed.inputMethod === 'json') {
@@ -261,7 +261,7 @@ export async function checkAccessToChannel(
if (!guildId) {
throw new NodeOperationError(
this.getNode(),
`Could not fing server for channel with the id ${channelId}`,
`Could not find server for channel with the id ${channelId}`,
{
itemIndex,
},