Skip to content

Commit

Permalink
Fix query server issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BattlefieldDuck committed Nov 8, 2022
1 parent 9eed685 commit e47cdc9
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 106 deletions.
2 changes: 1 addition & 1 deletion discordgsm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ async def modal_on_submit(interaction: Interaction):

# Query the server
try:
result = await gamedig.run({'type': game['id'], **query_extra})
result = await gamedig.run({**{'type': game['id']}, **params})
except Exception:
content = t('function.query_server_modal.fail_to_query', interaction.locale).format(game_id=game['id'], address=address, query_port=query_port)
await interaction.followup.send(content, ephemeral=True)
Expand Down
10 changes: 0 additions & 10 deletions discordgsm/protocols/ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,3 @@ async def query(self):
}

return result


if __name__ == '__main__':
import asyncio

async def main():
ase = ASE('79.137.97.3', 22126)
print(await ase.query())

asyncio.run(main())
8 changes: 0 additions & 8 deletions discordgsm/protocols/assettocorsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,3 @@ async def query_json(self):
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
return await response.json(content_type=None)


if __name__ == '__main__':
async def main():
assettocorsa = AssettoCorsa('89.22.232.211', 8003)
print(await assettocorsa.query())

asyncio.run(main())
8 changes: 0 additions & 8 deletions discordgsm/protocols/battlefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,3 @@ async def query(self):
}

return result


if __name__ == '__main__':
async def main():
battlefield = Battlefield('74.91.124.140', 47200)
print(await battlefield.query())

asyncio.run(main())
10 changes: 0 additions & 10 deletions discordgsm/protocols/doom3.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,3 @@ async def query(self):
}

return result


if __name__ == '__main__':
import asyncio

async def main():
doom3 = Doom3('88.99.0.7', 28007)
print(await doom3.query())

asyncio.run(main())
8 changes: 0 additions & 8 deletions discordgsm/protocols/fivem.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,3 @@ async def query_players(self):
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
return await response.json(content_type=None)


if __name__ == '__main__':
async def main():
fivem = FiveM('85.215.99.119', 30112)
print(await fivem.query())

asyncio.run(main())
10 changes: 0 additions & 10 deletions discordgsm/protocols/gamespy3.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,3 @@ async def query(self):
}

return result


if __name__ == '__main__':
import asyncio

async def main_async():
gs3 = GameSpy3('2b2tjb.jp', 19132)
print(await gs3.query())

asyncio.run(main_async())
8 changes: 0 additions & 8 deletions discordgsm/protocols/minecraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,3 @@ async def query(self):
result['raw']['numplayers'] = int(status.get('players', {}).get('online', '0'))

return result


if __name__ == '__main__':
async def main():
minecraft = Minecraft('minecraft.hypixel.net', 25565)
print(await minecraft.query())

asyncio.run(main())
10 changes: 0 additions & 10 deletions discordgsm/protocols/raknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,3 @@ async def query(self):
result['raw']['numplayers'] = int(status.get('num_players', ''))

return result


if __name__ == '__main__':
import asyncio

async def main():
raknet = Raknet('mobzgaming.hopto.org', 19132)
print(await raknet.query())

asyncio.run(main())
8 changes: 0 additions & 8 deletions discordgsm/protocols/samp.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,3 @@ async def get_players():
}

return result


if __name__ == '__main__':
async def main():
samp = Samp('51.254.178.238', 7777)
print(await samp.query())

asyncio.run(main())
8 changes: 0 additions & 8 deletions discordgsm/protocols/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,3 @@ async def get_players():
result['maxplayers'] = int(next((tag[2:] for tag in result['raw']['tags'] if tag[:2] == 'mp'), result['maxplayers']))

return result


if __name__ == '__main__':
async def main():
source = Source('87.98.130.157', 27015)
print(await source.query())

asyncio.run(main())
8 changes: 0 additions & 8 deletions discordgsm/protocols/teamspeak3.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,3 @@ async def query(self):
}

return result


if __name__ == '__main__':
async def main():
teamspeak3 = Teamspeak3('199.231.233.138', 10011, 9987)
print(await teamspeak3.query())

asyncio.run(main())
8 changes: 0 additions & 8 deletions discordgsm/protocols/vcmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,3 @@ async def get_players():
}

return result


if __name__ == '__main__':
async def main():
vcmp = Vcmp('91.121.134.5', 8192)
print(await vcmp.query())

asyncio.run(main())
2 changes: 1 addition & 1 deletion discordgsm/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.8.0'
__version__ = '2.8.1'

0 comments on commit e47cdc9

Please sign in to comment.