Skip to content

Commit

Permalink
add clashofstats user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicTheDev committed Nov 2, 2024
1 parent c0f750f commit 16f7d12
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion classes/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ async def store_all_cwls(self, clan: coc.Clan):

async def get_player_history(self, player_tag: str):
url = f"https://api.clashofstats.com/players/{player_tag.replace('#', '')}/history/clans"
async with aiohttp.ClientSession() as session:
async with aiohttp.ClientSession(headers={"User-Agent" : self._config.clashofstats_user_agent}) as session:
async with session.get(url) as resp:
history = await resp.json()
await session.close()
Expand Down
2 changes: 2 additions & 0 deletions classes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ def __init__(self, remote_settings: dict):
self.total_clusters = remote_settings.get('total_clusters')

self.emoji_url = remote_settings.get('emoji_url')

self.clashofstats_user_agent = remote_settings.get('clashofstats_user_agent')
3 changes: 2 additions & 1 deletion commands/ticketing/click.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ def check(res):
button = panel.get_button(custom_id=ctx.data.custom_id)
if button is None:
return await ctx.send('Button No Longer Exists', ephemeral=True)

await button.send_log(log_type=LOG_TYPE.BUTTON_CLICK, user=ctx.user)

players = []
Expand Down Expand Up @@ -321,12 +320,14 @@ def check(res):
else:
await res.response.send_message(content='Done!', components=[], ephemeral=True)

print(button.questions)
if button.questions:
if message:
await message.delete()
(message, questionaire_embed) = await ask_questions(bot=self.bot, ctx=ctx, questions=button.questions)
embeds.append(questionaire_embed)

print("here again")
channels = await open_ticket(
bot=self.bot,
ticket_panel=panel,
Expand Down
8 changes: 1 addition & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
aiocache==0.12.2
aiofiles==0.6.0
aiokafka==0.10.0
APScheduler==3.9.1
Babel==2.13.1
ballpark @ git+https://github.com/Mee6/python-ballpark.git@5ab86393ba8cb2f306187f393aca8ec5b3bbbbae
beautifulsoup4==4.10.0
bs4==0.0.1
chat-exporter @ git+https://github.com/MagicTheDev/DiscordChatExporterPy@42ff2ae12628e62ace81e7f69205729c115a5ba6
coc.py==3.7.1
disnake @ git+https://github.com/MagicTheDev/disnake.git
Expand All @@ -16,10 +11,10 @@ emoji==1.6.3
expiring-dict==1.1.0
fluent.runtime==0.4.0
ipython==8.13.0
kafka-python==2.0.2
kaleido==0.2.1
loguru==0.7.2
matplotlib==3.7.1
meilisearch-python-sdk==3.4.0
motor==3.5.1
msgspec==0.18.6
numerize==0.12
Expand All @@ -30,7 +25,6 @@ orjson==3.10.0
pandas==2.0.3
pendulum==3.0.0
plotly==5.14.1
public-ip==0.12
pymitter==0.4.0
pymongo==4.8.0
python-dateutil==2.8.2
Expand Down

0 comments on commit 16f7d12

Please sign in to comment.