Skip to content

Adding custom commands #13

Answered by small-cactus
MangoTigers asked this question in Q&A
Discussion options

You must be logged in to vote

To add custom commands, you'd use the Plugins feature I made. Here's the link to the documentation How to Write Plugins for MILES.

To start you off, you need to understand the docstring format required, which is outlined, and you just need a python function that takes in an arg, which can be anything, confirmation yes or no, or a number, or a string, literally anything. That python function should complete the task you want when provided with the correct arg. Here's a function I've drafted for you:

import subprocess
import platform

def shutdown_computer(argument):
    """
    Description: Shuts down the computer with a 5-second delay if the correct argument 'shutdown_now' is provided. Re…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@MangoTigers
Comment options

@small-cactus
Comment options

Answer selected by small-cactus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants