Skip to content

Commit

Permalink
Merge pull request #62 from Skyward-Brawlhalla/fix-bug-qsadli
Browse files Browse the repository at this point in the history
Fix bug qsadli
  • Loading branch information
CrossyChainsaw authored Sep 13, 2022
2 parents 8500cb1 + 26fbb5a commit ccef0c5
Show file tree
Hide file tree
Showing 20 changed files with 120 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
config.py
config.py
Binary file modified __pycache__/api.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/command_clan_list.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/command_clan_update.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/command_discord_list.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/command_discord_update.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/command_link_add.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/command_link_list.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/command_link_remove.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/command_link_update.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/command_status.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/command_waitinglist_list.cpython-38.pyc
Binary file not shown.
34 changes: 30 additions & 4 deletions command_link_add.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import json
import discord

h = 'hello time'
g = 'swagg moment'

class User:
def __init__(self, brawlhalla_id, brawlhalla_name, discord_id,
discord_name):
Expand All @@ -15,19 +18,34 @@ async def add_link(bot, ctx, brawlhalla_id, discord_id, embed_color):
link_data = json.load(data)
new_entry = True
for user in link_data:
if len(str(brawlhalla_id)) > 3:
if str(user['brawlhalla_id']) == str(brawlhalla_id):
await ctx.send('brawlhalla_id: ' + brawlhalla_id +
' has already been linked')
new_entry = False
break
else:
if str(user['brawlhalla_id'])[0:3:1] == str(brawlhalla_id)[0:3:1]:
await ctx.send('brawlhalla_id: ' + brawlhalla_id +
' has already been linked, if not try entering the full id')
new_entry = False
break
if len(str(discord_id)) > 3:
if str(user['discord_id']) == str(discord_id):
await ctx.send('discord_id: ' + discord_id +
' has already been linked')
new_entry = False
break
else:
if str(user['discord_id'])[0:3:1] == str(discord_id)[0:3:1]:
await ctx.send('discord_id: ' + discord_id +
' has already been linked, if not try entering the full id')
new_entry = False
break

brawlhalla_name = 'blank'
discord_name = 'blank'
short_hand = False

# check if ids are valid
if new_entry == True:
Expand All @@ -40,27 +58,35 @@ async def add_link(bot, ctx, brawlhalla_id, discord_id, embed_color):
if str(member['brawlhalla_id']) == str(brawlhalla_id):
valid_brawlhalla_id = True
brawlhalla_name = member['name']
elif str(member['brawlhalla_id'])[0:3:1] == str(brawlhalla_id)[0:3:1]:
if valid_brawlhalla_id == False:
for member in clan_data['clan']:
if str(member['brawlhalla_id'])[0:3:1] == str(brawlhalla_id)[0:3:1]:
brawlhalla_id = str(member['brawlhalla_id'])
valid_brawlhalla_id = True
brawlhalla_name = member['name']
short_hand = True
# check dc id
with open('./data_discord_' + ctx.guild.name + '.json') as data:
discord_data = json.load(data)
for account in discord_data:
if str(account['id']) == str(discord_id):
valid_discord_id = True
discord_name = account['name']
elif str(account['id'])[0:3:1] == str(discord_id)[0:3:1]:
if valid_discord_id == False:
for account in discord_data:
if str(account['id'])[0:3:1] == str(discord_id)[0:3:1]:
discord_id = str(account['id'])
valid_discord_id = True
discord_name = account['name']
short_hand = True

# if entry ids are valid, add it
if ((valid_brawlhalla_id == True) and (valid_discord_id == True)
and (new_entry == True)):

await ctx.send('Are you sure you want to add the following link?,')
if short_hand == True:
await ctx.send("I couldn't find the exact id's but I found the following id's. If these are wrong try writing out the full id's")
else:
await ctx.send('Are you sure you want to add the following link?,')
await ctx.send(
embed=discord.Embed(description='**brawlhalla_id**: ' +
brawlhalla_id + '\n**brawlhalla_name**: ' +
Expand Down
4 changes: 3 additions & 1 deletion data_clan_Dair.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"clan_id": 1357965, "clan_name": "Dair", "clan_create_date": 1609151553, "clan_xp": "1593949", "clan": [{"brawlhalla_id": 6746620, "name": "sgrape", "rank": "Leader", "join_date": 1656780578, "xp": 37864}, {"brawlhalla_id": 4070196, "name": "Goofy", "rank": "Officer", "join_date": 1656782361, "xp": 50905}, {"brawlhalla_id": 23890819, "name": "Benjihypp\u00c3\u00a4\u00c3\u00a4j\u00c3\u00a4", "rank": "Member", "join_date": 1656786527, "xp": 22760}, {"brawlhalla_id": 24664406, "name": "Titty sucker", "rank": "Member", "join_date": 1656792002, "xp": 21934}, {"brawlhalla_id": 27930713, "name": "Madison", "rank": "Member", "join_date": 1656840626, "xp": 24160}, {"brawlhalla_id": 35664307, "name": "cat gang | yum", "rank": "Member", "join_date": 1656842131, "xp": 44317}, {"brawlhalla_id": 59561496, "name": "Memory", "rank": "Member", "join_date": 1656848208, "xp": 36861}, {"brawlhalla_id": 29109995, "name": "SiLver", "rank": "Member", "join_date": 1656857493, "xp": 21808}, {"brawlhalla_id": 34242870, "name": "$now?!", "rank": "Member", "join_date": 1656864319, "xp": 76566}, {"brawlhalla_id": 43401640, "name": "FuuuX", "rank": "Member", "join_date": 1656873217, "xp": 28286}, {"brawlhalla_id": 8948682, "name": "Devolos", "rank": "Member", "join_date": 1656875188, "xp": 27795}, {"brawlhalla_id": 7974814, "name": "ZAW;", "rank": "Member", "join_date": 1656880761, "xp": 23872}, {"brawlhalla_id": 9569848, "name": "1dimensionalbucket", "rank": "Member", "join_date": 1656883554, "xp": 14863}, {"brawlhalla_id": 35710376, "name": "Camila.", "rank": "Member", "join_date": 1656945111, "xp": 4050}, {"brawlhalla_id": 3711805, "name": "flower", "rank": "Member", "join_date": 1656968084, "xp": 34099}, {"brawlhalla_id": 454666, "name": "Zabulon", "rank": "Member", "join_date": 1657047191, "xp": 20505}, {"brawlhalla_id": 57482158, "name": "walter white", "rank": "Member", "join_date": 1657053675, "xp": 30856}, {"brawlhalla_id": 7142017, "name": "Julian", "rank": "Member", "join_date": 1657123140, "xp": 25122}, {"brawlhalla_id": 40321889, "name": "peon", "rank": "Member", "join_date": 1657370066, "xp": 43199}, {"brawlhalla_id": 5671092, "name": "Skeldra", "rank": "Member", "join_date": 1657473993, "xp": 19066}, {"brawlhalla_id": 9626815, "name": "Rasdos", "rank": "Member", "join_date": 1657476377, "xp": 49157}, {"brawlhalla_id": 830910, "name": "Dagmar <3", "rank": "Officer", "join_date": 1657568746, "xp": 36595}, {"brawlhalla_id": 7220395, "name": "Kami", "rank": "Member", "join_date": 1657578939, "xp": 21275}, {"brawlhalla_id": 9070717, "name": "TragicX7", "rank": "Member", "join_date": 1657581252, "xp": 15352}, {"brawlhalla_id": 7846170, "name": "Joryes", "rank": "Member", "join_date": 1657615456, "xp": 18518}, {"brawlhalla_id": 7294526, "name": "MG", "rank": "Member", "join_date": 1658169785, "xp": 33082}, {"brawlhalla_id": 10352807, "name": "Doku", "rank": "Member", "join_date": 1658170826, "xp": 16494}, {"brawlhalla_id": 8275242, "name": "Jhonny", "rank": "Member", "join_date": 1658174887, "xp": 22969}, {"brawlhalla_id": 5503396, "name": "MRB", "rank": "Member", "join_date": 1658345270, "xp": 37016}, {"brawlhalla_id": 7159263, "name": "PCS | Shadra - Baguette senpai", "rank": "Member", "join_date": 1658395590, "xp": 31652}, {"brawlhalla_id": 3013356, "name": "cat gang | oszcar", "rank": "Member", "join_date": 1658856944, "xp": 61662}, {"brawlhalla_id": 2600667, "name": "SamiGigi", "rank": "Member", "join_date": 1658948471, "xp": 9645}, {"brawlhalla_id": 69630716, "name": "idiot sandwich", "rank": "Member", "join_date": 1659274583, "xp": 69247}, {"brawlhalla_id": 26084391, "name": ".diline", "rank": "Member", "join_date": 1660910171, "xp": 6931}, {"brawlhalla_id": 70022787, "name": "twitch.tv/ma2st4er5", "rank": "Officer", "join_date": 1660934058, "xp": 20219}, {"brawlhalla_id": 5111230, "name": "WelFe", "rank": "Member", "join_date": 1660938600, "xp": 10612}, {"brawlhalla_id": 7364605, "name": "CrossyChainsaw", "rank": "Member", "join_date": 1660940056, "xp": 6372}, {"brawlhalla_id": 26417667, "name": "Dobleh #Lidia", "rank": "Member", "join_date": 1660940976, "xp": 12335}, {"brawlhalla_id": 9048248, "name": "Lil Liser <3", "rank": "Member", "join_date": 1660989573, "xp": 6372}, {"brawlhalla_id": 83366016, "name": "twitch.tv/WhisperBH", "rank": "Member", "join_date": 1661004909, "xp": 12500}, {"brawlhalla_id": 1209176, "name": "Mama Lopunny", "rank": "Member", "join_date": 1661021682, "xp": 9622}, {"brawlhalla_id": 3764805, "name": "Lil'Fox <3", "rank": "Member", "join_date": 1661104096, "xp": 10037}, {"brawlhalla_id": 3794093, "name": "MrEmpanadilla19", "rank": "Member", "join_date": 1661640242, "xp": 17405}, {"brawlhalla_id": 3995547, "name": "iiTzHairu!?", "rank": "Member", "join_date": 1661858269, "xp": 3983}, {"brawlhalla_id": 3221385, "name": "the neutral duck (Eldad)", "rank": "Member", "join_date": 1661870719, "xp": 6174}, {"brawlhalla_id": 42572878, "name": "xFabio", "rank": "Member", "join_date": 1661871499, "xp": 8237}, {"brawlhalla_id": 79329873, "name": "ian", "rank": "Member", "join_date": 1662154023, "xp": 6280}, {"brawlhalla_id": 1892771, "name": "Vooltex", "rank": "Member", "join_date": 1662154025, "xp": 600}, {"brawlhalla_id": 35913608, "name": "rufus", "rank": "Member", "join_date": 1662208545, "xp": 1050}]}

{"clan_id": 1357965, "clan_name": "Dair", "clan_create_date": 1609151553, "clan_xp": "1750697", "clan": [{"brawlhalla_id": 6746620, "name": "sgrape", "rank": "Leader", "join_date": 1656780578, "xp": 42651}, {"brawlhalla_id": 4070196, "name": "Goofy", "rank": "Officer", "join_date": 1656782361, "xp": 54716}, {"brawlhalla_id": 23890819, "name": "Benjihypp\u00c3\u00a4\u00c3\u00a4j\u00c3\u00a4", "rank": "Member", "join_date": 1656786527, "xp": 22760}, {"brawlhalla_id": 24664406, "name": "Titty sucker", "rank": "Member", "join_date": 1656792002, "xp": 23526}, {"brawlhalla_id": 27930713, "name": "Madison", "rank": "Member", "join_date": 1656840626, "xp": 24160}, {"brawlhalla_id": 35664307, "name": "Brawler", "rank": "Member", "join_date": 1656842131, "xp": 48377}, {"brawlhalla_id": 59561496, "name": "Memory", "rank": "Member", "join_date": 1656848208, "xp": 39666}, {"brawlhalla_id": 29109995, "name": "SiLver", "rank": "Member", "join_date": 1656857493, "xp": 22621}, {"brawlhalla_id": 34242870, "name": "$now?!", "rank": "Member", "join_date": 1656864319, "xp": 83441}, {"brawlhalla_id": 43401640, "name": "FuuuX", "rank": "Member", "join_date": 1656873217, "xp": 30051}, {"brawlhalla_id": 8948682, "name": "Devolos", "rank": "Member", "join_date": 1656875188, "xp": 30153}, {"brawlhalla_id": 7974814, "name": "ZAW;", "rank": "Member", "join_date": 1656880761, "xp": 27866}, {"brawlhalla_id": 9569848, "name": "1dimensionalbucket", "rank": "Member", "join_date": 1656883554, "xp": 14863}, {"brawlhalla_id": 3711805, "name": "flower", "rank": "Member", "join_date": 1656968084, "xp": 36808}, {"brawlhalla_id": 454666, "name": "Zabulon", "rank": "Member", "join_date": 1657047191, "xp": 21739}, {"brawlhalla_id": 57482158, "name": "walter white", "rank": "Member", "join_date": 1657053675, "xp": 33692}, {"brawlhalla_id": 40321889, "name": "peon", "rank": "Member", "join_date": 1657370066, "xp": 47004}, {"brawlhalla_id": 5671092, "name": "Skeldra", "rank": "Member", "join_date": 1657473993, "xp": 19618}, {"brawlhalla_id": 9626815, "name": "Rasdos", "rank": "Member", "join_date": 1657476377, "xp": 55318}, {"brawlhalla_id": 830910, "name": "Dagmar <3", "rank": "Officer", "join_date": 1657568746, "xp": 44960}, {"brawlhalla_id": 7220395, "name": "Kami", "rank": "Member", "join_date": 1657578939, "xp": 24422}, {"brawlhalla_id": 9070717, "name": "TragicX7", "rank": "Member", "join_date": 1657581252, "xp": 15352}, {"brawlhalla_id": 7846170, "name": "Joryes", "rank": "Member", "join_date": 1657615456, "xp": 20156}, {"brawlhalla_id": 7294526, "name": "MG", "rank": "Member", "join_date": 1658169785, "xp": 37508}, {"brawlhalla_id": 10352807, "name": "Doku", "rank": "Member", "join_date": 1658170826, "xp": 20314}, {"brawlhalla_id": 8275242, "name": "Jhonny", "rank": "Member", "join_date": 1658174887, "xp": 23626}, {"brawlhalla_id": 5503396, "name": "MRB", "rank": "Member", "join_date": 1658345270, "xp": 39443}, {"brawlhalla_id": 7159263, "name": "PCS | Shadra - Baguette senpai", "rank": "Member", "join_date": 1658395590, "xp": 34079}, {"brawlhalla_id": 3013356, "name": "oszcar", "rank": "Member", "join_date": 1658856944, "xp": 64931}, {"brawlhalla_id": 2600667, "name": "SamiGigi", "rank": "Member", "join_date": 1658948471, "xp": 11584}, {"brawlhalla_id": 69630716, "name": "nuts", "rank": "Member", "join_date": 1659274583, "xp": 78738}, {"brawlhalla_id": 26084391, "name": ".diline", "rank": "Member", "join_date": 1660910171, "xp": 6931}, {"brawlhalla_id": 70022787, "name": "twitch.tv/ma2st4er5", "rank": "Officer", "join_date": 1660934058, "xp": 27293}, {"brawlhalla_id": 5111230, "name": "WelFe", "rank": "Member", "join_date": 1660938600, "xp": 16990}, {"brawlhalla_id": 7364605, "name": "CrossyChainsaw", "rank": "Member", "join_date": 1660940056, "xp": 6605}, {"brawlhalla_id": 26417667, "name": "Dobleh #Lidia", "rank": "Member", "join_date": 1660940976, "xp": 18052}, {"brawlhalla_id": 9048248, "name": "Lil Liser <3", "rank": "Member", "join_date": 1660989573, "xp": 9344}, {"brawlhalla_id": 83366016, "name": "twitch.tv/WhisperBH", "rank": "Member", "join_date": 1661004909, "xp": 16756}, {"brawlhalla_id": 3764805, "name": "Lil'Fox <3", "rank": "Member", "join_date": 1661104096, "xp": 11745}, {"brawlhalla_id": 3794093, "name": "MrEmpanadilla19", "rank": "Member", "join_date": 1661640242, "xp": 24574}, {"brawlhalla_id": 3995547, "name": "PCS | iiTzHairu!?", "rank": "Member", "join_date": 1661858269, "xp": 5052}, {"brawlhalla_id": 3221385, "name": "the neutral duck (Eldad)", "rank": "Member", "join_date": 1661870719, "xp": 11905}, {"brawlhalla_id": 42572878, "name": "xFabio", "rank": "Member", "join_date": 1661871499, "xp": 12535}, {"brawlhalla_id": 79329873, "name": "ian", "rank": "Member", "join_date": 1662154023, "xp": 11737}, {"brawlhalla_id": 1892771, "name": "Vooltex", "rank": "Member", "join_date": 1662154025, "xp": 600}, {"brawlhalla_id": 35913608, "name": "rufus", "rank": "Member", "join_date": 1662208545, "xp": 3511}, {"brawlhalla_id": 38970073, "name": "\u00e2\u0080\u00a0 lovely \u00e1\u0083\u00a6", "rank": "Member", "join_date": 1662691135, "xp": 4880}, {"brawlhalla_id": 3565388, "name": "Excellence", "rank": "Member", "join_date": 1662750501, "xp": 2465}, {"brawlhalla_id": 3615467, "name": ".", "rank": "Member", "join_date": 1662902127, "xp": 1123}, {"brawlhalla_id": 8830089, "name": "UnderF\u00c3\u00b8x", "rank": "Member", "join_date": 1662991488, "xp": 1459}]}

4 changes: 3 additions & 1 deletion data_clan_Iratus niggas.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"clan_id": 1998475, "clan_name": "Iratus", "clan_create_date": 1662159711, "clan_xp": "30004", "clan": [{"brawlhalla_id": 28054305, "name": "\u00e4\u00b8\u0082gishide", "rank": "Leader", "join_date": 1662159807, "xp": 2991}, {"brawlhalla_id": 61355963, "name": "\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096", "rank": "Officer", "join_date": 1662160170, "xp": 4176}, {"brawlhalla_id": 9316238, "name": "Serendipity", "rank": "Officer", "join_date": 1662160201, "xp": 3139}, {"brawlhalla_id": 33893717, "name": "Professional_gamer09(italian)", "rank": "Member", "join_date": 1662160289, "xp": 2992}, {"brawlhalla_id": 6261062, "name": "I am a dwarf", "rank": "Member", "join_date": 1662160748, "xp": 1082}, {"brawlhalla_id": 1509948, "name": "Just k0sy", "rank": "Member", "join_date": 1662164345, "xp": 1240}, {"brawlhalla_id": 6244176, "name": "sukaroo?!", "rank": "Member", "join_date": 1662226618, "xp": 8938}, {"brawlhalla_id": 49993518, "name": "rias", "rank": "Officer", "join_date": 1662405410, "xp": 2495}, {"brawlhalla_id": 5448743, "name": "iSwiits", "rank": "Member", "join_date": 1662471087, "xp": 1285}, {"brawlhalla_id": 59886322, "name": "TIKIS", "rank": "Member", "join_date": 1662558775, "xp": 983}, {"brawlhalla_id": 5920747, "name": "\u00ed\u0095\u0098\u00eb\u008a\u0098 | Sky", "rank": "Member", "join_date": 1662560362, "xp": 322}]}

{"clan_id": 1998475, "clan_name": "Iratus", "clan_create_date": 1662159711, "clan_xp": "44727", "clan": [{"brawlhalla_id": 28054305, "name": "\u00e4\u00b8\u0082gishide", "rank": "Leader", "join_date": 1662159807, "xp": 5024}, {"brawlhalla_id": 61355963, "name": "\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096\u00e3\u0084\u0096", "rank": "Officer", "join_date": 1662160170, "xp": 6111}, {"brawlhalla_id": 9316238, "name": "Serendipity", "rank": "Officer", "join_date": 1662160201, "xp": 4195}, {"brawlhalla_id": 33893717, "name": "Professional_gamer09(italian)", "rank": "Member", "join_date": 1662160289, "xp": 4563}, {"brawlhalla_id": 6261062, "name": "I am a dwarf", "rank": "Member", "join_date": 1662160748, "xp": 1585}, {"brawlhalla_id": 1509948, "name": "Just k0sy", "rank": "Member", "join_date": 1662164345, "xp": 2052}, {"brawlhalla_id": 6244176, "name": "Madara Uchiha", "rank": "Member", "join_date": 1662226618, "xp": 14082}, {"brawlhalla_id": 5448743, "name": "iSwiits", "rank": "Member", "join_date": 1662471087, "xp": 1285}, {"brawlhalla_id": 5920747, "name": "\u00ed\u0095\u0098\u00eb\u008a\u0098 | Sky", "rank": "Member", "join_date": 1662560362, "xp": 805}, {"brawlhalla_id": 83490089, "name": "KurdiAras", "rank": "Member", "join_date": 1662767963, "xp": 57}, {"brawlhalla_id": 83488873, "name": "LEGEND_Hamudi", "rank": "Member", "join_date": 1662767974, "xp": 57}]}

Loading

0 comments on commit ccef0c5

Please sign in to comment.