Radosław Wolnik commited on
Commit
5c84d6e
·
1 Parent(s): bbe2ee9

Responding

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -28,7 +28,7 @@ async def on_message(message):
28
  message_counts[message.channel.id] += 1
29
  print(message_counts[message.channel.id])
30
 
31
- respond_to_chat(message)
32
 
33
  messages = []
34
  if message_counts[message.channel.id] >= 10: # Check if the count reaches 10
@@ -42,10 +42,11 @@ async def on_message(message):
42
 
43
  await bot.process_commands(message) # Ensure commands still work
44
 
45
- def respond_to_chat(message) ->str:
46
  response = generate(message)
47
  parts = split_string(response)
48
- channel = discord.utils.get(message.guild.text_channels, name=DEFAULT_CHATTER_CHANNEL)
 
49
  for part in parts:
50
  channel.send(part)
51
  return str("\n".join(parts))
 
28
  message_counts[message.channel.id] += 1
29
  print(message_counts[message.channel.id])
30
 
31
+ respond_to_chat(message.content)
32
 
33
  messages = []
34
  if message_counts[message.channel.id] >= 10: # Check if the count reaches 10
 
42
 
43
  await bot.process_commands(message) # Ensure commands still work
44
 
45
+ def respond_to_chat(message: str) ->str:
46
  response = generate(message)
47
  parts = split_string(response)
48
+ guild = discord.utils.get(bot.guilds, name="PrzebieralniaKoedukacyjna")
49
+ channel = discord.utils.get(guild.channels, name=DEFAULT_CHATTER_CHANNEL)
50
  for part in parts:
51
  channel.send(part)
52
  return str("\n".join(parts))