Ajout d'une clef d'authentification humble bundle

This commit is contained in:
Kepka Ludovic
2025-08-27 09:54:24 +02:00
committed by skylanix
parent f2cc4d5a43
commit 641ff40716
2 changed files with 6 additions and 2 deletions

View File

@@ -10,10 +10,12 @@ from discord import Client
def _isEnable():
return ConfigurationHelper().getValue('humble_bundle_enable') and ConfigurationHelper().getIntValue('humble_bundle_channel') != 0
helper = ConfigurationHelper()
return helper.getValue('humble_bundle_enable') and helper.getIntValue('humble_bundle_channel') != 0 and helper.getValue('humble_bundle_api_key')
def _callHexas():
response = requests.get("http://hexas.shionn.org/humble-bundle/json", headers={ "Content-Type": "application/json" })
headers = { "Content-Type": "application/json", "api-key":ConfigurationHelper().getValue('humble_bundle_api_key') }
response = requests.get("http://hexas.shionn.org/humble-bundle/json", headers=headers)
if response.status_code == 200:
return response.json()
logging.error(f"Échec de la connexion à l'API Humble Bundle. Code de statut HTTP : {response.status_code}")

View File

@@ -46,6 +46,8 @@
{{channel.name}}</option>
{% endfor %}
</select>
<label for="humble_bundle_api_key">Client id</label>
<input name="humble_bundle_api_key" type="text" value="{{ configuration.getValue('humble_bundle_api_key') }}" />
<input type="Submit" value="Définir">
</form>
{% endblock %}