Modules/IRCEcho/ircIsOwner: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{ModuleFunction|IRCEcho}} Can be used to check if the user has founderrights in an channel ==Syntax== <syntaxhighlight lang="lua"> function ircIsOwner ( IRCConnection irc, string channel, str...) |
No edit summary |
||
Line 17: | Line 17: | ||
function irc_onPrivMsg( szChannel, szNick, szText ) | function irc_onPrivMsg( szChannel, szNick, szText ) | ||
if string.find( szText, "!unban" ) == 1 then | if string.find( szText, "!unban" ) == 1 then | ||
if ( ircIsOwner( pIRC, | if ( ircIsOwner( pIRC, szChannel, szNick ) ) then | ||
unbanIP(string.sub(szText, 7)) | unbanIP(string.sub(szText, 7)) | ||
end | end |
Latest revision as of 19:18, 13 January 2008
This function is provided by the external module IRCEcho. You must install this module to use this function. | |
Can be used to check if the user has founderrights in an channel
Syntax
function ircIsOwner ( IRCConnection irc, string channel, string nick )
Required arguments
- irc: The IRCConnection
- channel: The channel that you want to check on
- nick: The person that you want to check on
Example
Example 1: This script can be used from irc, so that people with founderrights or higher can use !unban
function irc_onPrivMsg( szChannel, szNick, szText ) if string.find( szText, "!unban" ) == 1 then if ( ircIsOwner( pIRC, szChannel, szNick ) ) then unbanIP(string.sub(szText, 7)) end end end