Skip to content
Mostey edited this page Nov 2, 2014 · 11 revisions

The static Shoutbox class contains functions and properties for interacting with the shoutbox and its channels. You may post messages to shoutbox channels, update it on the fly, get the latest data about additional information such as the top 10 chatters and the total amount of messages stored and you can also retrieve the history archive.

There are currently 2 static properties representing both channels:

  • Global (generic) shoutbox channel: Shoutbox.General
  • English-only channel: Shoutbox.EnglishOnly

Feel free to extend the channels by yourself if there will be more someday.

Please note that using the shoutbox functions requires access to the shoutbox (by subscribing to the premium membership, for example)

Sending messages to a shoutbox channel

Shoutbox.Global.Send(session, "Hi @Global channel");
Shoutbox.EnglishOnly.Send(session, "Hi @English-only channel");

Getting the latest shouts of a channel

var kazaaShouts = Shoutbox.Global.Shouts(session).Where(shout => shout.User.Name == "Kazaaa");
// kazaaShouts holds all shouts send by user Kazaaa

Receiving the channel history

Each shoutbox channel got their own history. To retrieve the history, simply call the Shoutbox.Channel.History function. You may specify how many pages will be parsed and where to start, by default you will start from page 1 and parse 10 pages.

var historyShouts = Shoutbox.Global.History(session);

You will need to have at least a PremiumUser session to execute this function.

Updating the shoutbox

You may want to get generic information about the shoutbox:

Shoutbox.Update(session);
bool withinTop10 = Shoutbox.TopChatter.Any(chatter => chatter.ID == session.User.ID); // returns true if the logged-in user is one of the top 10 chatters
uint totalMessagesStored = Shoutbox.MessageCount;
uint totalMessagesDay = Shoutbox.MessageCountCurrentDay;