Log en français et corrections, description page protondb

This commit is contained in:
skylanix
2025-08-22 15:40:41 +02:00
parent 0a40766662
commit a4ce31a39b
6 changed files with 16 additions and 15 deletions

View File

@@ -12,7 +12,7 @@ from protondb import searhProtonDb
class DiscordBot(discord.Client): class DiscordBot(discord.Client):
async def on_ready(self): async def on_ready(self):
logging.info(f'Logged in as {self.user} (ID: {self.user.id})') logging.info(f'Connecté en tant que {self.user} (ID: {self.user.id})')
for c in self.get_all_channels() : for c in self.get_all_channels() :
logging.info(f'{c.id} {c.name}') logging.info(f'{c.id} {c.name}')
@@ -25,7 +25,7 @@ class DiscordBot(discord.Client):
if len(humeurs)>0 : if len(humeurs)>0 :
humeur = random.choice(humeurs) humeur = random.choice(humeurs)
if humeur != None: if humeur != None:
logging.info(f'changement de status {humeur.text}') logging.info(f'Changement de statut : {humeur.text}')
await self.change_presence(status = discord.Status.online, activity = discord.CustomActivity(humeur.text)) await self.change_presence(status = discord.Status.online, activity = discord.CustomActivity(humeur.text))
# 10 minutes TODO à rendre configurable # 10 minutes TODO à rendre configurable
await asyncio.sleep(10*60) await asyncio.sleep(10*60)
@@ -33,7 +33,7 @@ class DiscordBot(discord.Client):
async def updateHumbleBundle(self): async def updateHumbleBundle(self):
while not self.is_closed(): while not self.is_closed():
await checkHumbleBundleAndNotify(self) await checkHumbleBundleAndNotify(self)
# toute les 30 minutes # toutes les 30 minutes
await asyncio.sleep(30*60) await asyncio.sleep(30*60)
def begin(self) : def begin(self) :
@@ -41,7 +41,7 @@ class DiscordBot(discord.Client):
if token : if token :
self.run(token.value) self.run(token.value)
else : else :
logging.error('pas de token on ne lance pas discord') logging.error('Pas de token, on ne lance pas Discord')
intents = discord.Intents.default() intents = discord.Intents.default()
intents.message_content = True intents.message_content = True

View File

@@ -54,10 +54,10 @@ def searhProtonDb(search_name:str):
'name' : name, 'name' : name,
'tier' : tier 'tier' : tier
}) })
logging.info(f'found {name}({id} : {tier}') logging.info(f'Trouvé {name}({id}) : {tier}')
except Exception as e: except Exception as e:
logging.error(f'error on {name}({id}): {e}') logging.error(f'error on {name}({id}): {e}')
else: else:
logging.info(f'{name}({id} ne contient pas {search_name})') logging.info(f'{name}({id}) ne contient pas {search_name}')
return results return results

View File

@@ -8,17 +8,17 @@ from twitchbot import twitchBot
def start_server(): def start_server():
logging.info("Start Web Serveur") logging.info("Démarrage du serveur web")
from waitress import serve from waitress import serve
serve(webapp, host="0.0.0.0", port=5000) serve(webapp, host="0.0.0.0", port=5000)
def start_discord_bot(): def start_discord_bot():
logging.info("Start Discord Bot") logging.info("Démarrage du bot Discord")
with webapp.app_context(): with webapp.app_context():
bot.begin() bot.begin()
def start_twitch_bot(): def start_twitch_bot():
logging.info("Start Twitch Bot") logging.info("Démarrage du bot Twitch")
with webapp.app_context(): with webapp.app_context():
twitchBot.begin() twitchBot.begin()

View File

@@ -13,14 +13,14 @@ from webapp import webapp
USER_SCOPE = [AuthScope.CHAT_READ, AuthScope.CHAT_EDIT] USER_SCOPE = [AuthScope.CHAT_READ, AuthScope.CHAT_EDIT]
async def _onReady(ready_event: EventData): async def _onReady(ready_event: EventData):
logging.info('Twitch bot ready') logging.info('Bot Twitch prêt')
with webapp.app_context(): with webapp.app_context():
await ready_event.chat.join_room(ConfigurationHelper().getValue('twitch_channel')) await ready_event.chat.join_room(ConfigurationHelper().getValue('twitch_channel'))
async def _onMessage(msg: ChatMessage): async def _onMessage(msg: ChatMessage):
logging.info(f'in {msg.room.name}, {msg.user.name} said: {msg.text}') logging.info(f'Dans {msg.room.name}, {msg.user.name} a dit : {msg.text}')
# commande qui repond "bonjour" a "!hello" # commande qui répond "bonjour" à "!hello"
async def _helloCommand(msg: ChatMessage): async def _helloCommand(msg: ChatMessage):
await msg.reply(f'Bonjour {msg.user.name}') await msg.reply(f'Bonjour {msg.user.name}')
@@ -43,12 +43,12 @@ class TwitchBot() :
self.chat.register_command('hello', _helloCommand) self.chat.register_command('hello', _helloCommand)
self.chat.start() self.chat.start()
else: else:
logging.info("Twitch is not configured") logging.info("Twitch n'est pas configuré")
def begin(self): def begin(self):
asyncio.run(self._connect()) asyncio.run(self._connect())
# je sais pas encore comment appeller ca # je ne sais pas encore comment appeler ça
async def _close(self): async def _close(self):
self.chat.stop() self.chat.stop()
await self.twitch.close() await self.twitch.close()

View File

@@ -17,7 +17,7 @@ def openConfigurations():
def updateConfiguration(): def updateConfiguration():
for key in request.form : for key in request.form :
ConfigurationHelper().createOrUpdate(key, request.form.get(key)) ConfigurationHelper().createOrUpdate(key, request.form.get(key))
# Je fait ca car html n'envoi pas le parametre de checkbox quand il est décoché # Je fais ça car HTML n'envoie pas le paramètre de checkbox quand il est décoché
if (request.form.get("humble_bundle_channel") != None and request.form.get("humble_bundle_enable") == None) : if (request.form.get("humble_bundle_channel") != None and request.form.get("humble_bundle_enable") == None) :
ConfigurationHelper().createOrUpdate('humble_bundle_enable', False) ConfigurationHelper().createOrUpdate('humble_bundle_enable', False)
if (request.form.get("proton_db_api_id") != None and request.form.get("proton_db_enable_enable") == None) : if (request.form.get("proton_db_api_id") != None and request.form.get("proton_db_enable_enable") == None) :

View File

@@ -2,6 +2,7 @@
{% block content %} {% block content %}
<h1>Proton DB</h1> <h1>Proton DB</h1>
<p>ProtonDB évalue la compatibilité des jeux Windows sur Linux via Steam Play. Les alias permettent de simplifier les recherches (ex: "GTA" → "Grand Theft Auto").</p>
<h2>Game alias</h2> <h2>Game alias</h2>
<table> <table>