-
Notifications
You must be signed in to change notification settings - Fork 17
Chat Links
Ruhrpottpatriot edited this page Sep 1, 2015
·
2 revisions
GW2.NET can convert chat links between text and managed CLR objects. Each known chat link type has its own class and corresponding converter.
The conversion system is the same for each chat link type. You can access converters via a static property named ChatLink.Factory
.
int tribalBowId = 38875;
// Convert the item identifier to an object of type ChatLink
ChatLink chatLink = ChatLink.Factory.EncodeItem(itemId: tribalBowId, quantity: 1);
// The ChatLink overrides ToString() for converting chat links to base64-encoded text
Console.WriteLine(chatLink);
// The ChatLinkFactory class can also convert base64-encoded text to ChatLink objects
ItemChatLink chatLink = ChatLink.Factory.Decode("[&AgHblwAA]") as ItemChatLink;
// Write to console, but of course you can use it wherever you want.
Console.WriteLine(chatLink.ItemId);
-
Documentation
-
Specialty Services
-
Optional Topics