• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Lynnesbian/mastodon-bot-template: A bot template for Mastodon API compatible ser ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Lynnesbian/mastodon-bot-template

开源软件地址(OpenSource Url):

https://github.com/Lynnesbian/mastodon-bot-template

开源编程语言(OpenSource Language):

Python 100.0%

开源软件介绍(OpenSource Introduction):

mastodon-bot-template

A bot template for Mastodon API compatible servers

Installation

You'll need Python 3, along with pip (which should come with python 3). If you're on a Linux system, try installing python3 python3-pip or python python-pip. If you're on Windows, make sure you check the "Add Python to PATH" box in the installer, if present.

Next you'll need to download mastodon-bot-template. If you have git: git clone https://github.com/Lynnesbian/mastodon-bot-template Otherwise, download the zip file from here, and extract it somewhere.

After installing Python, you'll need to install mastodon-bot-template's requirements. You can do this by opening a terminal in the directory you put the files in, and running

python3 -m venv venv
source venv/bin/activate #if you're on windows, run venv\Scripts\activate.bat instead
python3 -m pip install -r requirements.txt

You're now ready to start editing the bot template.

Configuration

You'll want to edit meta.json to set your bot's name, source code page, and administrator. You'll also want to take a look at login.py, which defines which instance your bot logs in to, reply.py, which handles replying to mentions, and post.py, which handles one-off posts. Note that it's mandatory to provide a link to the source code, as this code is licensed under the GNU Affero General Public License v3. You'll also need to link back to this repository.

Finally, run login.py by typing python3 login.py, and answer the questions given. You're ready to go! Try running python3 post.py to create your first post.

When you upload your source code, make sure you don't upload the config.json file. This file contains your bot credentials, and if you upload them, someone else can use them to post from your bot's account!!

Listening for Replies

If you're using systemd, you can fill in the provided systemd-example.service and move it into an appropriate direcoty (e.g. /etc/systemd/system) to manage replies with systemd. You can do the same with SysVInit, initrc, launchd, etc., but no template is (currently) provided.

You can also listen for replies manually. This is done by running python3 reply.py.

About

mastodon-bot-template is created and managed by Lynnesbian. Some code used was originally from mstdn-ebooks, and many of my other Fediverse bots (e.g. OCRbot) use similar code.

Donations

You can donate once with PayPal or Ko-fi, or you can set up a monthly donation (with perks!) at Patreon.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
kstrauser/freeradical: Mastodon administration helpers发布时间:2022-08-17
下一篇:
mastodonkaigi/mastodonkaigi.org: MastodonKaigi website.发布时间:2022-08-17
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap