Skip to content

Instantly share code, notes, and snippets.

@tekkub
Created June 24, 2010 01:53
Show Gist options
  • Save tekkub/450859 to your computer and use it in GitHub Desktop.
Save tekkub/450859 to your computer and use it in GitHub Desktop.
local function getnote(fullname)
local _, online = BNGetNumFriends()
for i=1,online do
local _, givenName, surname, _, _, _, _, _, _, _, _, note = BNGetFriendInfo(i)
if (givenName.. " ".. surname) == fullname and note and note ~= "" then return note end
end
return name:gsub(" %w+$", "")
end
local function bettername(self, event, msg, name, ...)
print(event, msg, name, ...)
return false, msg, getnote(name), ...
end
ChatFrame_AddMessageEventFilter("CHAT_MSG_BN_WHISPER", bettername)
ChatFrame_AddMessageEventFilter("CHAT_MSG_BN_WHISPER_INFORM", bettername)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment