Git Product home page Git Product logo

laohuangli-lite-go's Introduction

新老黄历Go

Chat on Telegram GitHub Repo stars Software License Docker

这个项目是对 青年老黄历Bot 项目的精简复刻。仅保留了每日老黄历功能。并增加了提名新词条功能,可以通过投票添加新的词条。

部署

tips: 要使得 bot 正常工作需要在 bot father 处打开 bot 的 inline 功能

  1. .env 中设置必要信息
    1. BOT_TOKEN: Telegram的bot token [必填项]
    2. BOT_ADMIN_ID: 机器人管理员的Telegram ID,配置为管理员的ID可以使用更多命令 [可留空]
    3. KUMA_PUSH_URL: 使用 kuma-push 驱动的 uptime-Kuma 监控服务的推送地址,不带参数 [可留空]
    4. WEB_DOMAIN: 老黄历网页的托管地址 [可留空]
  2. 根据需要运行下面的命令
# 初次运行
make
# 拉取源码升级
git pull
make upgrade
# 移除容器
make clean
  1. website 容器包含了一个 node 驱动的前端页面用于展示当日算命信息与查看模板词条信息,方便用户提名含有模板的词条。前端页面默认暴露于 4090 端口。

数据

词条与历史均使用scribble数据库保存。存放在项目根目录下。目录结构如下:

db/
├── datas/
│   ├── laohuangli-user.json  #用户提名词条
│   ├── laohuangli.json       #本地词条
│   └── templates.json        #词条模板
└── history/
    └── $date.json            #历史记录

词条结构

{
  "uuid": "唯一ID",
  "content": "词条内容",
  "nominator": "提名人昵称"
}

模板结构

"模板变量名": {
  "desc": "模板描述",
  "values": [
    "模板内容数组1",
    "模板内容数组2",
    "模板内容数组3",
    "......"
  ]
}

词条示例

templates.json

{
  "haircolor": {
  "desc": "适用于发色的单字颜色",
  "values": [
  	"",
  	"",
  	"",
  	"",
  	"绿",
  	"",
  	""
  ]
  }
}

laohuangli-user.json

{
  "uuid": "1",
  "content": "给老黄历提名新词条",
  "nominator": "匿名"
},
{
  "uuid": "2",
  "content": "染成{{haircolor}}毛",
  "nominator": "倪明"
}

laohuangli-lite-go's People

Contributors

nigh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.