forked from mas6y6/CipherOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
28 lines (22 loc) · 953 Bytes
/
__init__.py
File metadata and controls
28 lines (22 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from cipher.api import CipherAPI
from cipher.parsers import ConfigParser
from cipher.plugins import CipherPlugin
# This structure of a plugin
class ExamplePlugin(CipherPlugin):
def __init__(self, api: CipherAPI, config:ConfigParser):
# Call the parent constructor to initialize the plugin with the API
super().__init__(api, config)
# Register your plugin's commands
self.register_commands()
def on_enable(self):
print("Example Plugin enabled")
def register_commands(self):
@self.command()
def hello(args:list[str]):
"""This command prints a friendly greeting"""
print("Hello from ExamplePlugin!")
# Register another command called 'goodbye'
@self.command(name="goodbye")
def goodbye(args:list[str]):
"""This command prints a farewell message"""
print("Goodbye from ExamplePlugin!")