Skip to content

Commit

Permalink
Added !curl
Browse files Browse the repository at this point in the history
  • Loading branch information
quartata committed Dec 23, 2016
1 parent 93af669 commit c32818f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tf2goat.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
from listeners import OnClientActive, OnClientDisconnect, OnConVarChanged, OnLevelInit
from listeners.tick import GameThread
from messages import SayText2
from paths import PLUGIN_PATH
from paths import GAME_PATH, PLUGIN_PATH
from players.helpers import playerinfo_from_index
from re import compile
from steam import SteamID
from subprocess import run
from time import sleep
from urllib.request import urlretrieve

file = open(PLUGIN_PATH + "/tf2goat/config.json", "r")
config = load(file)
Expand Down Expand Up @@ -146,6 +147,17 @@ def command_dispatch(cmd, sender):
send_command_response("Pull failed. Return code: %d" % result.returncode, sender, False)
else:
send_command_response("You do not have permission to do that.", sender, False)
elif cmd[0] == "!curl":
if id in elevated:
url, path = cmd[1].split(" ", 1)

try:
urlretrieve(url, filename=GAME_PATH + path)
send_command_response("Curl successful.", sender, False)
except:
send_command_response("Curl failed.", sender, False)
else:
send_command_response("You do not have permission to do that.", sender, False)
else:
send_command_response("No such command.", sender, False)

Expand Down

0 comments on commit c32818f

Please sign in to comment.