From fcc0df0bf0f1ba2c7963d36719c5625e80203d4d Mon Sep 17 00:00:00 2001 From: lnguy Date: Tue, 21 Nov 2023 17:32:06 +0100 Subject: [PATCH] Add discord support --- requirements.txt | 2 +- src/dc/connector.py | 10 +++ src/json_movelist/azucena.json | 148 ++++++++++++++++----------------- src/main.py | 35 ++++++-- src/module/configurator.py | 22 +++++ src/resources/config.json | 1 - 6 files changed, 135 insertions(+), 83 deletions(-) create mode 100644 src/dc/connector.py create mode 100644 src/module/configurator.py diff --git a/requirements.txt b/requirements.txt index 141e4ad..eea38cf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ beautifulsoup4==4.11.1 -discord.py==0.16.12 +discord.py==2.3.2 pymediawiki==0.7.3 Requests==2.31.0 diff --git a/src/dc/connector.py b/src/dc/connector.py new file mode 100644 index 0000000..d1a1c72 --- /dev/null +++ b/src/dc/connector.py @@ -0,0 +1,10 @@ +import discord +from discord import app_commands + + +class Discord_Connector(discord.Client): + def __init__(self, *, intents: discord.Intents): + super().__init__(intents=intents) + self.tree = app_commands.CommandTree(self) + async def on_ready(self): + print('Logged on as', self.user) diff --git a/src/json_movelist/azucena.json b/src/json_movelist/azucena.json index efd4d84..5446ac3 100644 --- a/src/json_movelist/azucena.json +++ b/src/json_movelist/azucena.json @@ -19,7 +19,7 @@ "id": "Azucena-1,1", "input": "1,1", "name": "High Mountain Combo", - "notes": "\n*Combo from 1st hit\n*Transition to LIB on hit only", + "notes": "\n* Combo from 1st hit\n* Transition to LIB on hit only", "on_block": "-9~-8", "on_ch": "", "on_hit": "+8", @@ -47,7 +47,7 @@ "id": "Azucena-1,2", "input": "1,2", "name": "High Roast Combo", - "notes": "\n*Combo from 1st hit\n*\nBalcony break", + "notes": "\n* Combo from 1st hit with 4f delay\n* \nBalcony break", "on_block": "-14~-13", "on_ch": "", "on_hit": "+8~+9", @@ -61,7 +61,7 @@ "id": "Azucena-1+2+3+4", "input": "1+2+3+4", "name": "Ki Charge", - "notes": "\n*Cannot block for 5 seconds\n*CH state for 5 seconds", + "notes": "\n* Cannot block for 5 seconds\n* CH state for 5 seconds", "on_block": "", "on_ch": "", "on_hit": "", @@ -89,7 +89,7 @@ "id": "Azucena-1,2~B", "input": "1,2~B", "name": "", - "notes": "\n*Combo from 1st hit\n*\nBalcony break", + "notes": "\n* Combo from 1st hit with 4f delay\n* \nBalcony break", "on_block": "-14~-13", "on_ch": "", "on_hit": "+8~+9", @@ -103,7 +103,7 @@ "id": "Azucena-1+3", "input": "1+3", "name": "Amaru Head Squeeze", - "notes": "\n*Throw break 1 or 2", + "notes": "\n* Throw break 1 or 2", "on_block": "-3", "on_ch": "", "on_hit": "+0d", @@ -131,7 +131,7 @@ "id": "Azucena-1+3+4*", "input": "1+3+4*", "name": "Shuffle Recital", - "notes": "Regenerates heat", + "notes": "\n* Regenerates heat\n* Heat meter won't disappear, even if it fully depletes", "on_block": "", "on_ch": "", "on_hit": "", @@ -159,7 +159,7 @@ "id": "Azucena-2,1", "input": "2,1", "name": "", - "notes": "Combo from 1st hit with ?f delay", + "notes": "Combo from 1st hit with 4f delay", "on_block": "-3~-2", "on_ch": "", "on_hit": "+7~+8", @@ -173,7 +173,7 @@ "id": "Azucena-2,1,2", "input": "2,1,2", "name": "Andes Mountain Uppercut Combo", - "notes": "\n* \nTornado\n* \nBalcony break\n* Combo from 2nd CH with ?f delay", + "notes": "\n* \nTornado\n* \nBalcony break\n* Combo from 2nd CH with 5f delay\n* Input can be delayed 10f", "on_block": "-5~-4", "on_ch": "", "on_hit": "+20a (+3)", @@ -215,7 +215,7 @@ "id": "Azucena-2+4", "input": "2+4", "name": "El Dorado Neck Snap", - "notes": "\n*Throw break 1 or 2\n*Side switch", + "notes": "\n* Throw break 1 or 2\n* Side switch", "on_block": "-3", "on_ch": "", "on_hit": "+0d", @@ -243,7 +243,7 @@ "id": "Azucena-3,2", "input": "3,2", "name": "Groovy Strike", - "notes": "\n*\nBalcony break\n*Combo from 1st hit with ?f delay\n*Input can be delayed ?f", + "notes": "\n* \nBalcony break\n* Combo from 1st hit with 5f delay\n* Input can be delayed 10f delay}", "on_block": "-12~-11", "on_ch": "+33d (+25)", "on_hit": "+6~+7", @@ -271,7 +271,7 @@ "id": "Azucena-3,3", "input": "3,3", "name": "Groovy Punalada", - "notes": "\n*\nBalcony break\n*Combo from 1st hit with ?f delay\n*Input can be delayed ?f", + "notes": "\n* \nBalcony break\n* Combo from 1st hit with 6f delay", "on_block": "-1~+0", "on_ch": "", "on_hit": "+43a (-15)", @@ -313,7 +313,7 @@ "id": "Azucena-4,3", "input": "4,3", "name": "Delfin Patadas", - "notes": "\n*Balcony Break on CH\n*Combo from 1st CH with ?f delay\n*Input can be delayed ?f", + "notes": "\n* Balcony Break on CH\n* Combo from 1st CH with 8f delay\n* Input can be delayed 12f", "on_block": "-11~-10", "on_ch": "+37a", "on_hit": "+19c~+20c", @@ -341,7 +341,7 @@ "id": "Azucena-b+1,1", "input": "b+1,1", "name": "", - "notes": "Combo from 1st hit", + "notes": "Combo from 1st hit with 6f delay", "on_block": "+3", "on_ch": "", "on_hit": "+8", @@ -355,7 +355,7 @@ "id": "Azucena-b+1,1,2", "input": "b+1,1,2", "name": "Double Blend Tempestad", - "notes": "\n*\nBalcony break\n*Combo from 2nd CH\n*Input can be delayed ?f", + "notes": "\n* \nBalcony break\n* Combo from 2nd CH with 6f delay\n* Input can be delayed 9f\n* Chip damage on block", "on_block": "-5~-4", "on_ch": "", "on_hit": "+17a (+8)", @@ -453,7 +453,7 @@ "id": "Azucena-b+4,3", "input": "b+4,3", "name": "", - "notes": "\n*\nKnee\n*Combo from 1st hit\n*Input can be delayed ?f", + "notes": "\n* \nKnee\n* Combo from 1st hit with 6f delay", "on_block": "-10~-9", "on_ch": "", "on_hit": "+4~+5", @@ -467,7 +467,7 @@ "id": "Azucena-b+4,3,4", "input": "b+4,3,4", "name": "", - "notes": "\n*\nKnee\n*Combo from 2nd CH\n*Input can be delayed ?f", + "notes": "\n* \nKnee\n* Combo from 2nd CH with 10f delay", "on_block": "-10~-9", "on_ch": "", "on_hit": "-2~-1", @@ -481,7 +481,7 @@ "id": "Azucena-b+4,3,4,3", "input": "b+4,3,4,3", "name": "Seattle Skipper", - "notes": "\n*\nKnee\n*\nBalcony break\n*Combo from 2nd CH\n*Combo from 3rd hit\n*Input can be delayed ?f", + "notes": "\n* \nKnee\n* \nBalcony break\n* Combo from 2nd CH with 6f delay\n* Combo from 3rd hit with 2f delay\n* Input can be delayed 6f", "on_block": "-7~-6", "on_ch": "", "on_hit": "+39d (-19)", @@ -495,7 +495,7 @@ "id": "Azucena-Back throw", "input": "Back throw", "name": "Caffeine Abduction", - "notes": "\n*Throw break 2", + "notes": "\n* Throw break 2", "on_block": "", "on_ch": "", "on_hit": "+0d", @@ -551,7 +551,7 @@ "id": "Azucena-BT.1,2", "input": "BT.1,2", "name": "Mocha Attaque Matari", - "notes": "\n*\nBalcony break\n*Combo from 1st hit\n*Input can be delayed ?f", + "notes": "\n* \nBalcony break\n* Combo from 1st hit with 2f delay\n* Combo from 1st CH with 4f delay\n* Input can be delayed 10f", "on_block": "-7~-6", "on_ch": "", "on_hit": "+19a (+10)", @@ -579,7 +579,7 @@ "id": "Azucena-BT.1,4", "input": "BT.1,4", "name": "Mocha Attaque Sidamo", - "notes": "\n*Combo from 1st hit\n*Will not combo if the kick impacts on i25\n*Input can be delayed ?f", + "notes": "\n* Combo from 1st hit\n* Combo from 1st CH with 2f delay\n* Input can be delayed 10f\n* Will not combo if the kick impacts on i25", "on_block": "-11~-10", "on_ch": "+52a", "on_hit": "+8~+9", @@ -607,7 +607,7 @@ "id": "Azucena-BT.2,2", "input": "BT.2:2", "name": "Qhapaq Ñan", - "notes": "\n*Transitions to attack throw on front hit only", + "notes": "Transitions to attack throw on front hit only", "on_block": "", "on_ch": "", "on_hit": "+0d", @@ -663,7 +663,7 @@ "id": "Azucena-BT.4,3", "input": "BT.4,3", "name": "Upbeat Patadas", - "notes": "\n*\nTornado\n*\nBalcony break\n*Combo from 1st hit with ?f delay\n*Input can be delayed ?f\n*Only hits grounded up close", + "notes": "\n* \nTornado\n* \nBalcony break\n* Combo from 1st hit with 6f delay\n* Input can be delayed 10f\n* Only hits grounded up close", "on_block": "-14~-13", "on_ch": "", "on_hit": "+16a (-1)", @@ -747,7 +747,7 @@ "id": "Azucena-d+1+2", "input": "d+1+2", "name": "UFO Roll", - "notes": "\n*Transition to throw on front hit only\n*Azucena will recieve 18 damage when blocked\n*r41 FC on whiff", + "notes": "\n* Transition to throw on front hit only\n* Azucena will recieve 18 damage when blocked\n* r41 FC on whiff", "on_block": "-4", "on_ch": "", "on_hit": "+0d", @@ -761,7 +761,7 @@ "id": "Azucena-d+1+3_d+2+4", "input": "d+1+3_d+2+4", "name": "Smell the Coffee", - "notes": "\n*\nHeat Engager\n*Crouch throw", + "notes": "\n* \nHeat Engager\n* Crouch throw", "on_block": "", "on_ch": "", "on_hit": "+0d", @@ -789,7 +789,7 @@ "id": "Azucena-d+2,3", "input": "d+2,3", "name": "La Niña Kick Combo", - "notes": "\n*\nBalcony break\n*Combo from 1st hit", + "notes": "\n* \nBalcony break\n* Combo from 1st hit with 7f delay", "on_block": "+1~+2", "on_ch": "", "on_hit": "+16g~+17g", @@ -817,7 +817,7 @@ "id": "Azucena-d+3,3", "input": "d+3,3", "name": "", - "notes": "Combo from 1st CH with ?f delay", + "notes": "\n* Combo from 1st CH with 7f delay\n* Input can be delayed 10f", "on_block": "-13", "on_ch": "", "on_hit": "+1", @@ -831,7 +831,7 @@ "id": "Azucena-d+3,3,4", "input": "d+3,3,4", "name": "Passionate Kick Combo", - "notes": "\n*\nTornado\n*\nBalcony break\n*Combo from 2nd CH with ?f delay", + "notes": "\n* \nTornado\n* \nBalcony break\n* Combo from 2nd CH with 10f delay", "on_block": "-14~-13", "on_ch": "", "on_hit": "+15a (-2)", @@ -858,8 +858,8 @@ "gif": "", "id": "Azucena-d+4,1", "input": "d+4,1", - "name": "Roast Kunckle Combo", - "notes": "\n*Combo from 1st CH\n*Input can be delayed ?f", + "name": "Roast Knuckle Combo", + "notes": "\n* Combo from 1st CH with 2f delay\n* Input can be delayed 10f", "on_block": "-1~+0", "on_ch": "", "on_hit": "+3~+4", @@ -872,8 +872,8 @@ "gif": "", "id": "Azucena-d+4,1~2", "input": "d+4,1~2", - "name": "Full City Roast Kunckle Combo", - "notes": "\n*\nBalcony break\n*Wall crush on hit", + "name": "Full City Roast Knuckle Combo", + "notes": "\n* \nBalcony break\n* Wall crush on hit", "on_block": "-8~-7", "on_ch": "", "on_hit": "+10g~+11g", @@ -957,7 +957,7 @@ "id": "Azucena-db+3,4", "input": "db+3,4", "name": "Borrasca Kick Combo", - "notes": "\n*\nTornado\n*\nBalcony break\n*Combo from 1st CH", + "notes": "\n* \nTornado\n* \nBalcony break\n* Combo from 1st CH", "on_block": "-13~-12", "on_ch": "", "on_hit": "+66a (+50)", @@ -999,7 +999,7 @@ "id": "Azucena-df+1,4", "input": "df+1,4", "name": "", - "notes": "\n*Jail from 1st attack\n*Combo from 1st hit with ?f delay", + "notes": "\n*Jail from 1st attack with 1f delay\n*Combo from 1st hit with 8f delay", "on_block": "-7~-6", "on_ch": "", "on_hit": "+4~+5", @@ -1013,7 +1013,7 @@ "id": "Azucena-df+1,4,1", "input": "df+1,4,1", "name": "Grande Combo", - "notes": "\n*\nBalcony break\n*Combo from 2nd CH", + "notes": "\n* \nBalcony break\n* Combo from 2nd CH with 7f delay\n* Combo from 2nd CH with 8f delay", "on_block": "-5~-4", "on_ch": "+56a", "on_hit": "+44d (-14)", @@ -1097,7 +1097,7 @@ "id": "Azucena-df+4,1", "input": "df+4,1", "name": "Blue Mountain Combo", - "notes": "\n*\nTornado\n*\nBalcony break\n*Combo from 1st hit with ?f delay\n*Combo from 1st CH with ?f delay\n*Input can be delayed ?f", + "notes": "\n* \nTornado\n* \nBalcony break\n* Combo from 1st hit with 6f delay\n* Input can be delayed 10f", "on_block": "-5~-4", "on_ch": "", "on_hit": "+20a (+3)", @@ -1139,7 +1139,7 @@ "id": "Azucena-f+2,1", "input": "f+2,1", "name": "", - "notes": "\n*Combo from 1st hit with ?f delay\n*Combo from 1st CH with ?f delay\n*Input can be delayed ?f", + "notes": "\n* Combo from 1st hit with 7f delay\n* Input can be delayed 8f", "on_block": "-10~-9", "on_ch": "", "on_hit": "+5~+6", @@ -1153,7 +1153,7 @@ "id": "Azucena-f+2,1,4", "input": "f+2,1,4", "name": "Danza Del Cóndor", - "notes": "\n*\nBalcony break\n*Combo from 2nd CH with ?f delay\n*Input can be delayed ?f", + "notes": "\n* \nBalcony break\n* Combo from 2nd CH with 10f delay", "on_block": "-14~-13", "on_ch": "", "on_hit": "+19a (+9)", @@ -1181,7 +1181,7 @@ "id": "Azucena-f+3,2", "input": "f+3,2", "name": "Sumatra Back Knuckle", - "notes": "\n*\nBalcony break\n*Combo from 1st hit with ?f delay", + "notes": "\n*\nBalcony break\n*Combo from 1st hit with 8f delay", "on_block": "-4~-5", "on_ch": "", "on_hit": "+22a", @@ -1209,7 +1209,7 @@ "id": "Azucena-f+3+4*", "input": "f+3+4*", "name": "Shuffle Jamboree", - "notes": "Regenerates heat", + "notes": "\n* Regenerates heat\n* Heat meter won't disappear, even if it fully depletes", "on_block": "", "on_ch": "", "on_hit": "", @@ -1293,7 +1293,7 @@ "id": "Azucena-FC.1+2", "input": "FC.1+2", "name": "Ultimate Tackle", - "notes": "\n*Throw break 1+2", + "notes": "\n* Throw break 1+2", "on_block": "-5", "on_ch": "", "on_hit": "+3", @@ -1307,7 +1307,7 @@ "id": "Azucena-FC.1+2,1+2", "input": "FC.1+2,1+2", "name": "Arm Breaker", - "notes": "\n*Throw break 1+2", + "notes": "\n* Throw break 1+2", "on_block": "-9", "on_ch": "", "on_hit": "+1d", @@ -1321,7 +1321,7 @@ "id": "Azucena-FC.1+2,2,1,2,1", "input": "FC.1+2,2,1,2,1", "name": "Ultimate Punch", - "notes": "\n*Throw break 1 or 2\n*Alternate Input: 1,2,1,2", + "notes": "\n* Throw break 1 or 2\n* Alternate Input: 1,2,1,2", "on_block": "", "on_ch": "", "on_hit": "+0d", @@ -1419,7 +1419,7 @@ "id": "Azucena-f,F+3+4", "input": "f,F+3+4", "name": "Ortiz Molino", - "notes": "\n*\nSpike\n*Chip damage on block\n*Can recover BT with B", + "notes": "\n* \nSpike\n* Chip damage on block\n* Can recover BT with B", "on_block": "+4~+6", "on_ch": "", "on_hit": "+5~+7", @@ -1433,7 +1433,7 @@ "id": "Azucena-f,F+4", "input": "f,F+4", "name": "Demitasse Molino", - "notes": "\n*\nSpike\n*Chip damage on block", + "notes": "\n* \nSpike\n* Chip damage on block", "on_block": "+0~+2", "on_ch": "", "on_hit": "+13~+15", @@ -1461,7 +1461,7 @@ "id": "Azucena-f,f,F+3,2", "input": "f,f,F+3,2", "name": "Espresso Agresión", - "notes": "\n*\nBalcony break\n*Jail from 1st attack\n*Combo from 1st hit\n*Chip damage on block", + "notes": "\n* \nBalcony break\n* Jail from 1st attack\n* Combo from 1st hit\n* Chip damage on block", "on_block": "+5~+7", "on_ch": "", "on_hit": "+28a (+2)", @@ -1587,7 +1587,7 @@ "id": "Azucena-H.f+3+4", "input": "H.f+3+4", "name": "Libertador Revolución", - "notes": "\n*Parries all high/low attacks\n*Cancel to r20 with DB", + "notes": "\n* Parries all high/low attacks\n* Cancel to r20 with DB", "on_block": "", "on_ch": "", "on_hit": "", @@ -1643,7 +1643,7 @@ "id": "Azucena-H.LIB.d+3+4", "input": "H.LIB.d+3+4", "name": "One Drip Cielo", - "notes": "\n*\nTornado\n*Regenerates heat\n*Restores recoverable health", + "notes": "\n* \nTornado\n* Regenerates heat\n* Restores recoverable health", "on_block": "-9~-7", "on_ch": "", "on_hit": "+58a (+42)", @@ -1656,8 +1656,8 @@ "gif": "", "id": "Azucena-H.LIB.P (High)", "input": "H.LIB.P (High)", - "name": "Puño de Fuego Evitación", - "notes": "\n*Regenerates heat\n*Restores recoverable health", + "name": "Puño de Fuego Evitacion", + "notes": "\n* Regenerates heat\n* Restores recoverable health", "on_block": "", "on_ch": "", "on_hit": "+32a", @@ -1670,8 +1670,8 @@ "gif": "", "id": "Azucena-H.LIB.P (Low)", "input": "H.LIB.P (Low)", - "name": "One Drip Cielo Evitación", - "notes": "\n*\nTornado\n*Regenerates heat\n*Restores recoverable health", + "name": "One Drip Cielo Evitacion", + "notes": "\n* \nTornado\n* Regenerates heat\n* Restores recoverable health", "on_block": "", "on_ch": "", "on_hit": "+58a (+42)", @@ -1685,7 +1685,7 @@ "id": "Azucena-Left Throw", "input": "Left throw", "name": "Urubamba Neck Lock", - "notes": "\n*Throw break 1", + "notes": "\n* Throw break 1", "on_block": "-3", "on_ch": "", "on_hit": "-3d", @@ -1713,7 +1713,7 @@ "id": "Azucena-LIB.1+2", "input": "LIB.1+2", "name": "Rana Barista", - "notes": "\n*\nTornado\n*Cancel to r20 BT with B", + "notes": "\n* \nTornado\n* Cancel to r20 BT with B", "on_block": "-14~-13", "on_ch": "", "on_hit": "+38a (+28)", @@ -1727,7 +1727,7 @@ "id": "Azucena-LIB.1,2", "input": "LIB.1,2", "name": "Blend Tempestad", - "notes": "\n*\nBalcony break\n*Combo from 1st hit\n*Input can be delayed ?f\n*Chip damage on block", + "notes": "\n* \nBalcony break\n* Combo from 1st hit with 6f delay\n* Input can be delayed 9f\n* Chip damage on block", "on_block": "-5~-4", "on_ch": "", "on_hit": "+17a (+8)", @@ -1783,7 +1783,7 @@ "id": "Azucena-LIB.3,1", "input": "LIB.3,1", "name": "Blend Reganar", - "notes": "\n*\nSpike\n*Combo from 1st CH with ?f delay\n*Input can be delayed ?f", + "notes": "\n* \nSpike\n* Combo from 1st CH with 7f delay\n* Input can be delayed 8f", "on_block": "-10~-9", "on_ch": "+21d", "on_hit": "+7c~+8c", @@ -1797,7 +1797,7 @@ "id": "Azucena-LIB.3+4", "input": "LIB.3+4", "name": "El Niño High Kick", - "notes": "\n*\nBalcony break\n*\nHoming\n*Chip damage on block", + "notes": "\n* \nBalcony break\n* \nHoming\n* Chip damage on block", "on_block": "-5~-4", "on_ch": "", "on_hit": "+32a", @@ -1825,7 +1825,7 @@ "id": "Azucena-LIB.4,1", "input": "LIB.4,1", "name": "", - "notes": "\n*Combo from 1st hit with ?f delay\n*Combo from 1st CH with ?f delay\n*Input can be delayed ?f", + "notes": "Combo from 1st hit with 9f delay", "on_block": "-2~-1", "on_ch": "+9~+10", "on_hit": "+4~+5", @@ -1839,7 +1839,7 @@ "id": "Azucena-LIB.4,1,2", "input": "LIB.4,1,2", "name": "Blend Asaltar", - "notes": "\n*\nTornado\n*\nBalcony break\n*Combo from 2nd CH with ?f delay", + "notes": "\n* \nTornado\n* \nBalcony break\n* Combo from 2nd CH with 1f delay\n* Input can be delayed 10f", "on_block": "-10~-9", "on_ch": "", "on_hit": "+67a (+51)", @@ -1853,7 +1853,7 @@ "id": "Azucena-LIB.4,2", "input": "LIB.4,2", "name": "Blend Martillo", - "notes": "\n*Combo from 1st hit with ?f delay\n*\nBalcony break\n*\nSpike", + "notes": "\n* \nBalcony break\n* \nSpike\n* Combo from 1st hit with 5f delay", "on_block": "-13~-12", "on_ch": "", "on_hit": "+16a", @@ -1867,7 +1867,7 @@ "id": "Azucena-LIB.B", "input": "LIB.B", "name": "Salida Castillo", - "notes": "\n*Parries all high/low attacks", + "notes": "Parries all high/low attacks", "on_block": "", "on_ch": "", "on_hit": "", @@ -1909,7 +1909,7 @@ "id": "Azucena-LIB.d+1+3_d+2+4", "input": "LIB.d+1+3_d+2+4", "name": "Smell the Coffee", - "notes": "\n*\nHeat Engager\n*Crouch throw", + "notes": "\n* \nHeat Engager\n* Crouch throw", "on_block": "", "on_ch": "", "on_hit": "+0d", @@ -1951,7 +1951,7 @@ "id": "Azucena-LIB.F", "input": "LIB.F", "name": "Azucena Admission", - "notes": "\n*Parries all high/low attacks\n*Regenerates heat with each step", + "notes": "\n* Parries all high/low attacks\n* Regenerates heat with each step", "on_block": "", "on_ch": "", "on_hit": "", @@ -2007,7 +2007,7 @@ "id": "Azucena-LIB.U_D", "input": "LIB.U_D", "name": "Milagros Show", - "notes": "\n*Parries all high/low attacks\n*Regenerates heat with each step", + "notes": "\n* Parries all high/low attacks\n* Regenerates heat with each step", "on_block": "", "on_ch": "", "on_hit": "", @@ -2021,7 +2021,7 @@ "id": "Azucena-LIB.uf+1", "input": "LIB.uf+1", "name": "Eye Opener", - "notes": "\n*\nBalcony break\n*Punch Sabaki\n*Wall crush on hit\n*Alternate Input: LIB.b,​​b+1", + "notes": "\n* \nBalcony break\n* Punch Sabaki\n* Wall crush on hit\n* Alternate Input: LIB.b,​​b+1", "on_block": "-9~-8", "on_ch": "", "on_hit": "+7~+8", @@ -2035,7 +2035,7 @@ "id": "Azucena-LIB.uf+1+2", "input": "LIB.uf+1+2", "name": "Inti Raymi Necklace", - "notes": "\n*Throw break 1+2\n*Side switch", + "notes": "\n* Throw break 1+2\n* Side switch", "on_block": "+0", "on_ch": "", "on_hit": "-3d", @@ -2063,7 +2063,7 @@ "id": "Azucena-LIB.uf+2", "input": "LIB.uf+2", "name": "Rhythmic Hook", - "notes": "\n*\nBalcony break", + "notes": "Balcony break", "on_block": "-6~-7", "on_ch": "+51a", "on_hit": "+15 (+6)", @@ -2091,7 +2091,7 @@ "id": "Azucena-Right Throw", "input": "Right throw", "name": "Giratorio Sleeper Throw", - "notes": "\n*Throw break 2", + "notes": "\n* Throw break 2", "on_block": "-3", "on_ch": "", "on_hit": "+0d", @@ -2119,7 +2119,7 @@ "id": "Azucena-uf+1", "input": "uf+1", "name": "Eye Opener", - "notes": "\n*\nBalcony break\n*Punch Sabaki\n*Wall crush on hit\n*Alternate input: ub+1, u+1", + "notes": "\n* \nBalcony break\n* Punch Sabaki\n* Wall crush on hit\n* Alternate input: ub+1, u+1", "on_block": "-9~-8", "on_ch": "", "on_hit": "+7~+8", @@ -2133,7 +2133,7 @@ "id": "Azucena-uf+1+2", "input": "uf+1+2", "name": "Inti Raymi Necklace", - "notes": "\n*Throw break 1+2\n*Side switch", + "notes": "\n* Throw break 1+2\n* Side switch", "on_block": "+0", "on_ch": "", "on_hit": "-3d", @@ -2161,7 +2161,7 @@ "id": "Azucena-uf+2", "input": "uf+2", "name": "Rhythmic Hook", - "notes": "\n*\nBalcony break\n*Alternate input: ub+2, u+2", + "notes": "\n* \nBalcony break\n* Alternate input: ub+2, u+2", "on_block": "-6~-7", "on_ch": "+51a", "on_hit": "+15 (+6)", @@ -2189,7 +2189,7 @@ "id": "Azucena-uf+3,4", "input": "uf+3,4", "name": "Daylight Disk", - "notes": "\n*\nBalcony break\n*Alternate input: ub+3,4, u+3,4", + "notes": "\n* \nBalcony break\n* Alternate input: ub+3,4, u+3,4", "on_block": "-14~-13", "on_ch": "+55a", "on_hit": "+15a (+6)", @@ -2203,7 +2203,7 @@ "id": "Azucena-uf+4", "input": "uf+4", "name": "Tacones Drip", - "notes": "\n*\nSpike\n*Alternate input: ub+4, u+4", + "notes": "\n* \nSpike\n* Alternate input: ub+4, u+4", "on_block": "-8~-6", "on_ch": "", "on_hit": "+21a~+23a", @@ -2273,7 +2273,7 @@ "id": "Azucena-ws4,1", "input": "ws4,1", "name": "", - "notes": "\n*Combo from 1st hit\n*Input can be delayed ?f", + "notes": "Combo from 1st hit with 6f delay", "on_block": "-2~-1", "on_ch": "", "on_hit": "+6~+7", @@ -2287,7 +2287,7 @@ "id": "Azucena-ws4,1,3", "input": "ws4,1,3", "name": "Combo de Cantuta", - "notes": "\n*\nBalcony break\n*Combo from 2nd CH\n*Input can be delayed ?f", + "notes": "\n* \nBalcony break\n* Combo from 2nd CH with 7f delay\n* Input can be delayed 10f", "on_block": "-14~-13", "on_ch": "+27a", "on_hit": "+10a (+1)", diff --git a/src/main.py b/src/main.py index 9c18d4a..5719c9c 100644 --- a/src/main.py +++ b/src/main.py @@ -1,14 +1,35 @@ -import json +import json, datetime, logging, os +import discord from src.module import character_importer +from src.dc.connector import Discord_Connector +from src.module import configurator + +logger = logging.getLogger(__name__) +logger.setLevel(logging.WARNING) + +base_path = os.path.dirname(__file__) +config = configurator.Configurator(os.path.abspath(os.path.join(base_path, "resources", "config.json"))) + +discord_token = config.read_config()['DISCORD_TOKEN'] + def create_all_character_json(character_list_path: str): - with open(character_list_path) as file: - characters = json.load(file) + try: + with open(character_list_path) as file: + characters = json.load(file) + + for character_meta in characters: + character = character_importer.import_character(character_meta) + character.export_movelist_as_json() + except Exception as e: + raise Exception("Error when importing character from wavu" + str(e)) - for character_meta in characters: - character = character_importer.import_character(character_meta) - character.export_movelist_as_json() +try: + client = Discord_Connector(intents=discord.Intents.default()) + client.run(discord_token) -create_all_character_json("resources/character_list.json") \ No newline at end of file +except Exception as e: + time_now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + logger.error(f'{time_now} \n Error: {e}') diff --git a/src/module/configurator.py b/src/module/configurator.py new file mode 100644 index 0000000..8cbdcf0 --- /dev/null +++ b/src/module/configurator.py @@ -0,0 +1,22 @@ +import os, json + +class Configurator: + def __init__(self, config_path): + self.config_path = config_path + + def create_file_if_not_exist(self): + if not os.path.exists(self.config_path): + with open(self.config_path, "w"): pass + + def read_config(self) -> dict: + self.create_file_if_not_exist() + with open(self.config_path) as config_json: + config_data = json.load(config_json) + + return config_data + + def write_config(self, config_json): + self.create_file_if_not_exist() + with open(self.config_path, "w") as outfile: + json.dump(config_json, outfile, indent=4) + diff --git a/src/resources/config.json b/src/resources/config.json index ca4bbc7..5fda1a0 100644 --- a/src/resources/config.json +++ b/src/resources/config.json @@ -1,5 +1,4 @@ { "DISCORD_TOKEN": "", - "GITHUB_TOKEN": "", "FEEDBACK_CHANNEL_ID" : 1 }