Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't send webhooks from C++ #1

Open
simonSlamka opened this issue Nov 10, 2021 · 0 comments
Open

Can't send webhooks from C++ #1

simonSlamka opened this issue Nov 10, 2021 · 0 comments

Comments

@simonSlamka
Copy link

simonSlamka commented Nov 10, 2021

Hey,

According to the docs, I've tried to set up a webhook using the following code:

void testClass::sendWebhook()
{
	FDiscordWebhookLibrary::GetWebhook
	(
		xxxxxxxxxxxxxxxxxxxxxx,
		FDiscordGetWebhook::CreateLambda([](const FDiscordWebhook& webhook) -> void
		{
			FDiscordWebhookData msgToBeSent;
	
			msgToBeSent.Username = "testing";
			msgToBeSent.Avatar = "none";
			msgToBeSent.Content = "xyz";
	
			FDiscordWebhookLibrary::ExecuteWebhook
			(
				webhook.Id,
				webhook.Token,
				msgToBeSent,
				FDiscordExecuteWebhook::CreateLambda([](bool& bMsgSent) -> void
				{
					if(bMsgSent)
					{
						//debugMsg("We've sent the message successfully!", FColor::Yellow);
					}
					else
					{
						//debugMsg("Failed to send the message!!", FColor::Red);
					}
				})
			);
		})
	);
}

Compiler says:

  Tuple.h(299): [C2672] 'Invoke': no matching overloaded function found
  DelegateInstancesImpl.h(836): [C2672] see reference to function template instantiation 'decltype(auto) UE4Tuple_Private::TTupleBase<TIntegerSequence<uint32>>::ApplyAfter<testClass::sendWebhook::<lambda_e4f3fa8472d3c32295e9391b719b6fe3>&,bool&,const FDiscordWebhook&>(FuncType,bool &,const FDiscordWebhook &) const' being compiled
  DelegateInstancesImpl.h(834): [C2672] while compiling class template member function 'bool TBaseFunctorDelegateInstance<void (bool,const FDiscordWebhook &),UserPolicy,testClass::sendWebhook::<lambda_e4f3fa8472d3c32295e9391b719b6fe3>>::ExecuteIfSafe(bool,const FDiscordWebhook &) const'
  DelegateSignatureImpl.inl(155): [C2672] see reference to class template instantiation 'TBaseFunctorDelegateInstance<void (bool,const FDiscordWebhook &),UserPolicy,testClass::sendWebhook::<lambda_e4f3fa8472d3c32295e9391b719b6fe3>>' being compiled
  testClass.cpp(199): [C2672] see reference to function template instantiation 'TDelegate<void (bool,const FDiscordWebhook &),FDefaultDelegateUserPolicy> TDelegate<void (bool,const FDiscordWebhook &),FDefaultDelegateUserPolicy>::CreateLambda<testClass::sendWebhook::<lambda_e4f3fa8472d3c32295e9391b719b6fe3>,>(FunctorType &&)' being compiled
  testClass.cpp(167): [C2672] see reference to function template instantiation 'TDelegate<void (bool,const FDiscordWebhook &),FDefaultDelegateUserPolicy> TDelegate<void (bool,const FDiscordWebhook &),FDefaultDelegateUserPolicy>::CreateLambda<testClass::sendWebhook::<lambda_e4f3fa8472d3c32295e9391b719b6fe3>,>(FunctorType &&)' being compiled
  Tuple.h(299): [C2893] Failed to specialize function template 'unknown-type Invoke(FuncType &&,ArgTypes &&...)'
  Invoke.h(48): [C2893] see declaration of 'Invoke'
  Tuple.h(299): [C2893] With the following template arguments:
  Tuple.h(299): [C2893] 'FuncType=testClass::sendWebhook::<lambda_e4f3fa8472d3c32295e9391b719b6fe3> &'
  Tuple.h(299): [C2893] 'ArgTypes={bool &, const FDiscordWebhook &}'
  Microsoft.MakeFile.targets(45, 5): [MSB3073] The command "D:\UE_4.26\Engine\Build\BatchFiles\Build.bat projectEditor Win64 Development -Project="D:\Unreal Projects\project\project.uproject" -WaitMutex -FromMsBuild" exited with code 6.

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant