nameOf

Returns either the nickname or the display name of a user, depending on whether the display name is known or not.

If not version TwitchSupport then it always returns the nickname.

  1. auto nameOf(IRCUser user)
    pragma(inline, true) pure @safe nothrow @nogc
    nameOf
    ()
  2. auto nameOf(IRCPlugin plugin, string specified)

Parameters

user IRCUser

IRCUser to examine.

Return Value

Type: auto

The nickname of the user if there is no alias known, else the alias.

Examples

version(TwitchSupport)
{
    {
        IRCUser user;
        user.nickname = "joe";
        user.displayName = "Joe";
        assert(nameOf(user) == "Joe");
    }
    {
        IRCUser user;
        user.nickname = "joe";
        assert(nameOf(user) == "joe");
    }
}
{
    IRCUser user;
    user.nickname = "joe";
    assert(nameOf(user) == "joe");
}