Channel object

From StealthBot Wiki Backup
Revision as of 08:20, 1 December 2017 by Davnit (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Channel object exposes the channel and its users to you. You may want to use these, for example, to find a player's game statstring.

History

This object was added in StealthBot version 2.7 by Eric to create an object-oriented experience in scripting.

How to use

Example: Get the value of a property of the current channel.

Value = Channel.PropertyName

Properties

List of properties

Name property

This property returns the current channel name.

Banlist property

This property returns a collection of BanlistUser objects, one for each user whom the bot has banned.

BanCount property

This property returns the number of users banned since the bot has joined the current channel. The result is the same as that returned by the bancount command.

Flags property

This property returns the Battle.net channel flags for the current channel.

IsSilent property

This property returns True if the Battle.net flags specify that the current channel is silent. Users cannot talk in silent channel, the most well-known example being The Void.

SType property

This property returns a string containing the bot's interpretation of the Battle.net channel flags for the current channel.

JoinCount property

Not implemented, returns 0.

KickCount property

Not implemented, returns 0.

JoinTime property

This function returns a time and date value for the time you entered the channel.

OperatorHeir property

Returns the currently designated heir the bot has set.

Users property

This property returns a collection of User objects, one for each user in the current channel.

Example: Output the name of each user in the channel:

For I = 1 To Channel.Users.Count
    AddChat vbGreen, "User #" & I & ": " & Channel.Users(I).Name
Next

Self property

This property returns a User object containing information about the bot (self) in the current channel.

Example: Output your bot's username and channel name.

AddChat vbGreen, "I am " & Channel.Self.Name & " in " & Channel.Name & "!"

Functions

List of functions

GetUser function

This function returns the User object for the specified user. This is affected by naming conventions.

GetUserEx function

This function returns the ClanMember object for the specified member.

GetUserIndex function

This function returns the member's index in the clan or the integer value 0 if not found. This is affected by naming conventions.

GetUserIndexEx function

This function returns the member's index in the channel or the integer value 0 if not found.

ClearBanlist function

This function clears your bot's internal ban list. This functions like the cbl command.

Example:

Call Channel.ClearBanlist()

IsOnBanlist function

This function returns the user's index in the ban list or the integer value 0 if not found for the specified ban list entry.

IsOnRecentBanlist function

This function returns the user's index in the ban list or the integer value 0 if not found for the specified ban list entry. The user must have been banned in the last three seconds to be the resulting index of this function.

RemoveBansFromOperator function

This function removes all bans on the internal ban list executed by the specified operator.

See also