diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f3fb4d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +config/* + diff --git a/__pycache__/get_user_list.cpython-314.pyc b/__pycache__/get_user_list.cpython-314.pyc index 5c336b3..64f77e5 100644 Binary files a/__pycache__/get_user_list.cpython-314.pyc and b/__pycache__/get_user_list.cpython-314.pyc differ diff --git a/__pycache__/post.cpython-314.pyc b/__pycache__/post.cpython-314.pyc index d04fd46..b10f05e 100644 Binary files a/__pycache__/post.cpython-314.pyc and b/__pycache__/post.cpython-314.pyc differ diff --git a/__pycache__/room.cpython-314.pyc b/__pycache__/room.cpython-314.pyc index b7ab58a..d7c763c 100644 Binary files a/__pycache__/room.cpython-314.pyc and b/__pycache__/room.cpython-314.pyc differ diff --git a/configs/config.yaml b/configs/config.yaml index f02769c..5af98cf 100755 --- a/configs/config.yaml +++ b/configs/config.yaml @@ -3,6 +3,7 @@ password: "zC1b9qCKT8Cv0D" room_id: "!ajyOBbqoCIbBhEqNPU:matrix.org" # Magbot Testing Space #room_id: "!HXiyYVEZOMRtkyvarN:jupiterbroadcasting.com" # Da Lunch #room_id: "!gJYEKNllaubNlNkFIj:jupiterbroadcasting.com" # The Main Chat +# Da Lunch and The Main Chat each have their own config (daLunch.yaml, mainChat.yaml). lookback_seconds: 86400 # 24 hours lookback_limit: 400 dump_mode: True diff --git a/configs/daLunch.yaml b/configs/daLunch.yaml new file mode 100644 index 0000000..a9aacca --- /dev/null +++ b/configs/daLunch.yaml @@ -0,0 +1,13 @@ +username: "magbot" +password: "zC1b9qCKT8Cv0D" +#room_id: "!ajyOBbqoCIbBhEqNPU:matrix.org" # Magbot Testing Space +room_id: "!HXiyYVEZOMRtkyvarN:jupiterbroadcasting.com" # Da Lunch +#room_id: "!gJYEKNllaubNlNkFIj:jupiterbroadcasting.com" # The Main Chat +lookback_seconds: 86400 # 24 hours +lookback_limit: 400 +dump_mode: True +dbName: "" +# vote_host: "agmninex.online" # Hostname where voting interface is accessible (e.g., "localhost", "example.com", "vote.mysite.xyz") +vote_host: "agmninex.online" +vote_path: "lunch" # URL slug for this room's voting page (http://:9081/) +vote_activity_hours: 6672 # Hours a user must have been active within to be eligible to vote diff --git a/configs/mainChat.yaml b/configs/mainChat.yaml index ce415e5..7e536e5 100755 --- a/configs/mainChat.yaml +++ b/configs/mainChat.yaml @@ -1,8 +1,8 @@ username: "magbot" password: "zC1b9qCKT8Cv0D" -room_id: "!ajyOBbqoCIbBhEqNPU:matrix.org" # Magbot Testing Space +#room_id: "!ajyOBbqoCIbBhEqNPU:matrix.org" # Magbot Testing Space #room_id: "!HXiyYVEZOMRtkyvarN:jupiterbroadcasting.com" # Da Lunch -#room_id: "!gJYEKNllaubNlNkFIj:jupiterbroadcasting.com" # The Main Chat +room_id: "!gJYEKNllaubNlNkFIj:jupiterbroadcasting.com" # The Main Chat lookback_seconds: 86400 # 24 hours lookback_limit: 400 dump_mode: True diff --git a/get_user_list.py b/get_user_list.py index a712683..2a48bac 100755 --- a/get_user_list.py +++ b/get_user_list.py @@ -9,7 +9,7 @@ import asyncio import sqlite3 import time import sys -from nio import AsyncClient, LoginResponse +from nio import AsyncClient, LoginResponse, RoomMessagesResponse, SyncResponse from room import Room @@ -78,7 +78,9 @@ class UserListManager: return [] # Sync to get room state - await self.room.client.sync(timeout=3000) + sync_resp = await self.room.client.sync(timeout=3000) + if not isinstance(sync_resp, SyncResponse): + print(f"Sync failed: {sync_resp}") # Get the room object room_obj = self.room.client.rooms.get(self.room.config.room_id) @@ -124,7 +126,7 @@ class UserListManager: limit=batch_size ) - if not response.chunk: + if not isinstance(response, RoomMessagesResponse) or not response.chunk: break fetched += len(response.chunk) diff --git a/suggestions__HXiyYVEZOMRtkyvarN_jupiterbroadcasting_com.db b/suggestions__HXiyYVEZOMRtkyvarN_jupiterbroadcasting_com.db new file mode 100644 index 0000000..e69de29 diff --git a/users__HXiyYVEZOMRtkyvarN_jupiterbroadcasting_com.db b/users__HXiyYVEZOMRtkyvarN_jupiterbroadcasting_com.db new file mode 100644 index 0000000..e69de29 diff --git a/votes__HXiyYVEZOMRtkyvarN_jupiterbroadcasting_com.db b/votes__HXiyYVEZOMRtkyvarN_jupiterbroadcasting_com.db new file mode 100644 index 0000000..2f49216 Binary files /dev/null and b/votes__HXiyYVEZOMRtkyvarN_jupiterbroadcasting_com.db differ