Modules/SebasIRC/ircJoin: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ {{Server function}} {{ModuleFunction|SebasIRC}} // TODO ==Syntax== <syntaxhighlight lang="lua"> bool ircJoin(string channel) </syntaxhighlight> ===Required arguments=== * '''channel:''' The channel name...)
 
mNo edit summary
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{ml_irc}}
__NOTOC__
__NOTOC__
{{Server function}}
{{ModuleFunction|SebasIRC}}
{{ModuleFunction|SebasIRC}}
 
This function joins the bot a channel (, with a password).
// TODO


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool ircJoin(string channel)
bool ircJoin(string channel [, string password])
</syntaxhighlight>
</syntaxhighlight>
===Required arguments===
===Required arguments===
* '''channel:''' The channel name.
* '''channel:''' The channel name.
===Optional Arguments===
* '''password:''' The channel password.


===Returns===
===Returns===
True if joined, otherwise false.
''True'' if joined, otherwise ''false''.


==Example==
==Example==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
-- Example
addEventHandler("onResourceStart", getResourceRootElement(),
  function()
    local connect = ircConnect("irc.mtasa.com", 6667, "MTABot")
    if connect then
      ircJoin("#mta.test")
    end
  end
)
</syntaxhighlight>
</syntaxhighlight>
[[pl:Modules/SebasIRC/ircJoin]]


==See also==
==See also==
{{Modules/SebasIRC/Functions}}
{{Modules/SebasIRC/Functions}}

Latest revision as of 16:33, 21 July 2016


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

This function joins the bot a channel (, with a password).

Syntax

bool ircJoin(string channel [, string password])

Required arguments

  • channel: The channel name.

Optional Arguments

  • password: The channel password.

Returns

True if joined, otherwise false.

Example

addEventHandler("onResourceStart", getResourceRootElement(),
  function()
    local connect = ircConnect("irc.mtasa.com", 6667, "MTABot")
    if connect then
      ircJoin("#mta.test")
    end
  end
)

See also

Connection:

Channel:

Bot: