mirror of
https://github.com/skylanix/MamieHenriette.git
synced 2026-02-14 12:10:38 +01:00
Ajout d'une clef d'authentification humble bundle
This commit is contained in:
@@ -10,10 +10,12 @@ from discord import Client
|
|||||||
|
|
||||||
|
|
||||||
def _isEnable():
|
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():
|
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:
|
if response.status_code == 200:
|
||||||
return response.json()
|
return response.json()
|
||||||
logging.error(f"Échec de la connexion à l'API Humble Bundle. Code de statut HTTP : {response.status_code}")
|
logging.error(f"Échec de la connexion à l'API Humble Bundle. Code de statut HTTP : {response.status_code}")
|
||||||
|
|||||||
@@ -46,6 +46,8 @@
|
|||||||
{{channel.name}}</option>
|
{{channel.name}}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</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">
|
<input type="Submit" value="Définir">
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user