Modules/bIRC/ircJoinChannel: Difference between revisions
Jump to navigation
Jump to search
(Created page with '{{ml_birc}} __NOTOC__ This function can be used to list out all the users a specified channel. Note that a delay of 2-3 seconds should be used before calling this function inside…') |
No edit summary |
||
Line 1: | Line 1: | ||
{{ml_birc}} | {{ml_birc}} | ||
__NOTOC__ | __NOTOC__ | ||
This function can be used to | This function can be used to join a channel. Note that a delay of 2-3 seconds should be used before calling this function inside callback {{ml_birc|event_ircOnJoinChannel}}. | ||
==Syntax== | ==Syntax== |
Latest revision as of 18:18, 13 August 2009
This function is provided by the external module Basic IRC Module. You must install this module to use this function. | |
This function can be used to join a channel. Note that a delay of 2-3 seconds should be used before calling this function inside callback event_ircOnJoinChannel.
Syntax
bool ircJoinChannel ( ircbot theBot, string channel, [ string key = "" ] )
Required Arguments
- theBot: The ircbot which is going to join the channel
- channel: The channel which the ircbot will connect to
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- key: The key (password) for the channel. Needs to be specified for channels which have key set
Returns
Returns true if passed arguments were valid, false otherwise.
Note: Does not return true if ircbot successfully joined or false if the bot failed to join the channel. You can check if the bot joined the channel by using callback event_ircOnJoinChannel.
Example
This example creates an ircbot called DummyBot makes it connect to a server and join a channel called #testchannel after it has connected.
function resourceStart ( ) theBot = ircCreateBot ( "DummyBot" ) ircConnect ( theBot, "irc.gtanet.com", 6667 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), resourceStart ) function event_ircOnConnect ( theBot ) setTimer ( ircJoinChannel, 2000, 1, theBot, "#testchannel" ) end
See Also
Bot functions
Creation
Connection
Other
IRC functions
Channel
- ircGetChannelMode
- ircGetChannelTopic
- ircGetChannelUsers
- ircGetConnectedChannels
- ircJoinChannel
- ircPartChannel
- ircSetChannelMode
- ircSetChannelTopic