Direct answer
Yes, provided you choose a method where the machine connects outward, such as long polling or a persistent connection. Methods that require the chat platform to call back to your machine's address do not suit this machine's network.
Basis
- Chat bots receive messages in roughly two ways. In one, your program goes to the platform to fetch them, or keeps open a long-lived connection that you initiated. In the other, you provide a public URL and the platform calls it when there is a message.
- The first only needs the machine to have internet access, which a rented Mac mini has. Telegram long polling, the Discord gateway connection and Slack Socket Mode all fall into this group. For how to use each, follow the platform's official documentation.
- The second needs a fixed entry point reachable from outside. The broadband here is a residential line, the public exit may be shared with other machines and is not a fixed address, and the terms of use do not allow you to change the network configuration yourself. So do not design around this method.
- The machine stays on and does not stop when your own computer shuts down. That is the point of putting the bot here: you send a line from your phone, and it carries out the work at the far end and replies.
Boundaries: when the answer is different
A bot that takes instructions only from you or your small team is normal use. Two cases are not allowed. One is using it to send bulk messages to strangers; harassing mass messaging is a prohibited use. The other is wrapping your AI subscription account into a bot that anyone can ask questions; that turns the subscription into a shared or relay service for outsiders, which the terms of use explicitly prohibit. Also, a bot token is as good as a password: do not paste it into tickets, group chats or screenshots. The availability and rules of the chat platform itself are beyond our control.
How to do it
- Create the bot on the chat platform, get the token and store it in an environment variable or the keychain on the machine. Do not hard-code it.
- Choose long polling or a persistent connection, and confirm that no callback URL is enabled at the same time.
- Add an allowlist to the program so it only responds to messages from your own account.
- Add reconnection after a dropped connection, and hand the program to launchd to keep it running.
- Send a test instruction from your phone, then disconnect remote desktop and send it again. Confirm you get a reply both times.
Related questions
- Mac mini for 24/7 AI agents? Only worth it when the agent needs a desktop or macOS apps
- Can I run a long-running Python or Node service on a rented Mac mini?
- How do I know my unattended agent is still running properly?
- Can I connect to a remote Mac mini from my phone to check on my agent?
- What happens to a running AI agent task if the residential broadband drops for a moment?
Use case
This question belongs to the use case: Mac mini for 24/7 AI agents? Only worth it when the agent needs a desktop or macOS apps
Other questions in the same use case:
- Can an AI agent use Calendar, Notes and Reminders on a remote Mac?
- Does it matter whether remote desktop is connected while an AI agent controls the screen?
- Does screen resolution affect an AI agent on a headless remote Mac mini?
- Mac mini slows down with several tasks running: how do I find the bottleneck?
Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support