У меня есть 2 класса, один из которых содержит функцию, а затем другой, который содержит команду, я новичок в этом и не могу понять, как вызвать функцию.
Это функция, которую япытаюсь позвонить
private async Task<long> GetMemberId(string members)
{
long memberID = 0;
HttpResponseMessage response = await client.GetAsync(StaticObjects.bungieBasePath
+ $@"/GroupV2/Name/{memberID}/1/");
if (response.IsSuccessStatusCode)
{
try
{
dynamic content = response.Content.ReadAsAsync<ExpandoObject>().Result;
Debug.WriteLine(await response.Content.ReadAsStringAsync());
}
catch
{
throw new ArgumentException("The member could not be found.");
}
}
else
{
throw new ArgumentException("An error occurred retrieving the members information.");
}
return memberID;
}
Тогда это команда
[Command("invite")]
[RequireContext(ContextType.Guild, ErrorMessage = "This command is specific to a particular server so you must send it from a channel within that server")]
public async Task SendInviteAsync()
{
await Context.Channel.TriggerTypingAsync(new RequestOptions() { Timeout = 30 });
if (!Context.IsPrivate) await Context.Message.DeleteAsync();
if (StaticObjects.CheckUserIsAdmin(Context))
{
//command to call the memberid function
}
}