Modules/bIRC/ircDestroyBot

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 destroy a created ircbot. After deletion, the ircbot pointer will nolonger be valid. If ircbot is connected, it will be disconnected from the server.

Syntax

bool ircDestroyBot ( ircbot theBot )

Required Arguments

  • theBot: The ircbot which will be destroyed.

Returns

Returns true if ircbot was successfully destroyed, false otherwise.

Example

This example creates an ircbot called DummyBot on resource start and destroys the bot once the resource has stopped.

function resourceStart()
    theBot = ircCreateBot ( "DummyBot" )
end
addEventHandler ( "onResourceStart", getResourceRootElement (), resourceStart )

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

See Also

Bot functions

Creation

Connection

Other

IRC functions

Channel

User

Communication

Other