WoW:API AcceptGroup: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
(Trying to bring more in line with Help:API_Function_articles by adding boilerplate and such)
Line 2: Line 2:
{{wowapi}}
{{wowapi}}
Accept the invitation to party.
Accept the invitation to party.
AcceptGroup();


== Arguments ==
none
== Returns ==
none
== Triggers Events ==
unknown
== Example ==
self:RegisterEvent("PARTY_INVITE_REQUEST", "confirmPartyInvite")
function MyAddon:confirmPartyInvite(info, sender)
  local inviteAccepted = false;
  if ( MyAddon:someTestOfSenderThatYouMakeUp(sender) ) then
    AcceptGroup();
    inviteAccepted = true;
  end
  if ( inviteAccepted ) then
    StaticPopup_Hide("PARTY_INVITE");
  end
end
 
== Result ==
Assuming that whatever code was in MyAddon:someTestOfSenderThatYouMakeUp(sender) returned a true value, You accept the group invite and the dialog box gets closed afterward
== Details ==
You can use this after recieving the PARTY_INVITE_REQUEST event. If there is no invitation to a party, this function doesn't do anything.
You can use this after recieving the PARTY_INVITE_REQUEST event. If there is no invitation to a party, this function doesn't do anything.
Note that calling this function does NOT cause the "accept/decline dialog" to go away. Use [[API_StaticPopup_Hide|StaticPopup_Hide]]("PARTY_INVITE") to hide the dialog.
As of 3.1 calling StaticPopup_Hide("PARTY_INVITE") too quickly after AcceptGroup() appears to interfere with the actual accepting.

Revision as of 16:24, 15 April 2009

WoW API < AcceptGroup

Accept the invitation to party.

AcceptGroup();

Arguments

none

Returns

none

Triggers Events

unknown

Example

self:RegisterEvent("PARTY_INVITE_REQUEST", "confirmPartyInvite")

function MyAddon:confirmPartyInvite(info, sender)
  local inviteAccepted = false;

  if ( MyAddon:someTestOfSenderThatYouMakeUp(sender) ) then
    AcceptGroup();
    inviteAccepted = true;
  end

  if ( inviteAccepted ) then
    StaticPopup_Hide("PARTY_INVITE");
  end
end
 

Result

Assuming that whatever code was in MyAddon:someTestOfSenderThatYouMakeUp(sender) returned a true value, You accept the group invite and the dialog box gets closed afterward


Details

You can use this after recieving the PARTY_INVITE_REQUEST event. If there is no invitation to a party, this function doesn't do anything.

Note that calling this function does NOT cause the "accept/decline dialog" to go away. Use StaticPopup_Hide("PARTY_INVITE") to hide the dialog.

As of 3.1 calling StaticPopup_Hide("PARTY_INVITE") too quickly after AcceptGroup() appears to interfere with the actual accepting.