Modules/bIRC/ircQuit

From Multi Theft Auto: Wiki

Package-x-generic.png This function is provided by the external module Basic IRC Module. You must install this module to use this function.

This function is used to disconnect an ircbot from a server.

Syntax

bool ircQuit ( ircbot theBot, [ string quitMessage ] )

Required Arguments

  • theBot: The ircbot which will be disconnected.

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.

  • quitMessage: A quit message to be displayed when quitting. By default it uses the quit message set by ircSetQuitMessage.

Returns

Returns true if passed arguments were valid, false otherwise.

Example

This example creates an ircbot called DummyBot and makes it connect to irc.gtanet.com server on resource start. When the resource stops, the bot is also disconnected from the server and destroyed.

function resourceStart()
    theBot = ircCreateBot ( "DummyBot" )
    ircConnect ( theBot, "irc.gtanet.com", 6667 )
end
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), resourceStart )

function resourceStop()
    if theBot then
        ircQuit ( theBot )
        ircDestroyBot ( theBot )
    end
end
addEventHandler ( "onResourceStop", getResourceRootElement ( getThisResource() ), resourceStop )

See Also

Bot functions

Creation

Connection

Other

IRC functions

Channel

User

Communication

Other