also added user_id of bot to config

This commit is contained in:
alpcentaur 2023-11-29 19:54:43 +01:00
parent d0959b6fca
commit d56c29d095
3 changed files with 14 additions and 3 deletions

View file

@ -35,3 +35,8 @@ From there, copy the room_id to
config.ini
```
For the bot_user_id run the commands
```
myinfo = api.get_my_info()
print(myinfo)
```

View file

@ -3,3 +3,4 @@ username = <bot-username>
password = <bot-password>
url = https://rocket.example.de
room_id = <room-id-of-private-room>
bot_user_id = <id-of-bot>

View file

@ -11,6 +11,7 @@ botname = config['Chat']['username']
botpassword = config['Chat']['password']
server_url = config['Chat']['URL']
room_id = config['Chat']['room_id']
bot_user_id = config['Chat']['bot_user_id']
# here comes the functions to talk to gpt
@ -31,8 +32,11 @@ if __name__ == '__main__':
api = RocketChatAPI(settings={'username': botname, 'password': botpassword, 'domain': server_url})
#api.send_message('Ciao, I am the fdb-spider', room_id)
# api.send_message('Ciao, I am the fdb-spider', room_id)
# myinfo = api.get_my_info()
print(myinfo)
# rooms = api.get_private_rooms()
# print(rooms)
@ -40,7 +44,7 @@ if __name__ == '__main__':
# api.send_message('Ole', room_id)
n = 0
'''
import time
import datetime
from datetime import timedelta
@ -84,7 +88,7 @@ if __name__ == '__main__':
new_message_list = new_message.split('§%§%')
if new_message_list[0] != latest_message and new_message_list[1] != latest_message_id and latest_message_user_id != 'bb8EfPXrviu9yB9Ja':
if new_message_list[0] != latest_message and new_message_list[1] != latest_message_id and latest_message_user_id != bot_user_id:
new_message_file = open('new_message_file.txt', 'w')
new_message_file.write(latest_message + '§%§%' + latest_message_id)
@ -102,3 +106,4 @@ if __name__ == '__main__':
api.send_message('Ich bin wieder bereit für Konfigurationsinput : )', room_id)
time.sleep(3)
'''