<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/Modules/bIRC/ircBan?action=history&amp;feed=atom</id>
	<title>Modules/bIRC/ircBan - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/Modules/bIRC/ircBan?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/bIRC/ircBan&amp;action=history"/>
	<updated>2026-05-15T07:17:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/bIRC/ircBan&amp;diff=21099&amp;oldid=prev</id>
		<title>Awwu: Created page with '{{ml_birc}} __NOTOC__ This function can be used to ban-kick user from the specified channel. The specified {{ml_birc|ircbot}} often needs to have suitable privileges in order for…'</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/bIRC/ircBan&amp;diff=21099&amp;oldid=prev"/>
		<updated>2009-08-15T16:23:50Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;{{ml_birc}} __NOTOC__ This function can be used to ban-kick user from the specified channel. The specified {{ml_birc|ircbot}} often needs to have suitable privileges in order for…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{ml_birc}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function can be used to ban-kick user from the specified channel. The specified {{ml_birc|ircbot}} often needs to have suitable privileges in order for this to work.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool ircBan ( ircbot theBot, string channel, string user, [ int formatType = 2, string reason = &amp;quot;&amp;quot; ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theBot:''' The ircbot which is going to do the banning&lt;br /&gt;
*'''channel:''' The channel where user should be banned from&lt;br /&gt;
*'''user:''' The user who should be banned&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''formatType:''' The ban mask type which should be used for banning. A list can be found in {{ml_birc|ircFormatHost}} function&lt;br /&gt;
*'''reason:''' The reason for the ban&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if passed arguments were valid, ''false'' otherwise.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Note:''' Does not return ''true'' if the user was successfully banned or ''false'' if it failed. You can check if the user was kicked by using callback {{ml_birc|event_ircOnKick}} and if the a channel mode was set by using callback {{ml_birc|event_ircOnChannelMode}}.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates an ircbot called ''DummyBot'', makes it connect to a server and join a channel. It also includes an IRC command '!ban' which can be used to ban users from the channel.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function resourceStart ( )&lt;br /&gt;
    theBot = ircCreateBot ( &amp;quot;DummyBot&amp;quot; )&lt;br /&gt;
    ircConnect ( theBot, &amp;quot;irc.gtanet.com&amp;quot;, 6667 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStart&amp;quot;, getResourceRootElement ( getThisResource() ), resourceStart )&lt;br /&gt;
 &lt;br /&gt;
function event_ircOnConnect ( theBot )&lt;br /&gt;
    setTimer ( ircJoinChannel, 2000, 1, theBot, &amp;quot;#testchannel&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function event_ircOnText ( theBot, channel, sender, message )&lt;br /&gt;
    if message:find( &amp;quot;!ban&amp;quot; ) then&lt;br /&gt;
        local params = split ( message, string.byte (' ') )&lt;br /&gt;
        -- params[1] has the string &amp;quot;!ban&amp;quot; which we don't need&lt;br /&gt;
        -- params[2] has the user name&lt;br /&gt;
        if ircIsInChannel ( theBot, channel, params[2] ) then&lt;br /&gt;
            ircBan ( theBot, channel, params[2] )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{ml_birc functions}}&lt;/div&gt;</summary>
		<author><name>Awwu</name></author>
	</entry>
</feed>