Paste #51432: okay maybe pls discord tho

Date: 2019/01/08 15:23:52 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


behrbot_bot:
    type: world
 #   debug: false
    script_paths:
        stop_bot:
        - if <server.has_flag[behrbot_bot_running]>
          - discord id:behrbot disconnect
          - flag server behrbot_bot_running:!
        start_bot:
        - inject locally script_paths.stop_bot
        - yaml load:data/behrbot.yml id:behrbot_temp
        - if !<yaml.list.contains_text[behrbot_temp]>
          - debug error "Load failed."
          - queue clear
#
        - flag server behrbot_validchannels:!
        - flag server behrbot_validchannels:|:<yaml[behrbot_temp].read[bot.discord.valid_channels]>
        - flag server behrbot_barredchannels:!
        - flag server behrbot_barredchannels:|:<yaml[behrbot_temp].read[bot.discord.barred_channels]>
        - flag server behrbot_barredchannelmessages:!
        - flag server behrbot_barredchannelmessages:|:<yaml[behrbot_temp].read[bot.discord.barred_channel_messages]>
#
        - discord id:behrbot connect code:<yaml[behrbot_temp].read[bot.discord.token]>
        - yaml unload id:behrbot_temp
#
        - flag server behrbot_bot_running
    events:
        #on server start: ##simulate server star
        on player breaks grass:
        - wait 5s
        - flag server behrbot_bot_running:!
        - inject locally script_paths.start_bot
        on script generates error:
        - flag server behrbot_result_temp:FAILED=ERROR/<context.message.escaped.replace[;].with[&sc]>;<server.flag[behrbot_result_temp]||>
        on script generates exception:
        - flag server behrbot_result_temp:FAILED=EXCEPTION/<context.type.escaped.replace[;].with[&sc]><context.message.escaped.replace[;].with[&sc]>;<server.flag[behrbot_result_temp]||> 
        on player chats:
        - discord id:behrbot message channel:<yaml[behrbot_temp].read[bot.discord.valid_channels]>  "<context.message>"
        - narrate format:cf "success discord"