-
Notifications
You must be signed in to change notification settings - Fork 2
Shoutbox
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)
Shoutbox.Global.Send(session, "Hi @Global channel");
Shoutbox.EnglishOnly.Send(session, "Hi @English-only channel");
var kazaaShouts = Shoutbox.Global.Shouts(session).Where(shout => shout.User.Name == "Kazaaa");
// kazaaShouts holds all shouts send by user Kazaaa
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.
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;