Skip to content

Instantly share code, notes, and snippets.

@RolandStone
Created February 5, 2023 22:36
Show Gist options
  • Save RolandStone/8eff27b44f339fc936d01215ec1d7a39 to your computer and use it in GitHub Desktop.
Save RolandStone/8eff27b44f339fc936d01215ec1d7a39 to your computer and use it in GitHub Desktop.
Here's a basic template for a Hexchat IRC plugin in Python:
python
Copy code
import hexchat
__module_name__ = "My Plugin"
__module_author__ = "Your Name"
__module_version__ = "1.0"
__module_description__ = "A basic template for a Hexchat plugin"
def my_command_callback(word, word_eol, userdata):
hexchat.command("SAY Hello World!")
return hexchat.EAT_ALL
hexchat.hook_command("MYCMD", my_command_callback, help="/MYCMD - print Hello World!")
hexchat.prnt(__module_name__ + " version " + __module_version__ + " loaded.")
This code defines a basic plugin that adds a command "/MYCMD" to Hexchat, which when executed will print "Hello World!" in the active channel. You can modify the my_command_callback function to perform any desired action and add more commands using hexchat.hook_command function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment