Thread Tools Display Modes
10-10-18, 01:11 PM   #1
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
Get information on a guild by guild name

Is there a way to get guild information based on its name, programmatically?
  Reply With Quote
10-10-18, 01:55 PM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
No. The only two functions available to get data about a guild you aren't in are GetGuildInfo(unit) and GetInspectGuildInfo(unit), both requiring a unit.

Code:
local guildName, guildRankName, guildRankIndex, realm = GetGuildInfo(unit)
local guildPoints, guildNumMembers, guildName = GetInspectGuildInfo(unit)
You can, however, try to iterate through the guild recruitment frame and feed indexes into GetRecruitingGuildInfo(index), but finding a guild there requires that the GM has listed it as recruiting.

Code:
local name, level, numMembers, achPoints = GetRecruitingGuildInfo(index)
Using /guildinfo or /run GuildInfo() will print some more information about your current guild into CHAT_MSG_SYSTEM events, such as creation date.

Last edited by Kanegasi : 10-10-18 at 02:01 PM.
  Reply With Quote
10-11-18, 02:26 PM   #3
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
The reason I want it is I have written a spam filter for LFG and Trade, and I want it to block Guild recruiting messages. So I have filtered out "<Guild XYZ> 8/8 HC ..." type messages but some guys are now clever and avoid enclosing the guild name in brackets, so the mssages that escape are, "Guild XYZ 8/8 HC ..." !

My idea was to scan the first 1-3 words to check if it's valid guild name and filter on that.

Another idea was to *assume* that the spammer was necessarily in the guild concerned, therefore I could get the guild name from the spammer's name. But even that failed because GetGuildInfo requires "party1" or "target" etc and not something like "Dorkhead-Sylvannas" type of argument.
  Reply With Quote
10-11-18, 03:00 PM   #4
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
The only way around that is to use the /who API, and since that's not instant, filtering the message directly won't work.

Personally, I've been filling BadBoy's custom filter list. When I see a new ad, I just add the guild name or some identifiable part of the ad.

If you're curious, this is my BadBoy list:

Code:
BADBOY_CCLEANER = {
	"(selling)",
	"<aspirants of asgard>",
	"<calculated chaos>",
	"<exordium>",
	"<ez>",
	"<grey parse elitests>",
	"<immortal>",
	"<infinity>",
	"<lose your life>",
	"<mature content>",
	"<metacortex>",
	"<notion>",
	"<obscure radiance>",
	"<obscureradiance>",
	"<relapse>",
	"<reload-dalaran>",
	"<reload>",
	"<ricos roughnecks>",
	"<the fort>",
	"<welfare epics>",
	"[chaosity]",
	"for more info",
	"group selling",
	"heroic argus only",
	"hollow point marshmallow",
	"kirby carries",
	"nfa realm first keystone",
	"raidtargetingicon",
	"selling  mythic",
	"selling antorus",
	"selling daily",
	"selling full clear",
	"selling heroic",
	"selling mythic",
	"selling normal",
	"stormseekers",
	"where fun and autism meet",
	"wts antorus",
	"wts argus",
	"wts h antorus",
	"wts h argus",
	"wts heroic",
	"wts mythic",
	"wts normal",
	"wts quick heroic antorus",
	"wts uldir",
}

The best one is "raidtargetingicon" which catches all raid icons by matching the text that formats into the icon.

Last edited by Kanegasi : 10-11-18 at 03:02 PM.
  Reply With Quote
10-14-18, 02:40 AM   #5
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
I see, you have an "ignore list" of sorts but instead of players it is composed of guilds...
  Reply With Quote
10-14-18, 09:07 AM   #6
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
I don’t believe in ignoring players unless they’re directly whispering me or are truly a menace in a public channel. Ads aren’t a good enough reason for me to ignore them since I can just filter the ad with BadBoy.

My ignore list has actually been empty since Draenor.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Get information on a guild by guild name

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off