lunarflu HF staff commited on
Commit
ca4b90b
1 Parent(s): 7a9c3df

tracking message stats

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -52,9 +52,22 @@ ping alerts for list of keywords
52
  - more alerts for more stuff?
53
 
54
  '''
 
 
55
 
 
 
 
 
 
 
 
 
 
 
56
 
57
-
 
58
 
59
  # moderation stuff----------------------------------------------------------------------------------------------------------------------------------------------------------
60
 
 
52
  - more alerts for more stuff?
53
 
54
  '''
55
+ # stats stuff---------------------------------------------------------------------------------------------------------------------------------------------------------------
56
+ number_of_messages = 0
57
 
58
+ @bot.event
59
+ async def on_message(message):
60
+ try:
61
+ if message.author != bot.user:
62
+ user = bot.get_user(811235357663297546) #811235357663297546
63
+ number_of_messages = number_of_messages + 1
64
+ await user.send(f"->{number_of_messages}<-|New message from {message.author} in #{message.channel.name}: {message.content}")
65
+
66
+ # Allow other event handlers to process the message
67
+ await bot.process_commands(message)
68
 
69
+ except Exception as e:
70
+ print(f"Error: {e}")
71
 
72
  # moderation stuff----------------------------------------------------------------------------------------------------------------------------------------------------------
73