Properties
Objects

Properties

This section describes the properties associated with the Channel object.


ChannelName Property

Description

Synchronously reads or writes the Name of the channel.

Syntax

value=object.ChannelName

PartDescription
value Required. A string containing the Name of the channel.
object Required. An object expression that evaluates to a Channel object.

Remarks

Access is read/write or read-only depending on the ChannelState value:

After joining a channel, the ChannelName property is not necessarily the string you specified in CreateChannel, JoinChannel, or ChannelName because of the cloned channels.

For example, you could call:

MsChatPr1.Channels(1).JoinChannel "#Chat" 

and, in fact, join "#Chat3", which will be the value returned by the ChannelName property.

The ChannelName property is not cleared when the user leaves the channel and the ChannelState becomes chsClosed.

The user can also synchronously get the channel Name using:

<channel>.ChannelProperty("Name")

But the ChannelName property is simpler and more efficient.

The asynchronous method of accessing the channel Name is:

<channel>.QueryChannelProperty "Name"

See Also

CreateChannel, ChannelProperty, JoinChannel, QueryChannelProperty


ChannelProperty Property

Description

Synchronously accesses a channel property.

Syntax

value=object.ChannelProperty(ChannelPropertyName)

PartDescription
value Required. An object expression that evaluates to a ChatItems object.
object Required. An object expression that evaluates to Channel object.
ChannelPropertyName Required. A string that contains one of the valid values shown in the following table.
IRCX IRC/IRCX
protocol only    protocols
Account BannedList
ClientData Keyword
ClientGuid MaxMemberCount
CloneList MemberCount
CreationTime   Modes
HostKey Name
Lag Topic
Language
ObjectId
OnJoin
OnPart
OwnerKey
Rating
ServicePath
Subject

Remarks

Access is read-only.

When the client asks for this property, the server might return more information than was requested. Because of this, all answers are packaged into a ChatItems object and exposed to the caller.

Generally, all the information known by the client at the time of the ChannelProperty call is exposed to the caller in the ChatItems object.

The ChannelState must be chsOpen for the ChannelProperty property access to succeed.

Example

The following are asynchronous methods of accessing a channel property.

<channel>.QueryChannelProperty <ChannelPropertyName> 
'and
<control>.QueryChannelProperty <ChannelPropertyName>, <ChannelName>

See Also

ChannelName, QueryChannelProperty


ChannelState Property

Description

Returns the current channel state of the control.

Syntax

value=object.ChannelState

PartDescription
value Required. A variable of enumChannelState type.
object Required. An object expression that evaluates to a Channel object.

Remarks

Access is read-only.

At creation, the state of a channel is chsClosed. When calling its JoinChannel or CreateChannel method, the state becomes asynchronously chsOpening and chsOpen. It becomes chsClosed again when the user leaves the channel or is kicked from the channel, or when a server disconnection occurs.

If the Channel object is removed from the collection, attempts to access any of its properties or methods will cause an occurrence of the Channels collection error 3172, "The channel is no more part of the collection."

The asynchronous channel state changes are exposed through the OnChannelState event.


ChannelTopic Property

Description

Synchronously reads the Topic of the channel.

Syntax

value=object.ChannelTopic

PartDescription
value Required. A string expression that contains the Topic of the channel.
object Required. An object expression that evaluates to a Channel object.

Remarks

Access is read-only.

The ChannelTopic property is not cleared when the user leaves the channel and the channel state becomes chsClosed.

The user can also synchronously get the Topic of the channel by using:

<channel>.ChannelProperty("Topic") 
'or 
<control>.ChannelProperty("Topic", <channelname>)

But the ChannelTopic property is simpler and more efficient.

The asynchronous methods to access the Topic of the channel are:

<channel>.QueryChannelProperty "Topic" 
'and 
<control>.QueryChannelProperty "Topic", <channelname> 

See Also

ChannelProperty, QueryChannelProperty


Index Property

Description

Uniquely identifies the Channel object in the Channels collection.

Syntax

value=object.Index

PartDescription
value Required. A long integer that will receive the index of the Channel object.
object Required. An object expression that evaluates to a Channel object.

Remarks

Access is read-only.

The index of a channel is not fixed; it can vary during the lifetime of the object. If a channel with a smaller index is removed from the collection, the index is decremented. If a channel with a smaller or equal index is added to the collection, the index is incremented.

Example

Dim lIndex As Long

Set c=MsChatPr1.Channels.Add(1, "Key1")
lIndex=chanobj.Index    'lIndex now contains 1
MsChatPr1.Channels.Add 1, "Key2"
lIndex=chanobj.Index    'lIndex now contains 2

See Also

Add, Item, Remove


MemberCount Property

Description

Synchronously returns the current number of members in the channel.

Syntax

value=object.MemberCount

PartDescription
value Required. A long integer that will receive the current number of members in the channel.
object Required. An object expression that evaluates to a Channel object.

Remarks

Access is read-only.

If the Channel object is not open, attempts to access its MemberCount property will cause an occurrence of the Channel Error 3062, "The channel is not open."

Examples

The user can also synchronously obtain the member count of the channel by using:

ChannelProperty("MemberCount")

But the MemberCount property is simpler and more efficient.

The asynchronous methods of accessing the member count of the channel are:

&lt:channel>.QueryChannelProperty "MemberCount"
'and
&lt:control>.QueryChannelProperty "MemberCount", &lt:channelname>

See Also

ChannelProperty, QueryChannelProperty


MemberIdentity Property

Description

Synchronously accesses the Identity of a channel member.

Syntax

value=object.MemberIdentity [(MemberNickname)]

PartDescription
value Required. A string expression containing the Identity of a member.
object Required. An object expression that evaluates to a Channel object.
MemberNickname Optional. A variant. When specified, the variant must be a string and represent the nickname of a channel member. If not specified, the Identity of the caller is returned.

Remarks

Access is read-only.

The member's Identity is composed of the member's UserName and IPAddress separated by the @ sign.

Examples

RegisB@REGISB1.dns.microsoft.com
RegisB@zorg.microsoft.com

The Identity of a member is fixed. The identity cannot vary, unlike a member's Nickname.

The user can also synchronously get a member's Identity by using:

<channel>.MemberProperty("Identity", <nickname>)

But the MemberIdentity call is simpler and more efficient.

The asynchronous method to access a member's identity is:

<channel>.QueryMemberProperty "Identity", <nickname>

See Also

MemberProperty, Nickname, QueryMemberProperty


MemberModes Property

Description

Synchronously accesses a channel member's Modes.

Syntax

value=object.MemberModes[MemberNickname]

PartDescription
value Required. A variable of enumMemberMode type.
object Required. An object expression that evaluates to a Channel object.
MemberNickname Optional. A variant. When specified, the variant must be a string and represent the nickname of a channel member. If not specified, the Modes of the caller are returned.

Remarks

Access is read-only.

The member modes expose eight Booleans, each Boolean taking two values that are mutually exclusive. For example, the mmClientIgnored and mmNotClientIgnored values are mutually exclusive.

If the MemberModes property returns 0x000AA41 = mmClientIgnored + mmAway + mmNotSysop + mmNotOwner + mmNotHost + mmNoVoice, the control is certain that this member is ignored by the caller, currently away, not a system operator, not a channel host, and has no voice.

However, in this example, because mmAuthMember and mmNotAuthMember are not part of the returned modes, the control is not aware of member authentication.

See Also

Nickname


MemberProperty Property

Description

Synchronously accesses a channel member's property.

Syntax

value=object.MemberProperty (MemberPropertyName[, MemberNickname])

PartDescription
value Required. An object expression that evaluates to a ChatItems object.
object Required. An object expression that evaluates to a Channel object.
MemberPropertyName Required. A string containing a valid member property name value. See Member Properties.
MemberNickname Optional. A variant. When specified, the variant must be a string and represent the nickname of a channel member. If not specified, the property of the caller is returned.

Remarks

Access is read-only.

See Also

Nickname


Methods

This section describes the methods associated with the Channel object.


BanMembers Method

Description

Bans a member(s) and reinstates a member(s).

Syntax

object.BanMembers MemberItems, Set

PartDescription
object Required. An object expression that evaluates to a Channel object.
MemberItems Required. An object expression that evaluates to a ChatItems object. Specifies which members are to be banned or reinstated. The valid item names for constructing the MemberItems object are:
IPAddress
IPAddressOp
Nickname
NicknameOp
UserName
UserNameOp
Set Required. A Boolean variable. This parameter must be TRUE to ban the member from the channel, or FALSE to reinstate the member to the channel.

Examples

1. Ban all the users with an IP address that ends with ".net":

Dim mi As ChatItems

Set mi = New ChatItems
mi.AssociatedType = "Query"
mi.Item("IPAddressOp") = "EndsWith"
mi.Item("IPAddress") = ".net"
chan.BanMembers mi, True
Set mi = Nothing

2. Ban all the users with the username "ProutZ":

Dim mi As ChatItems

Set mi = New ChatItems
mi.AssociatedType = "Query"
mi.Item("UserName") = "ProutZ"
chan.BanMembers mi, True
Set mi = Nothing

3. Reinstate all the users with a username that contains "regis" and an IP address that starts with "ms":

Dim mi As ChatItems

Set mi = New ChatItems
mi.AssociatedType = "Query"
mi.Item("UserNameOp") = "Contains"
mi.Item("UserName") = "regis"
mi.Item("IPAddressOp") = "StartsWith"
mi.Item("IPAddress") = "ms"
chan.BanMembers mi, False
Set mi = Nothing

See Also

NewChatItems


ChangeChannelProperty Method

Description

Asynchronously modifies a channel property.

Syntax

object.ChangeChannelProperty ChannelPropertyName, NewChannelProperty

PartDescription
object Required. An object expression that evaluates to a Channel object.
ChannelPropertyName Required. A string expression. The following table shows the valid channel property names.
IRCX IRC/IRCX
protocol only    protocols
Account Keyword
ClientData MaxMemberCount
ClientGuid    Modes
HostKey Topic
Language
Lag
OnJoin
OnPart
OwnerKey
Rating
ServicePath
Subject
NewChannelProperty Required. A variant, the type of which depends on the new channel property.

Remarks

A successful call results in an OnChannelPropertyChanged event.

Examples

chanobj.ChangeChannelProperty "HostKey", "SecretHost"
chanobj.ChangeChannelProperty "Lag", 2
chanobj.ChangeChannelProperty "Modes", cmPublic + cmKnock + cmTopicop

See Also

enumChannelMode, OnChannelPropertyChanged


ChangeMemberProperty Method

Description

Asynchronously changes a member property.

Syntax

object.ChangeMemberProperty MemberPropertyName, NewMemberProperty[, MemberNickname]

PartDescription
object Required. An object expression that evaluates to a Channel object.
MemberPropertyName Required. A string expression. The only valid member property name value is "Modes".
NewMemberProperty Required. A variant. This property must represent a valid member Modes value. A valid member modes value is a combination of these enumMemberMode values:
mmClientIgnored = &H1.
mmNotClientIgnored  = &H2.
mmOwner = &H100.
mmNotOwner = &H200.
mmHost = &H400.
mmNotHost = &H800.
mmVoice = &H1000.
mmNoVoice = &H2000.
MemberNickname Optional. If specified, it must be an empty variant or a valid channel member nickname. If omitted or empty, the nickname of the caller is used.

Remarks

A successful call results in an OnMemberPropertyChanged event.

Examples

1. Change your own modes (giving up your host privileges in the channel):

chan1.ChangeMemberProperty "Modes", mmNotHost

2. Change another user's member modes (turning a member into a host):

chan1.ChangeMemberProperty "Modes", mmHost, "JamesB"

3. Ignore a member:

chan1.ChangeMemberProperty "Modes", mmClientIgnored, "AustinP"

Note You cannot ignore a channel host or owner, or a server system operator or administrator.


CreateChannel Method

Description

Creates a channel on IRCX servers only.

Syntax

object.CreateChannel [ChannelName][, ChannelKeyword][, ChannelModes][, MaxMemberCount]

PartDescription
object Required. An object expression that evaluates to a Channel object.
ChannelName Optional. A variant. If specified, must be empty or contain a valid channel Name. If the parameter is empty or not specified, the current value of the ChannelName property is used instead.
ChannelKeyword Optional. A variant. If specified, must be empty or a string. If the parameter is empty or not specified, the channel will be created with no Keyword set.
ChannelModes Optional. A variant. If specified, must be empty or a number (integer or long) that is a valid channel Modes value. A valid ChannelModes parameter is a combination of some of the values from the enumChannelMode enumeration. The valid components of a ChannelModes value are:
cmPublic &H0.
cmPrivate &H1.
cmHidden &H2.
cmSecret &H4.
cmModerated &H8.
cmNoExtern &H10.
cmTopicop &H20.
cmInvite &H40.
cmKnock &H80.
cmNoWhisper &H100.
cmService &H400.
cmAuthOnly &H800.
cmCloneable &H1000.
cmAuditorium &H4000.
cmNoFormat &H8000.
cmCreateOnly &H10000000.

The cmPrivate, cmHidden, and cmSecret values are mutually exclusive. If the cmCreateOnly flag is set, the CreateChannel call will fail if the channel already exists. If this flag is not set, the caller will join the channel if it already exists.

If the ChannelModes parameter is empty or not specified, the channel Modes value will be defined by the server's default settings.

MaxMemberCount Optional. A variant. If specified, the MaxMemberCount parameter must be empty or a number (integer or long) that is a valid maximum member count. If the parameter is empty or not specified, the maximum member count of the channel will be defined by the server's default settings.

Remarks

The channel state must be chsClosed for the call to succeed, and the channel must belong to the collection for the call to be successful.

A successful CreateChannel calls results in an OnChannelState event in which the channel state is chsOpening, then an OnChannelState event is fired with the channel state chsClosed or the following suite of events:
Event Parameters
OnChannelState (Channel, chsOpening)
OnChannelState (Channel, chsOpen)
OnBeginEnumeration    (Channel, etInitialMembers)
OnAddMember (Channel, Nickname, MemberItems)
OnEndEnumeration (Channel, etInitialMembers)
OnChannelProperty (Channel, ChannelItems)

Examples

1. Specify all the parameters:

MsChatPr1.Channels(1).CreateChannel "#MyRoom", "SecretPassword", cmTopicop +  cmCreateOnly, 20

2. Omit the ChannelKeyword and MaxMemberCount parameters:

MsChatPr1.Channels(1).CreateChannel "#MyRoom", , cmCreateOnly

3. Use empty variants:

MsChatPr1.Channels(1).CreateChannel "#MyRoom", Empty, 
cmCreateOnly, Empty

See Also

ChannelName, ChannelState, enumChannelMode, JoinChannel, OnChannelState

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.