Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-cn authored Jul 7, 2024
0 parents commit ba2cc58
Show file tree
Hide file tree
Showing 61 changed files with 8,795 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom:
- https://afdian.net/a/lc-cn
66 changes: 66 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Docs

on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
push:
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm # or pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci # or pnpm install / yarn install / bun install
- name: Build with VitePress
run: |
npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
touch docs/dist/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
37 changes: 37 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release
on:
push:
branches:
- master
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: node
package-name: qq-official-bot
# Checkout
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
# Setup node
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
# Install dependencies
- run: npm install
if: ${{ steps.release.outputs.release_created }}
# Build output
- run: npm run build
if: ${{ steps.release.outputs.release_created }}
# Publish to npm
- run: npm run pub
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/src/test.ts
/lib/
/docs/.vitepress/cache/
/node_modules/
/.idea/
/.vscode/
90 changes: 90 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Changelog

## 1.0.0 (2024-07-05)


### Features

* reply event_id ([e3d02cc](https://github.com/zhinjs/qq-official-bot/commit/e3d02cc0d4314b51b54e655c2c7f3a1f09629719))


### Bug Fixes

* actions/checkout@v4,actions/setup-node@v4,add package-lock.json ([646493b](https://github.com/zhinjs/qq-official-bot/commit/646493b68ee33a544c93fce4901d8f9ca2fa8733))
* add group/user recall msg method ([73663b9](https://github.com/zhinjs/qq-official-bot/commit/73663b9297571f72efcf3c3d57c7eff03c630c16))
* change error method name ([b613ab4](https://github.com/zhinjs/qq-official-bot/commit/b613ab473e6b6ae8285541cede7d1edc433dd365))
* change reactionGuildMessage to addGuildMessageReaction ([8ffbdc4](https://github.com/zhinjs/qq-official-bot/commit/8ffbdc41ade6fdb309c569df494a82c824f5fa31))
* code error ([25ad7ee](https://github.com/zhinjs/qq-official-bot/commit/25ad7ee330c283da3c3ee3daa4741545defd55d0))
* file:// 开头无法发送,同时带 reply file 无法发送 ([831fbb8](https://github.com/zhinjs/qq-official-bot/commit/831fbb8a796b4939b0dbc3029dd12c756ee86948))
* friendly error ([2bc6360](https://github.com/zhinjs/qq-official-bot/commit/2bc63601110a12e85e4b3f8c0ea4351ca020cfbb))
* friendly img brief ([e8d6d65](https://github.com/zhinjs/qq-official-bot/commit/e8d6d65346f6908d4d5d8c91c7a5f32052be6ba4))
* friendly img brief ([706b572](https://github.com/zhinjs/qq-official-bot/commit/706b5728ed9b390d87c8b686c1b2d0e401abaeed))
* friendly media brief ([6993156](https://github.com/zhinjs/qq-official-bot/commit/6993156e066a9d16335b9730c93939ada985d4d0))
* friendly media brief ([ca003a8](https://github.com/zhinjs/qq-official-bot/commit/ca003a8a0ec23ec963ec5c97a0de85a9b8ec9661))
* local file ([c97014a](https://github.com/zhinjs/qq-official-bot/commit/c97014ac78a017bca6436635bed3dec23a1b5509))
* message_id错误 ([5c393d7](https://github.com/zhinjs/qq-official-bot/commit/5c393d7b3f2c451aaee62efeade17cdfe853f2f0))
* package-lock ([fccdba3](https://github.com/zhinjs/qq-official-bot/commit/fccdba34f8b9e9aa0b3ead5957e715cbaf64ab3e))
* remove chagne log ([00cfdd5](https://github.com/zhinjs/qq-official-bot/commit/00cfdd5b56193053ea41d44c29b652f217eaef57))
* removeAt配置无效问题 ([b20fee8](https://github.com/zhinjs/qq-official-bot/commit/b20fee8b41ad2082bfb3d22802f6d8ead6cd0044))
* rename and transfer ([98c2f95](https://github.com/zhinjs/qq-official-bot/commit/98c2f95e089c1aade271456359ef74b329d4590f))
* replyAction ([0fe0831](https://github.com/zhinjs/qq-official-bot/commit/0fe0831284176eb4a4ac22b12569f9056e885c36))
* replyAction ([decec4b](https://github.com/zhinjs/qq-official-bot/commit/decec4bf4261f96fdf883657a1fd6be7559a0cda))
* string msg ([4395f28](https://github.com/zhinjs/qq-official-bot/commit/4395f28eed5395c4f74790ec80d455a12ebab93f))
* Update Build Docs Action ([99fcfe7](https://github.com/zhinjs/qq-official-bot/commit/99fcfe7dab8c68ae3bf4345c4aa724f414837405))
* Update Build Docs Action ([5bcf0e2](https://github.com/zhinjs/qq-official-bot/commit/5bcf0e2a2671935015ca90b8ad4ba20ad36f8a80))
* Update Build Docs Action ([df6cf2b](https://github.com/zhinjs/qq-official-bot/commit/df6cf2b5bf3e6759b9b065c33ef69eba00e56ed8))
* Update Release Action ([e691408](https://github.com/zhinjs/qq-official-bot/commit/e691408c0aa6df71c430f70e5c9189e7e5eb2c47))
* uploadMedia接口对base64://的支持 ([5d8945f](https://github.com/zhinjs/qq-official-bot/commit/5d8945fb5ed5bd0a84ebc0cec2d2b6fcf55356f3))
* uploadMedia接口暴露 ([5de0523](https://github.com/zhinjs/qq-official-bot/commit/5de0523371cf5bd6bad163bfb72a75b0ebc38505))
* use ali mirror ([2fc7690](https://github.com/zhinjs/qq-official-bot/commit/2fc7690016c53c7a8c91750951670192c9c24063))
* 事件错误 ([15f103d](https://github.com/zhinjs/qq-official-bot/commit/15f103ded1eef539a382df16fb1f9ac984e213f2))
* 仅对支持的内容进行解码 ([bdbe0b9](https://github.com/zhinjs/qq-official-bot/commit/bdbe0b9657d8ec6d8cf0f85bbda5f2194e6d81eb))
* 使用 formdata-node ([5ad543c](https://github.com/zhinjs/qq-official-bot/commit/5ad543c68a8170890e69a03262e4941cf964181f))
* 使用ReadStream替代blob ([d6b35b5](https://github.com/zhinjs/qq-official-bot/commit/d6b35b579bc0440f02750ce46ccd933edcab228e))
* 修复获取表态用户列表错误 ([0030d98](https://github.com/zhinjs/qq-official-bot/commit/0030d98c49435cbe97409f1001cf1b7b9ac37a21))
* 允许关闭 ([10005e8](https://github.com/zhinjs/qq-official-bot/commit/10005e816f081dbf625d709c8ee39f563662e8f8))
* 关闭失败 ([103fab2](https://github.com/zhinjs/qq-official-bot/commit/103fab250a85870dbf915c407754ef48caba3281))
* 发送完消息,消息数组没了 ([2865945](https://github.com/zhinjs/qq-official-bot/commit/2865945ebbd63f8258321327bc3a549a2c40206b))
* 图片/语音/视频发送修复 ([1cf39c3](https://github.com/zhinjs/qq-official-bot/commit/1cf39c3f1588a5e564592fb2645b7938bf7b58e7))
* 图片发送不存本地 ([efa0b48](https://github.com/zhinjs/qq-official-bot/commit/efa0b48fec7c61dd261ba3893a6e366598ae744f))
* 图片发送修复 ([66f24d1](https://github.com/zhinjs/qq-official-bot/commit/66f24d185ceae5a4df34cee150e13d9c96aac5e5))
* 图片发送修复 ([029b578](https://github.com/zhinjs/qq-official-bot/commit/029b578dffc65dd7133031f4b1e5d46ba463cebc))
* 图片接收修复 ([ad50b4c](https://github.com/zhinjs/qq-official-bot/commit/ad50b4ce8e89ad151d83ee3c7ab210511122527f))
* 增加KeyboardElem 用于发送按钮模板; ([77414c3](https://github.com/zhinjs/qq-official-bot/commit/77414c3afc96c38bb004b78d69c69a4f7fba322c))
* 增加主动消息开启/拒绝事件 ([6470a14](https://github.com/zhinjs/qq-official-bot/commit/6470a1457f899e6a7b60ee29030bbab3b4504581))
* 增加操作回应能力 ([3bc4548](https://github.com/zhinjs/qq-official-bot/commit/3bc45485f73f842c3c3cb360b799fd7a1488db65))
* 增加音频/直播/论坛子频道事件 ([37b6ce2](https://github.com/zhinjs/qq-official-bot/commit/37b6ce2770b20152ea4b532d3c507871732f4540))
* 增加频道上下麦接口 ([7778073](https://github.com/zhinjs/qq-official-bot/commit/7778073bee0c7e3f99f54b059308e9f64e9eb026))
* 增加频道帖子相关接口 ([7778073](https://github.com/zhinjs/qq-official-bot/commit/7778073bee0c7e3f99f54b059308e9f64e9eb026))
* 增加频道日程相关接口 ([7778073](https://github.com/zhinjs/qq-official-bot/commit/7778073bee0c7e3f99f54b059308e9f64e9eb026))
* 增加频道音频控制接口 ([7778073](https://github.com/zhinjs/qq-official-bot/commit/7778073bee0c7e3f99f54b059308e9f64e9eb026))
* 增强代码健壮性 ([6f112c5](https://github.com/zhinjs/qq-official-bot/commit/6f112c57b8ef7a64c9b28b496e676e50254c0ca1))
* 处理空包 ([4bf36eb](https://github.com/zhinjs/qq-official-bot/commit/4bf36eb3914e958564c430ecf501897434de68e9))
* 完善类型约束 ([b437359](https://github.com/zhinjs/qq-official-bot/commit/b437359a909c96cac1d0406c06cd9e24d25e4ffe))
* 将direct事件移动至private事件 ([37b6ce2](https://github.com/zhinjs/qq-official-bot/commit/37b6ce2770b20152ea4b532d3c507871732f4540))
* 将报错信息输出到debug ([bc4aabf](https://github.com/zhinjs/qq-official-bot/commit/bc4aabfcfe6e6df0c1c4b3381e7ce9a21d2459bc))
* 按钮操作格式化 ([7af8bd7](https://github.com/zhinjs/qq-official-bot/commit/7af8bd7eafbc758b07977d402cfcb8d47cc908d1))
* 支持发送ark/embed (仅频道和频道私信支持) ([fe4dacd](https://github.com/zhinjs/qq-official-bot/commit/fe4dacdc376f6ba3fa60c34e17f70b012965912a))
* 支持频道消息表态添加删除事件 ([0d8aabd](https://github.com/zhinjs/qq-official-bot/commit/0d8aabdf12c5b161fa7b7f4b3a1fafb6d7b0fbf8))
* 消息模板字符串不解析Bug ([2d98fec](https://github.com/zhinjs/qq-official-bot/commit/2d98fec8006e16f275bad5495c3c4fc4e1e78e7b))
* 添加加群链接 ([5a02297](https://github.com/zhinjs/qq-official-bot/commit/5a02297a282657d1b631ad9cde182cc0c681a8a0))
* 添加接口 getGuildInfo ([fc14a4a](https://github.com/zhinjs/qq-official-bot/commit/fc14a4ad58ee5a52b3f56654e47a085b0e5267ca))
* 添加接口类型声明 ([ebf3383](https://github.com/zhinjs/qq-official-bot/commit/ebf338343ad9df9591372bc857bc6037d398742b))
* 添加撤回消息接口(仅频道私信和子频道消息可用) ([852d100](https://github.com/zhinjs/qq-official-bot/commit/852d100a9554314228721db76eaab1601c3f9eb2))
* 添加部分文档 ([a577036](https://github.com/zhinjs/qq-official-bot/commit/a577036557cf4c601cfef91403a92f11d8122898))
* 类型提示优化 ([388a985](https://github.com/zhinjs/qq-official-bot/commit/388a9851b600c027f585a7732f9c6ae910c850cd))
* 编译类型错误 ([8259f7d](https://github.com/zhinjs/qq-official-bot/commit/8259f7df6da1004557c72b762b78c5ef70d3cf2a))
* 群聊、私信支持本地文件/base64/Buffer/网络url发送 ([a12b24e](https://github.com/zhinjs/qq-official-bot/commit/a12b24ef41521d999e6bfdadb581604bc3e90da3))
* 群聊支持发送Ark ([c2d5e7d](https://github.com/zhinjs/qq-official-bot/commit/c2d5e7df05df73162370d060a0617636e14108b2))
* 获取频道消息 ([2525399](https://github.com/zhinjs/qq-official-bot/commit/252539952c7ce5d9970b1a45ec868b4c79782e21))
* 被动回复失败 ([7273ed8](https://github.com/zhinjs/qq-official-bot/commit/7273ed83cd63b552b23029d86a413728c1f235c3))
* 请求支持配置超时时间(config.timeout) 默认为5秒 ([ce8e70f](https://github.com/zhinjs/qq-official-bot/commit/ce8e70f82e442b6a548f951868ebc3029f137a67))
* 返回引用消息的信息,reply类型的message_id改为id ([a11bfc2](https://github.com/zhinjs/qq-official-bot/commit/a11bfc249c5bcb5d819cd86519e630c9367932a8))
* 连接出错标明原因,事件解析失败增加debug日志 ([c2b77f2](https://github.com/zhinjs/qq-official-bot/commit/c2b77f2256f03d0fc74b10f6c25444a0ae3cf121))
* 通知事件格式化 ([cd3b5a7](https://github.com/zhinjs/qq-official-bot/commit/cd3b5a7f95ed23fecf43d3aa9953a147df455273))
* 重复监听ws事件问题 ([0107e2c](https://github.com/zhinjs/qq-official-bot/commit/0107e2ca140b52c99687b3199ed6d161c607f5b9))
* 重连错误 ([412f681](https://github.com/zhinjs/qq-official-bot/commit/412f681bf56209b54e73d453aa802082b4631fe0))
* 附件增加 name 字段 ([fd5b519](https://github.com/zhinjs/qq-official-bot/commit/fd5b5190a5e9e410d3ec848e87276b3a76d55e07))
* 频道接口支持上传本地图片或Buffer或base64 ([6fa63eb](https://github.com/zhinjs/qq-official-bot/commit/6fa63ebe3a64f78d7f7e59da43cc0cad4e748dc0))
* 频道接口支持上传本地图片或Buffer或base64 ([256746d](https://github.com/zhinjs/qq-official-bot/commit/256746dcb482e234ed7e2482e7a8126f07367efd))
* 频道消息增加消息表态能力 ([3bc4548](https://github.com/zhinjs/qq-official-bot/commit/3bc45485f73f842c3c3cb360b799fd7a1488db65))
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 凉菜

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit ba2cc58

Please sign in to comment.