| 🆕 - Updates - 🆕 | 🤖 - Mastodon Mention Commands - 🤖 | ✳️ - Dependencies - ✳️ | 💾 - Installation - 💾 | ⚖️ - License - ⚖️ |
assumes you already have a Mastodon bot account and have your secret token, as well as an OpenAI API key
git clone https://github.com/skullzarmy/chatGPToot.git
npm install
to initiate node and install dependenciesnpm run setup
will create needed folderscp .env.example .env
will copy .env.example to .env filenano .env
or use text editor to edit .env file and add your credentialsnano config.json
or use text editor to edit config.json file
npm run ingest-feeds
after adding a new RSS feed, or else it will toot about each new one it finds. There is no mechanism to modulate number or tempo, it will just spit them out! Ingesting the feed will add all existing items to local file memory, and check against that file for new items in the loop.MASTODON_ACCESS_TOKEN=GET-FROM-MASTODON
MASTODON_API_URL=YOUR-MASTODON-INSTANCE
OPENAI_KEY=sk-...
MASTODON_ACCOUNT_ID=GET-FROM-MASTODON
MASTODON_ADMIN_ACCOUNT=TO-ENABLE-ADMIN-COMMANDS
MASTODON_ADMIN_ALERT_USERNAME=TO-ALERT-FOR-FEEDBACK
NEWSDATA_API_KEY=SET-UP-A-FREE-KEY-TO-GET-NEWS-DATA
#STATUS_API_TOKEN=GENERATE-NEW-PRIVATE-KEY-TO-AUTH-STATUS-REQUESTS
{
"rss_urls": ["http://YOUR-RSS-FEED-URL/rss"],
...
}
(top)
--no-loop
- Disables the automatic toot, image, and mention loops. This is useful if you want to run the script manually to test it.
--no-image
- Disables the automatic image loop.
--no-toot
- Disables the automatic toot loop.
--no-mention
- Disables the automatic mention loop.
--no-rss
- Disables the RSS checker loop.
--toot-now
- Generates a toot and posts it immediately.
--image-now
- Generates an image prompt and posts it immediately.
(top)
npm run bot
will run the bot in nohup
a loop, tooting, mentioning, and posting images.
npm run bot-tail
will run the bot as above and stream the logs to your terminal (by tailing the log file)
npm run bot-mention
will run the bot in a loop, mentioning but not tooting or posting images.
npm run bot-image
will run the bot in a loop, posting images but not tooting or mentioning.
npm run bot-toot
will run the bot in a loop, tooting but not mentioning or posting images.
npm run single-toot
will run the bot once, tooting but not mentioning or posting images.
npm run single-image
will run the bot once, posting images but not tooting or mentioning.
npm run single-mention
will run the bot once, mentioning but not tooting or posting images.
npm run tail-logs
will stream the new bot logs to your terminal.
npm run usage
will generate a usage report located in reports/
npm run status-server
will start an express server on port 3000 & ngrok tunnel. Config in app/status_http_server.js
ngrok config auth-token ...
from ngrok.npm run ingest-feeds
will loop through your RSS feeds and ingest the existing items into a local file so they are not considered 'new'.
(top)
The bot supports the following commands when responding to a mention:
NOTE: Bot will now respect and maintain your visibility settings. If you DM, it will DM back.
command must be at the beginning of the mention (after the @mention)
(top)
@chatGPToot //image// a cat eating a taco
(top)
By default, the bot will log all usage to logs/usage_logs.json
npm run usage
will print and save a usage summary to reports/
(top)
Bot can now subscribe to RSS feeds, track previously known items, and generate toots about newly found items in the feed.
Modify the config.json file and add any number of RSS feeds to follow. Be careful! It will auto-post all newly found items without any care in the world about spamming everyone!
[COMPLETED]
(top)
requests
package. This required refactoring the node-mastodon
package, which has been abandoned. I removed the dependency on this package and added modules/tusk/ which is largely the same code, refactored to use axios and utilize the vanilla js Promise functionality. Dependabot can leave me alone about it now.trending/tags
API endpoint, which was used in addContext()
, so I commented out the getTrendingTags()
call but left it in place for running on instances that do support it. I may go to the trouble of setting up a separate account on another instance just to get trending tag data, but I highly doubt it.addContext()
is making use of this now to enrich the chat completion's context. I have noticed it is more heavily weighing the output than I would like, so I may consider putting some trigger variable into the function invocation to control weather I want the news added or not. Then set some mechanism for deciding which of the scheduled toots will be news related. Maybe I will setup a whole separate loop for it.npm run bot-tail
command and added docs for the server and ingest commands.modules/tusk
to new npm package at https://www.npmjs.com/package/tusk-mastodon and moved to npm install.config.json
'intervals[]'processMention()
to pass the isFollower
variable into the handler functions where needed. Removed the main IF isFollower check.config.json
rather than hardcoded.postToot()
to better handle multi-toots and avoid race condition where secondary toots were not 'in reply to' the thread properly.(top)
This project is released under the MIT License. You are free to use, modify, and distribute the source code, subject to the terms and conditions of the license.
The MIT License is a permissive open-source software license that allows you to use this project for any purpose, including commercial use. By using this project, you agree to retain the original copyright notice and the full license text in all copies or substantial portions of the software.
We encourage collaboration and contribution to the project. Feel free to fork, modify, and share your improvements with the community. Our goal is to make this software as useful and accessible as possible, and your contributions will help us achieve that.
Please note that this project is provided "as is" without any warranty or liability. The authors are not responsible for any consequences that may arise from the use of this software.
(top)