FAQ: Difference between revisions

From PurpleIRC Wiki
No edit summary
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Q:''' What IRC network should I use?
=== What IRC network should I use? ===


'''A:''' Espernet is bot friendly. See http://esper.net/bots.php for details.
Espernet is bot friendly. See http://esper.net/bots.php for details.


----
=== How do I use TLS? ===
'''Q:''' How do I use TLS?  


'''A:''' Several IRC networks use the STARTTLS command for switching to TLS. PurpleIRC will auto detect this and switch to TLS if tls is set to true. Typically the port is a non-SSL port like 6667.  
Several IRC networks use the STARTTLS command for switching to TLS. PurpleIRC will auto detect this and switch to TLS if tls is set to true. Typically the port is a non-SSL port like 6667.  
  port: 6667
  port: 6667
  ssl: false
  ssl: false
  tls: true
  tls: true


----
=== How do I add custom commands? ===
'''Q:''' How do I add custom commands?  
 
See the commands section of the sample bot yml file. In the example below a user on IRC can run the gamemode command and pass it parameters. You can add virtually any command that would work from the console.


'''A:''' See the commands section of the sample bot yml file. In the example below a user on IRC can run the gamemode command and pass it parameters. You can add virtually any command that would work from the console.
       gamemode:
       gamemode:
         modes: 'o'
         modes: 'o'
Line 22: Line 21:
         private_listen: true
         private_listen: true
         channel_listen: true
         channel_listen: true
        perm: ''
        sender: CONSOLE
        game_command_usage: ''


----
=== How do I set the IRC command prefix? ===
'''Q:''' How do I set the IRC command prefix?  


'''A:''' See the "command-prefix:" in the bot yml file
See the "command-prefix:" in the bot yml file


----
=== How do I join my bot to multiple channels? ===
'''Q:''' How do I join my bot to multiple channels?  


'''A:''' In your bot file just add an extra channel like this.  
In your bot file just add an extra channel like this.  
  channels:
  channels:
   '#channel1':
   '#channel1':
Line 44: Line 44:
     ...
     ...


----
=== How do I delete my bot? ===
'''Q:''' How do I delete my bot?  


'''A:''' Stop the server and then remove the bot yml file.  
Stop the server and then remove the bot yml file.  


----
=== How do I put dots in my channel name? ===
'''Q:''' How do I put dots in my channel name?  
 
Use %2E instead of a dot. This will be decoded automatically.


'''A:''' Use %2E instead of a dot. This will be decoded automatically.
  channels:
  channels:
   '#channel%2Etest:
   '#channel%2Etest:
Line 60: Line 59:
     ...
     ...


----
=== How do I prevent non-public faction chat messages from appearing in IRC? ===
'''Q:''' How do I prevent non-public faction chat messages from appearing in IRC?  
 
Remove the game-chat from enabled-messages list. Enable faction-public-chat for general chat.
 
=== How do I prevent non-public hero chat messages from appearing in IRC? ===


'''A:''' Remove the game-chat from enabled-messages list. Enable faction-public-chat for general chat.
Remove game-chat from your enabled-messages for that bot. Then only enable hero-CHANNELNAME-chat where CHANNELNAME is the name of the hero channel you want to see messages from.


----
=== How do I prevent mcMMO admin chat from appearing in IRC? ===
'''Q:''' How do I prevent non-public hero chat messages from appearing in IRC?  


'''A:''' Remove game-chat from your enabled-messages for that bot. Then only enable hero-CHANNELNAME-chat where CHANNELNAME is the name of the hero channel you want to see messages from.
To disable mcMMO admin chat from appearing in IRC remove mcmmo-admin-chat and game-chat from the enabled-messages section and then do "/irc reloadbotconfigs"


----
=== How do I register my bot with the NICKSERV? ===
'''Q:''' How do I prevent mcMMO admin chat from appearing in IRC?  


'''A:''' To disable mcMMO admin chat from appearing in IRC remove mcmmo-admin-chat and game-chat from the enabled-messages section and then do "/irc reloadbotconfigs"
Use the nickserv command.


----
irc nickserv HELP
'''Q:''' How do I register my bot with the NICKSERV?
irc nickserv REGISTER [Password] [Email Address]


'''A:''' Use the sendraw command.
irc sendraw NickServ REGISTER [Password] [Email Address]
irc sendraw NickServ VERIFY REGISTER [Bot Nick]


If the IRC server does not recognize NickServ commands try the PRIVMSG command.
If the IRC server does not recognize NickServ commands try the PRIVMSG command.
  irc sendraw PRIVMSG NickServ :REGISTER [Password] [Email Address]
  irc sendraw PRIVMSG NickServ :REGISTER [Password] [Email Address]
  irc sendraw PRIVMSG NickServ :VERIFY REGISTER [Bot Nick]  
  irc sendraw PRIVMSG NickServ :VERIFY REGISTER [Bot Nick]


=== Why won't my bot load? ===


----
There is a likely YAML syntax error. Test your yml file on a [http://yamllint.com/ YAML validator].
'''Q:''' Why won't my bot load?


'''A:''' There is a likely YAML syntax error. Test your yml file on a [[http://yamllint.com/|YAML validator]].
=== Why won't TownyChat messages relay to IRC? ===


----
You must set '''hooked: true''' for each channel in your '''plugins/Towny/settings/Channels.yml''' file. Example:
'''Q:''' Why won't TownyChat messages relay to IRC?


'''A:''' You must set "hooked: true" for each channel in your "plugins/Towny/settings/Channels.yml" file. Example:
  channels:
  channels:
     general:
     general:
Line 107: Line 103:
         range: '-1'
         range: '-1'


=== Why won't PurpleIRC display Korean characters? ===


 
You must set "charset: UTF-8" in your "bot.yml" file. Example:
----
'''Q:''' Why won't PurpleIRC display Korean characters?
 
'''A:''' You must set "charset: UTF-8" in your "bot.yml" file. Example:
  charset: UTF-8
  charset: UTF-8


----
=== Why does my config.yml and/or bot yml lose changes after restart? ===
'''Q:''' Why does my config.yml and/or bot yml lose changes after restart?  


'''A:''' The plugin saves configurations in memory and then dumps them back to disk after stop. Any time you make changes to config.yml use "/irc reloadconfig". If you make changes to the bot use "/irc reloadbotconfigs".
The plugin saves configurations in memory and then dumps them back to disk after stop. Any time you make changes to config.yml use "/irc reloadconfig". If you make changes to the bot use "/irc reloadbotconfigs".
  /irc reloadbotconfigs
  /irc reloadbotconfigs
  /irc reloadconfig
  /irc reloadconfig


----
=== How do I send a message to the IRC channel on join? ===
'''Q:''' How do I send a message to the IRC channel on join?  


'''A:''' Use the raw-message option.  
Use the raw-message option.  
  raw-message: 'PRIVMSG #channel :Hi there!'
  raw-message: 'PRIVMSG #channel :Hi there!'
  raw-message-on-join: true
  raw-message-on-join: true
=== Will this plugin allow cross server chatting? ===


'''Q:''' Will this plugin allow cross server chatting?  
Yes.
=== Is there an API? ===


'''A:''' Yes.
To send a message to any channel or user:
 
----
'''Q:''' Is there an API?
 
'''A:''' I have not created any API's yet. However, the IRC messaging methods are public. You should be able to send a message to any channel or user like this.


<syntaxhighlight lang="java">
  PurpleIRC pIrc = (PurpleIRC)Bukkit.getPluginManager().getPlugin("PurpleIRC");
  PurpleIRC pIrc = (PurpleIRC)Bukkit.getPluginManager().getPlugin("PurpleIRC");
  for (PurpleBot ircBot : pIrc.ircBots.values()) {
  for (PurpleBot ircBot : pIrc.ircBots.values()) {
   ircBot.asyncIRCMessage("#channel", "some message");
   ircBot.asyncIRCMessage("#channel", "some message");
  }
  }
</syntaxhighlight>
There are two events that fire when users send IRC messages. See the [https://github.com/cnaude/PurpleIRC-spigot/tree/master/src/main/java/com/cnaude/purpleirc/Events source code] for available methods.
* IRCMessageEvent
* IRCCommandEvent
=== How do I enable the custom tab feature? ===
The custom tab feature requires the [http://dev.bukkit.org/bukkit-plugins/protocollib/ ProtocolLib] plugin. Install that plugin, set '''custom-tab-list: true''' in your config.yml file, and then restart your server. Lastly give your players the '''irc.tablist''' permission node.
=== Can the Forge mod be installed as a client mod? ===
Yes.
=== How do I integrate PurpleBungeeIRC and BungeeTabListPlus? ===
See the [[BungeeTabListPlus Integration]] for an example configuration.
=== How do I integrate with DiscordSRV? ===
Example channel configuration for DiscordSRV integration. For discord-minecraft-chat message type replace minecraft with your Discord channel name.
channels:
  '#minecraft':
    enabled-messages:
    - discord-minecraft-chat
    - irc-discord-chat
    discord-channel: minecraft

Latest revision as of 04:04, 25 March 2019

What IRC network should I use?

Espernet is bot friendly. See http://esper.net/bots.php for details.

How do I use TLS?

Several IRC networks use the STARTTLS command for switching to TLS. PurpleIRC will auto detect this and switch to TLS if tls is set to true. Typically the port is a non-SSL port like 6667.

port: 6667
ssl: false
tls: true

How do I add custom commands?

See the commands section of the sample bot yml file. In the example below a user on IRC can run the gamemode command and pass it parameters. You can add virtually any command that would work from the console.

     gamemode:
       modes: 'o'
       private: false
       ctcp: false
       game_command: 'gamemode %ARGS%'
       private_listen: true
       channel_listen: true
       perm: 
       sender: CONSOLE
       game_command_usage: 

How do I set the IRC command prefix?

See the "command-prefix:" in the bot yml file

How do I join my bot to multiple channels?

In your bot file just add an extra channel like this.

channels:
 '#channel1':
   autojoin: true
   modes: 
   password: 
   ...
 '#channel2':
   autojoin: true
   modes: 
   password: 
   ...

How do I delete my bot?

Stop the server and then remove the bot yml file.

How do I put dots in my channel name?

Use %2E instead of a dot. This will be decoded automatically.

channels:
 '#channel%2Etest:
   autojoin: true
   modes: 
   password: 
   ...

How do I prevent non-public faction chat messages from appearing in IRC?

Remove the game-chat from enabled-messages list. Enable faction-public-chat for general chat.

How do I prevent non-public hero chat messages from appearing in IRC?

Remove game-chat from your enabled-messages for that bot. Then only enable hero-CHANNELNAME-chat where CHANNELNAME is the name of the hero channel you want to see messages from.

How do I prevent mcMMO admin chat from appearing in IRC?

To disable mcMMO admin chat from appearing in IRC remove mcmmo-admin-chat and game-chat from the enabled-messages section and then do "/irc reloadbotconfigs"

How do I register my bot with the NICKSERV?

Use the nickserv command.

irc nickserv HELP
irc nickserv REGISTER [Password] [Email Address]


If the IRC server does not recognize NickServ commands try the PRIVMSG command.

irc sendraw PRIVMSG NickServ :REGISTER [Password] [Email Address]
irc sendraw PRIVMSG NickServ :VERIFY REGISTER [Bot Nick]

Why won't my bot load?

There is a likely YAML syntax error. Test your yml file on a YAML validator.

Why won't TownyChat messages relay to IRC?

You must set hooked: true for each channel in your plugins/Towny/settings/Channels.yml file. Example:

channels:
   general:
       commands: [g]
       type: GLOBAL
       channeltag: '&r[&4g&r]'
       messagecolour: '&f'
       permission: 'towny.chat.general'
       craftIRCTag: 'admin'
       hooked:  true
       range: '-1'

Why won't PurpleIRC display Korean characters?

You must set "charset: UTF-8" in your "bot.yml" file. Example:

charset: UTF-8

Why does my config.yml and/or bot yml lose changes after restart?

The plugin saves configurations in memory and then dumps them back to disk after stop. Any time you make changes to config.yml use "/irc reloadconfig". If you make changes to the bot use "/irc reloadbotconfigs".

/irc reloadbotconfigs
/irc reloadconfig

How do I send a message to the IRC channel on join?

Use the raw-message option.

raw-message: 'PRIVMSG #channel :Hi there!'
raw-message-on-join: true

Will this plugin allow cross server chatting?

Yes.

Is there an API?

To send a message to any channel or user:

<syntaxhighlight lang="java">

PurpleIRC pIrc = (PurpleIRC)Bukkit.getPluginManager().getPlugin("PurpleIRC");
for (PurpleBot ircBot : pIrc.ircBots.values()) {
  ircBot.asyncIRCMessage("#channel", "some message");
}

</syntaxhighlight>

There are two events that fire when users send IRC messages. See the source code for available methods.

  • IRCMessageEvent
  • IRCCommandEvent

How do I enable the custom tab feature?

The custom tab feature requires the ProtocolLib plugin. Install that plugin, set custom-tab-list: true in your config.yml file, and then restart your server. Lastly give your players the irc.tablist permission node.

Can the Forge mod be installed as a client mod?

Yes.

How do I integrate PurpleBungeeIRC and BungeeTabListPlus?

See the BungeeTabListPlus Integration for an example configuration.

How do I integrate with DiscordSRV?

Example channel configuration for DiscordSRV integration. For discord-minecraft-chat message type replace minecraft with your Discord channel name.

channels:
 '#minecraft':
   enabled-messages:
   - discord-minecraft-chat
   - irc-discord-chat
   discord-channel: minecraft