From e5af875034a4aa9f609e07ba59b2ce02c4011693 Mon Sep 17 00:00:00 2001 From: Astoria Floyd Date: Fri, 13 Aug 2021 20:27:51 +0000 Subject: [PATCH] Proper Fumo Functionality added. --- API/fumoLines.sh | 3 +++ API/fumoList.sh | 2 ++ API/tools.lua | 12 ++++-------- commands/complexCommands.lua | 5 ++--- fumoCopy.sh | 2 -- {fumo => fumoGif}/fumo-fumofumo.gif | Bin {fumo => fumoGif}/fumo-shawarma.gif | Bin .../me-going-to-sleep-knowing-touhou.gif | Bin {fumo => fumoGif}/remilia-scarlet.gif | Bin {fumo => fumoGif}/sakuya-fumo.gif | Bin {fumo => fumoGif}/touhou-cirno.gif | Bin {fumo => fumoGif}/touhou-fumo-touhou.gif | Bin {fumo => fumoGif}/touhou-fumo.gif | Bin {fumo => fumoGif}/touhou-fumomo.gif | Bin {fumo => fumoGif}/touhou-fumomoment.gif | Bin fumoLines.sh | 3 --- fumoList.sh | 2 -- 17 files changed, 11 insertions(+), 18 deletions(-) create mode 100755 API/fumoLines.sh create mode 100755 API/fumoList.sh delete mode 100755 fumoCopy.sh rename {fumo => fumoGif}/fumo-fumofumo.gif (100%) rename {fumo => fumoGif}/fumo-shawarma.gif (100%) rename {fumo => fumoGif}/me-going-to-sleep-knowing-touhou.gif (100%) rename {fumo => fumoGif}/remilia-scarlet.gif (100%) rename {fumo => fumoGif}/sakuya-fumo.gif (100%) rename {fumo => fumoGif}/touhou-cirno.gif (100%) rename {fumo => fumoGif}/touhou-fumo-touhou.gif (100%) rename {fumo => fumoGif}/touhou-fumo.gif (100%) rename {fumo => fumoGif}/touhou-fumomo.gif (100%) rename {fumo => fumoGif}/touhou-fumomoment.gif (100%) delete mode 100755 fumoLines.sh delete mode 100755 fumoList.sh diff --git a/API/fumoLines.sh b/API/fumoLines.sh new file mode 100755 index 0000000..c71c26e --- /dev/null +++ b/API/fumoLines.sh @@ -0,0 +1,3 @@ +fumoFileText=$(find fumoGif/* | grep -i .gif) +fumoFileNumbers=$(wc -l <<< "$fumoFileText") +echo "$fumoFileNumbers" > "docs/fumoFile" \ No newline at end of file diff --git a/API/fumoList.sh b/API/fumoList.sh new file mode 100755 index 0000000..b56f417 --- /dev/null +++ b/API/fumoList.sh @@ -0,0 +1,2 @@ +fumoFileText=$(find fumoGif/* | grep -i .gif) +echo "$fumoFileText" > "docs/fumoFile" \ No newline at end of file diff --git a/API/tools.lua b/API/tools.lua index 0472563..81291ee 100644 --- a/API/tools.lua +++ b/API/tools.lua @@ -126,22 +126,18 @@ function tools.massDetection(folder, filetype) end function tools.fumoLines() - os.execute("/bin/bash fumoLines.sh") - local file = io.open("./fumoFile", "r") + os.execute("/bin/bash API/fumoLines.sh") + local file = io.open("./docs/fumoFile", "r") local fumoFile = file:read() file:close() return(fumoFile) end -function tools.fumoClone() - os.execute("/bin/bash fumoCopy.sh") -end - function tools.fumoList() local lineList = tools.fumoLines() local fumoList = {} - os.execute("/bin/bash fumoList.sh") - local file = io.open("./fumoFile", "r") + os.execute("/bin/bash API/fumoList.sh") + local file = io.open("./docs/fumoFile", "r") for i = lineList,1,-1 do local number = i diff --git a/commands/complexCommands.lua b/commands/complexCommands.lua index bd85d30..ceff95d 100644 --- a/commands/complexCommands.lua +++ b/commands/complexCommands.lua @@ -29,11 +29,10 @@ end exec = function (message) local fumoLines = tools.fumoLines() local fumoList = tools.fumoList() - tools.fumoClone() tools.seed() local fumo = fumoList[math.random(fumoLines)] - local msg = "https://broken-moon.net/"..fumo - message.channel:send(msg) + local msg = fumo + message.channel:send{file = msg} end }; diff --git a/fumoCopy.sh b/fumoCopy.sh deleted file mode 100755 index dd8da49..0000000 --- a/fumoCopy.sh +++ /dev/null @@ -1,2 +0,0 @@ -echo "$(rm /var/www/html/fumo/*)" -echo "$(cp fumo/*.gif /var/www/html/fumo)" \ No newline at end of file diff --git a/fumo/fumo-fumofumo.gif b/fumoGif/fumo-fumofumo.gif similarity index 100% rename from fumo/fumo-fumofumo.gif rename to fumoGif/fumo-fumofumo.gif diff --git a/fumo/fumo-shawarma.gif b/fumoGif/fumo-shawarma.gif similarity index 100% rename from fumo/fumo-shawarma.gif rename to fumoGif/fumo-shawarma.gif diff --git a/fumo/me-going-to-sleep-knowing-touhou.gif b/fumoGif/me-going-to-sleep-knowing-touhou.gif similarity index 100% rename from fumo/me-going-to-sleep-knowing-touhou.gif rename to fumoGif/me-going-to-sleep-knowing-touhou.gif diff --git a/fumo/remilia-scarlet.gif b/fumoGif/remilia-scarlet.gif similarity index 100% rename from fumo/remilia-scarlet.gif rename to fumoGif/remilia-scarlet.gif diff --git a/fumo/sakuya-fumo.gif b/fumoGif/sakuya-fumo.gif similarity index 100% rename from fumo/sakuya-fumo.gif rename to fumoGif/sakuya-fumo.gif diff --git a/fumo/touhou-cirno.gif b/fumoGif/touhou-cirno.gif similarity index 100% rename from fumo/touhou-cirno.gif rename to fumoGif/touhou-cirno.gif diff --git a/fumo/touhou-fumo-touhou.gif b/fumoGif/touhou-fumo-touhou.gif similarity index 100% rename from fumo/touhou-fumo-touhou.gif rename to fumoGif/touhou-fumo-touhou.gif diff --git a/fumo/touhou-fumo.gif b/fumoGif/touhou-fumo.gif similarity index 100% rename from fumo/touhou-fumo.gif rename to fumoGif/touhou-fumo.gif diff --git a/fumo/touhou-fumomo.gif b/fumoGif/touhou-fumomo.gif similarity index 100% rename from fumo/touhou-fumomo.gif rename to fumoGif/touhou-fumomo.gif diff --git a/fumo/touhou-fumomoment.gif b/fumoGif/touhou-fumomoment.gif similarity index 100% rename from fumo/touhou-fumomoment.gif rename to fumoGif/touhou-fumomoment.gif diff --git a/fumoLines.sh b/fumoLines.sh deleted file mode 100755 index a70e389..0000000 --- a/fumoLines.sh +++ /dev/null @@ -1,3 +0,0 @@ -fumoFileText=$(find fumo | grep -i .gif) -fumoFileNumbers=$(wc -l <<< "$fumoFileText") -echo "$fumoFileNumbers" > "fumoFile" \ No newline at end of file diff --git a/fumoList.sh b/fumoList.sh deleted file mode 100755 index 3c47c8e..0000000 --- a/fumoList.sh +++ /dev/null @@ -1,2 +0,0 @@ -fumoFileText=$(find fumo | grep -i .gif) -echo "$fumoFileText" > "fumoFile" \ No newline at end of file