From e93169c11c848f78d0411031ae2589e9d5b1fde0 Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Sat, 11 Jul 2026 21:10:53 +1200 Subject: Start working on voting --- src/botnet.py | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 5 deletions(-) (limited to 'src/botnet.py') diff --git a/src/botnet.py b/src/botnet.py index fbf8efe..086d01f 100644 --- a/src/botnet.py +++ b/src/botnet.py @@ -13,9 +13,11 @@ selfbot_token = os.environ.get("SLACK_SELFBOT_OAUTH_XOXP") gemini_key = os.environ.get("GEMINI_API_KEY") system_prompt = """ -You are a strict content moderator for a professional Slack workspace called Hack Club. +You are a strict content moderator for a botnet-like social experiment in a professional Slack workspace called Hack Club. -Your job is to analyze messages and determine if they are SAFE or UNSAFE to be posted by a bot on behalf of multiple users. +Your job is to analyze messages and determine if they are SAFE or UNSAFE to be posted by a bot on behalf of multiple users in the Slack. +Messages will be posted on behalf of MANY USERS simultaneously. +The message must make sense coming from ANYONE, not just the submitter. A message is UNSAFE if it contains ANY of the following: - Swear words, profanity, or offensive language @@ -25,6 +27,13 @@ A message is UNSAFE if it contains ANY of the following: - Spam, excessive gibberish, or repetitive messages - Phishing, scams, or malicious links - Mentions of illegal activities (hacking, drugs, violence, etc.) +- Self-promotion, advertising, or promotional content +- Links to personal websites, products, or services +- Strong opinions or polarizing statements (politics, religion, software, licensing, etc.) +- Tech flame wars (X is better than Y, Z sucks, etc.) +- Negative statements about people, projects, or technologies +- Complaints or rants about specific tools, languages, or frameworks +- Anything that could be interpreted as speaking for others in a controversial way - Anything that would make Slack admins (FD/Fire Dept.) upset or require them to intervene A message is SAFE if it is: @@ -81,13 +90,63 @@ async def deploy_message(user_id: str, message: str): deployment_id = await create_deployment(user_id, message) - print(f"DEBUG: Executing the deployment {deployment_id} on arrival - REMOVE THIS LATER!") - await execute_deployment(deployment_id) + blocks = [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": f"Voting | Deployment #{deployment_id}" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": f"*Message:*\n> {message}" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": f"*Votes:*\n> Approve: 0\n> Reject: 0" + } + }, + { + "type": "actions", + "elements": [ + { + "type": "button", + "text": {"type": "plain_text", "text": "Approve ^_^"}, + "style": "primary", + "action_id": f"vote_approve_{deployment_id}" + }, + { + "type": "button", + "text": {"type": "plain_text", "text": "Reject T_T"}, + "style": "danger", + "action_id": f"vote_reject_{deployment_id}" + } + ] + } + ] + + client = AsyncWebClient(token=selfbot_token) + response = await client.chat_postMessage( + channel="C0BFEDTUFCP", + blocks=blocks, + text=f"Vote on Deployment #deployment_id" + ) + + message_ts = response["ts"] + + # print(f"DEBUG: Executing the deployment {deployment_id} on arrival - REMOVE THIS LATER!") + # await execute_deployment(deployment_id) return { "success": True, "deployment_id": deployment_id, - "message": "Your message has been deployed!" + "message": "Your message has been submitted for voting!" } async def execute_deployment(deployment_id: int): -- cgit v1.2.3