Modules/IRCEcho/ircIsVoice: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
function irc_onPrivMsg( szChannel, szNick, szText ) | function irc_onPrivMsg( szChannel, szNick, szText ) | ||
if string.find( szText, "!say" ) == 1 then | if string.find( szText, "!say" ) == 1 then | ||
if ( ircIsVoice( pIRC, | if ( ircIsVoice( pIRC, szChannel, szNick ) ) then | ||
local Message = string.sub(szText, 5) | local Message = string.sub(szText, 5) | ||
outputChatBox("* " .. szNick .. " [IRC]: " .. Message) | outputChatBox("* " .. szNick .. " [IRC]: " .. Message) |
Latest revision as of 19:20, 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 Voice or higher
Syntax
function ircIsVoice ( 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 voice or higher can use !say
function irc_onPrivMsg( szChannel, szNick, szText ) if string.find( szText, "!say" ) == 1 then if ( ircIsVoice( pIRC, szChannel, szNick ) ) then local Message = string.sub(szText, 5) outputChatBox("* " .. szNick .. " [IRC]: " .. Message) end end end