Tutorial by: Aabsss


In this tutorial I will show you how to make slash commands and applications!

SLASH COMMANDS:

  1. You need to have the basic understanding of DiSky and Skript in general.
    Follow the tutorial by Adam here to start your bot off

  2. Make a new on guild ready event and set a temporary variable to a new slash command then update it

    on guild ready:
        set {_message} to a new slash command named "message" with description "Make the bot say something!"
        update {_message} globally in event-bot
    
  3. Add options for the slash command (optionally make it required)

    on guild ready:
        set {_message} to a new slash command named "message" with description "Make the bot say something!"
        add new string option named "message" with description "Set a message!" to options of {_message}
        # add new required string option named "message" with description "Set a message!" to options of {_message}
        update {_message} globally in event-bot
    
  4. Make the slash command do something!

    on guild ready:
        set {_message} to a new slash command named "message" with description "Make the bot say something!"
        add new string option named "message" with description "Set a message!" to options of {_message}
        # add new required string option named "message" with description "Set a message!" to options of {_message}
        update {_message} globally in event-bot
    
    on slash command:
        if event-string is "message":
            set {_message} to argument "message" as user
            reply with {_message}
    

If you did it correctly it should look like this:

Applications:

  1. You need to have the basic understanding of DiSky and Skript in general.
    Follow the tutorial by Adam here to start your bot off

  2. Make a new on guild ready event and set a temporary variable to a new user command then update it

    on guild ready:
        set {_online} to a new user command named "online"
        update {_online} globally in event-bot
    
  3. Make the User Command do something!

    on guild ready:
        set {_online} to a new user command named "online"
        update {_online} globally in event-bot
    
    on user command:
        if event-string is "online":
            reply with "There are %size of all players% online! %nl% %all players%"
    

If you did it correctly it should look like this:

Conclusion:

If you've done it all correctly, it should look like this:

on guild ready:
    set {_online} to a new user command named "online"
    set {_message} to a new slash command named "message" with description "Make the bot say something!"
    add new string option named "message" with description "Set a message!" to options of {_message}
    # add new required string option named "message" with description "Set a message!" to options of {_message}
    update {_message} and {_online} globally in event-bot

on slash command:
    if event-string is "message":
        set {_message} to argument "message" as user
        reply with {_message}

on user command:
    if event-string is "online":
        reply with "There are %size of all players% online! %nl% %all players%"

Thanks for reading!


Did you find Aabsss's tutorial helpful?


You must be logged in to comment