feat: implement dynamic bot list with runtime add/remove support
Adds a new BotManager class that maintains a mutable list of active bots, allowing bots to be added or removed at runtime without restarting the application. Includes thread-safe operations for concurrent access and a new API endpoint to query the current bot roster.
This commit is contained in:
@@ -13,5 +13,6 @@ src/ragnar/api.py
|
||||
src/ragnar/bot.py
|
||||
src/ragnar/cache.py
|
||||
src/ragnar/cli.py
|
||||
src/ragnar/victoria.py
|
||||
src/ragnar/tests/__init__.py
|
||||
src/ragnar/tests/bot.py
|
||||
+2
-25
@@ -5,7 +5,7 @@ from concurrent.futures import ThreadPoolExecutor as Executor
|
||||
|
||||
from ragnar import log
|
||||
from ragnar.bot import Bot
|
||||
|
||||
from ragnar.victoria import vic
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description="Process username and password.")
|
||||
@@ -30,30 +30,7 @@ def bot_task(username, password):
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
usernames = [
|
||||
# "no-spam1",
|
||||
# "no-spam2",
|
||||
# "no-spam3",
|
||||
# "no-spam4",
|
||||
# "no-spam",
|
||||
"no-spam2353",
|
||||
"no-spam2351",
|
||||
"no-spam2350",
|
||||
"no-spam2349",
|
||||
"JamesMedina",
|
||||
"MichelleWeeks",
|
||||
"JaredRuiz",
|
||||
"LoriMcgee",
|
||||
"AmandaFloyd",
|
||||
"tcpudp",
|
||||
"JoseRodriguez",
|
||||
"CaseyHernandez",
|
||||
"ToddHarris",
|
||||
"AnneRose",
|
||||
"GregoryBowman",
|
||||
"LeahVasquez",
|
||||
"JamesMedina",
|
||||
]
|
||||
usernames = vic.get_friends()
|
||||
|
||||
with Executor(len(usernames)) as executor:
|
||||
for username in usernames:
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
from xmlrpc.client import ServerProxy
|
||||
|
||||
vic = ServerProxy("https://victoria.molodetz.nl/rpc")
|
||||
Reference in New Issue
Block a user