seawolf2357 commited on
Commit
19a1114
·
verified ·
1 Parent(s): 10d019f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -39,23 +39,23 @@ class MyClient(discord.Client):
39
  logging.info("Web.py server has been started.")
40
 
41
  async def on_message(self, message):
42
- logging.debug(f"Received message from {message.author}: {message.content}")
43
  if message.author == self.user:
44
- logging.debug("Ignoring message from the bot itself.")
45
  return
46
  if not self.is_message_in_specific_channel(message):
47
- logging.debug(f"Message not in specific channel: {message.channel}")
48
  return
49
  if self.is_processing:
50
- logging.debug("Currently processing another message.")
51
  return
52
- logging.debug("Processing new message.")
53
  self.is_processing = True
54
  try:
55
  response = await generate_response(message)
56
  await message.channel.send(response)
57
  except Exception as e:
58
- logging.error(f"Error processing message: {e}", exc_info=True)
59
  finally:
60
  self.is_processing = False
61
 
 
39
  logging.info("Web.py server has been started.")
40
 
41
  async def on_message(self, message):
42
+ logging.debug(f"Message received: {message.content} from {message.author}")
43
  if message.author == self.user:
44
+ logging.debug("Message from bot itself; ignoring.")
45
  return
46
  if not self.is_message_in_specific_channel(message):
47
+ logging.debug(f"Message not in the specific channel or its thread: {message.channel}")
48
  return
49
  if self.is_processing:
50
+ logging.debug("Already processing another message.")
51
  return
52
+ logging.debug("Processing message...")
53
  self.is_processing = True
54
  try:
55
  response = await generate_response(message)
56
  await message.channel.send(response)
57
  except Exception as e:
58
+ logging.error(f"Error during message processing: {e}", exc_info=True)
59
  finally:
60
  self.is_processing = False
61