Update Group.cs

The following commands: GroupBan, GroupEject, GroupInvite
will no longer wait for group data to update and will issue the command asap
for best results please also use a avatars uuid.
This commit is contained in:
Madpeterz 2021-03-06 15:44:33 +00:00
parent 8724e9efd7
commit bd8dd13efd

View file

@ -117,15 +117,10 @@ namespace BetterSecondBot.HttpService
{ {
return Failure("Invaild ban state"); return Failure("Invaild ban state");
} }
if (bot.NeedReloadGroupData(groupuuid) == true)
{
bot.GetClient.Groups.RequestGroupMembers(groupuuid);
}
ProcessAvatar(avatar); ProcessAvatar(avatar);
KeyValuePair<bool, string> reply = waitForReady(true, true, groupuuid); if(avataruuid == UUID.Zero)
if (reply.Key == false)
{ {
return Failure(reply.Value); return Failure("avatar lookup");
} }
GroupBanAction action = GroupBanAction.Unban; GroupBanAction action = GroupBanAction.Unban;
string statename = "Unban"; string statename = "Unban";
@ -164,15 +159,10 @@ namespace BetterSecondBot.HttpService
{ {
return Failure("Unknown group"); return Failure("Unknown group");
} }
if (bot.NeedReloadGroupData(groupuuid) == true)
{
bot.GetClient.Groups.RequestGroupMembers(groupuuid);
}
ProcessAvatar(avatar); ProcessAvatar(avatar);
KeyValuePair<bool, string> reply = waitForReady(true, true, groupuuid); if (avataruuid == UUID.Zero)
if (reply.Key == false)
{ {
return Failure(reply.Value); return Failure("avatar lookup");
} }
bool status = bot.FastCheckInGroup(groupuuid, avataruuid); bool status = bot.FastCheckInGroup(groupuuid, avataruuid);
if(status == false) if(status == false)
@ -263,10 +253,9 @@ namespace BetterSecondBot.HttpService
bot.GetClient.Groups.RequestGroupMembers(groupuuid); bot.GetClient.Groups.RequestGroupMembers(groupuuid);
} }
ProcessAvatar(avatar); ProcessAvatar(avatar);
KeyValuePair<bool,string> reply = waitForReady(true, true, groupuuid); if (avataruuid == UUID.Zero)
if(reply.Key == false)
{ {
return Failure(reply.Value); return Failure("avatar lookup");
} }
bool status = bot.FastCheckInGroup(groupuuid, avataruuid); bool status = bot.FastCheckInGroup(groupuuid, avataruuid);
if (status == true) if (status == true)