mirai-js 2.1.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.json +45 -45
- package/.github/FUNDING.yml +12 -12
- package/.github/dependabot.yml +14 -14
- package/.github/workflows/codeql-analysis.yml +70 -0
- package/.husky/pre-commit +5 -5
- package/LICENSE +661 -661
- package/README.md +17 -283
- package/demo.html +1 -1
- package/demo.js +14 -92
- package/dist/browser/mirai-js.js +1 -1
- package/dist/node/BaseType.d.ts +3 -0
- package/dist/node/Bot.d.ts +95 -8
- package/dist/node/Bot.js +241 -18
- package/dist/node/FileManager.js +15 -6
- package/dist/node/Middleware.js +90 -16
- package/dist/node/core/anno/deleteAnno.js +67 -0
- package/dist/node/core/anno/getAnno.js +70 -0
- package/dist/node/core/anno/publishAnno.js +70 -0
- package/dist/node/core/auth.js +9 -11
- package/dist/node/core/fs/deleteGroupFile.js +71 -0
- package/dist/node/core/fs/getGroupFileInfo.js +77 -0
- package/dist/node/core/fs/getGroupFileList.js +82 -0
- package/dist/node/core/fs/makeGroupDir.js +73 -0
- package/dist/node/core/fs/moveGroupFile.js +77 -0
- package/dist/node/core/fs/renameGroupFile.js +73 -0
- package/dist/node/core/fs/uploadGroupFIle.js +81 -0
- package/dist/node/core/getFriendList.js +9 -11
- package/dist/node/core/getGroupConfig.js +9 -11
- package/dist/node/core/getGroupFileInfo.js +6 -2
- package/dist/node/core/getGroupFileList.js +6 -2
- package/dist/node/core/getGroupList.js +9 -11
- package/dist/node/core/getMemberInfo.js +13 -19
- package/dist/node/core/getMemberList.js +9 -11
- package/dist/node/core/getSessionConfig.js +9 -11
- package/dist/node/core/getUserProfile.js +78 -0
- package/dist/node/core/groupFileDelete.js +6 -2
- package/dist/node/core/groupFileMove.js +6 -2
- package/dist/node/core/groupFileRename.js +6 -2
- package/dist/node/core/mute.js +9 -11
- package/dist/node/core/muteAll.js +9 -11
- package/dist/node/core/quitGroup.js +9 -11
- package/dist/node/core/recall.js +9 -11
- package/dist/node/core/releaseSession.js +10 -11
- package/dist/node/core/removeFriend.js +64 -0
- package/dist/node/core/removeMember.js +9 -11
- package/dist/node/core/responseBotInvitedJoinGroupRequest.js +9 -11
- package/dist/node/core/responseFirendRequest.js +9 -11
- package/dist/node/core/responseMemberJoinRequest.js +9 -11
- package/dist/node/core/sendCommand.js +9 -11
- package/dist/node/core/sendFirendMessage.js +9 -11
- package/dist/node/core/sendGroupMessage.js +9 -11
- package/dist/node/core/sendNudge.js +9 -11
- package/dist/node/core/sendTempMessage.js +9 -11
- package/dist/node/core/setEssence.js +9 -11
- package/dist/node/core/setGroupConfig.js +9 -11
- package/dist/node/core/setMemberAdmin.js +70 -0
- package/dist/node/core/setMemberInfo.js +9 -11
- package/dist/node/core/setSessionConfig.js +9 -11
- package/dist/node/core/startListeningBrowser.js +8 -9
- package/dist/node/core/startListeningNode.js +8 -10
- package/dist/node/core/stopListeningBrowser.js +5 -1
- package/dist/node/core/stopListeningNode.js +5 -1
- package/dist/node/core/unmute.js +9 -11
- package/dist/node/core/unmuteAll.js +9 -11
- package/dist/node/core/uploadFileAndSend.js +6 -1
- package/dist/node/core/uploadImage.js +9 -10
- package/dist/node/core/uploadVoice.js +9 -10
- package/dist/node/core/verify.js +9 -11
- package/dist/node/polyfill/URL.js +5 -0
- package/dist/node/polyfill/wsListener.js +6 -0
- package/docs/checkDocShouldBuild.sh +4 -4
- package/package.json +51 -51
- package/src/BaseType.d.ts +3 -0
- package/src/Bot.d.ts +95 -8
- package/src/Bot.js +154 -9
- package/src/FileManager.js +10 -6
- package/src/Middleware.js +51 -3
- package/src/core/anno/deleteAnno.js +42 -0
- package/src/core/anno/getAnno.js +43 -0
- package/src/core/anno/publishAnno.js +43 -0
- package/src/core/auth.js +5 -7
- package/src/core/fs/deleteGroupFile.js +44 -0
- package/src/core/fs/getGroupFileInfo.js +45 -0
- package/src/core/fs/getGroupFileList.js +46 -0
- package/src/core/fs/makeGroupDir.js +44 -0
- package/src/core/fs/moveGroupFile.js +46 -0
- package/src/core/{groupFileRename.js → fs/renameGroupFile.js} +11 -13
- package/src/core/{uploadFileAndSend.js → fs/uploadGroupFIle.js} +9 -11
- package/src/core/getFriendList.js +5 -7
- package/src/core/getGroupConfig.js +5 -7
- package/src/core/getGroupList.js +5 -7
- package/src/core/getMemberInfo.js +8 -10
- package/src/core/getMemberList.js +5 -7
- package/src/core/getSessionConfig.js +5 -7
- package/src/core/getUserProfile.js +39 -0
- package/src/core/mute.js +5 -7
- package/src/core/muteAll.js +5 -7
- package/src/core/quitGroup.js +5 -7
- package/src/core/recall.js +5 -7
- package/src/core/releaseSession.js +6 -7
- package/src/core/{groupFileDelete.js → removeFriend.js} +11 -17
- package/src/core/removeMember.js +5 -7
- package/src/core/responseBotInvitedJoinGroupRequest.js +5 -7
- package/src/core/responseFirendRequest.js +5 -7
- package/src/core/responseMemberJoinRequest.js +5 -7
- package/src/core/sendCommand.js +5 -7
- package/src/core/sendFirendMessage.js +5 -7
- package/src/core/sendGroupMessage.js +5 -7
- package/src/core/sendNudge.js +5 -7
- package/src/core/sendTempMessage.js +5 -7
- package/src/core/setEssence.js +5 -7
- package/src/core/setGroupConfig.js +5 -7
- package/src/core/setMemberAdmin.js +43 -0
- package/src/core/setMemberInfo.js +5 -7
- package/src/core/setSessionConfig.js +5 -7
- package/src/core/startListeningBrowser.js +4 -6
- package/src/core/startListeningNode.js +4 -6
- package/src/core/stopListeningBrowser.js +3 -0
- package/src/core/stopListeningNode.js +3 -0
- package/src/core/unmute.js +5 -7
- package/src/core/unmuteAll.js +5 -7
- package/src/core/uploadImage.js +5 -7
- package/src/core/uploadVoice.js +5 -7
- package/src/core/verify.js +5 -7
- package/src/polyfill/URL.js +3 -0
- package/src/polyfill/wsListener.js +4 -0
- package/webpack.config.js +4 -0
- package/src/core/getGroupFileInfo.js +0 -44
- package/src/core/getGroupFileList.js +0 -40
- package/src/core/groupFileMove.js +0 -46
package/.eslintrc.json
CHANGED
@@ -1,46 +1,46 @@
|
|
1
|
-
{
|
2
|
-
"env": {
|
3
|
-
"browser": true,
|
4
|
-
"node": true,
|
5
|
-
"commonjs": true,
|
6
|
-
"es2021": true
|
7
|
-
},
|
8
|
-
"extends": [
|
9
|
-
"eslint:recommended"
|
10
|
-
],
|
11
|
-
"overrides": [
|
12
|
-
{
|
13
|
-
"files": [
|
14
|
-
"*.ts"
|
15
|
-
],
|
16
|
-
"parser": "@typescript-eslint/parser",
|
17
|
-
"parserOptions": {
|
18
|
-
"ecmaVersion": 12
|
19
|
-
},
|
20
|
-
"plugins": [
|
21
|
-
"@typescript-eslint"
|
22
|
-
],
|
23
|
-
"extends": [
|
24
|
-
"plugin:@typescript-eslint/recommended"
|
25
|
-
]
|
26
|
-
}
|
27
|
-
],
|
28
|
-
"rules": {
|
29
|
-
"indent": [
|
30
|
-
"error",
|
31
|
-
4
|
32
|
-
],
|
33
|
-
"linebreak-style": [
|
34
|
-
"error",
|
35
|
-
"windows"
|
36
|
-
],
|
37
|
-
"quotes": [
|
38
|
-
"error",
|
39
|
-
"single"
|
40
|
-
],
|
41
|
-
"semi": [
|
42
|
-
"error",
|
43
|
-
"always"
|
44
|
-
]
|
45
|
-
}
|
1
|
+
{
|
2
|
+
"env": {
|
3
|
+
"browser": true,
|
4
|
+
"node": true,
|
5
|
+
"commonjs": true,
|
6
|
+
"es2021": true
|
7
|
+
},
|
8
|
+
"extends": [
|
9
|
+
"eslint:recommended"
|
10
|
+
],
|
11
|
+
"overrides": [
|
12
|
+
{
|
13
|
+
"files": [
|
14
|
+
"*.ts"
|
15
|
+
],
|
16
|
+
"parser": "@typescript-eslint/parser",
|
17
|
+
"parserOptions": {
|
18
|
+
"ecmaVersion": 12
|
19
|
+
},
|
20
|
+
"plugins": [
|
21
|
+
"@typescript-eslint"
|
22
|
+
],
|
23
|
+
"extends": [
|
24
|
+
"plugin:@typescript-eslint/recommended"
|
25
|
+
]
|
26
|
+
}
|
27
|
+
],
|
28
|
+
"rules": {
|
29
|
+
"indent": [
|
30
|
+
"error",
|
31
|
+
4
|
32
|
+
],
|
33
|
+
"linebreak-style": [
|
34
|
+
"error",
|
35
|
+
"windows"
|
36
|
+
],
|
37
|
+
"quotes": [
|
38
|
+
"error",
|
39
|
+
"single"
|
40
|
+
],
|
41
|
+
"semi": [
|
42
|
+
"error",
|
43
|
+
"always"
|
44
|
+
]
|
45
|
+
}
|
46
46
|
}
|
package/.github/FUNDING.yml
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
# These are supported funding model platforms
|
2
|
-
|
3
|
-
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
4
|
-
patreon: # Replace with a single Patreon username
|
5
|
-
open_collective: # Replace with a single Open Collective username
|
6
|
-
ko_fi: # Replace with a single Ko-fi username
|
7
|
-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
8
|
-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
9
|
-
liberapay: # Replace with a single Liberapay username
|
10
|
-
issuehunt: # Replace with a single IssueHunt username
|
11
|
-
otechie: # Replace with a single Otechie username
|
12
|
-
custom: ['http://
|
1
|
+
# These are supported funding model platforms
|
2
|
+
|
3
|
+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
4
|
+
patreon: # Replace with a single Patreon username
|
5
|
+
open_collective: # Replace with a single Open Collective username
|
6
|
+
ko_fi: # Replace with a single Ko-fi username
|
7
|
+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
8
|
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
9
|
+
liberapay: # Replace with a single Liberapay username
|
10
|
+
issuehunt: # Replace with a single IssueHunt username
|
11
|
+
otechie: # Replace with a single Otechie username
|
12
|
+
custom: ['http://codingfor.life/']
|
package/.github/dependabot.yml
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
-
# package ecosystems to update and where the package manifests are located.
|
3
|
-
# Please see the documentation for all configuration options:
|
4
|
-
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
5
|
-
|
6
|
-
version: 2
|
7
|
-
updates:
|
8
|
-
- package-ecosystem: "npm"
|
9
|
-
directory: "/"
|
10
|
-
schedule:
|
11
|
-
interval: "
|
12
|
-
allow:
|
13
|
-
- dependency-name: "*"
|
14
|
-
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: "npm"
|
9
|
+
directory: "/"
|
10
|
+
schedule:
|
11
|
+
interval: "monthly"
|
12
|
+
allow:
|
13
|
+
- dependency-name: "*"
|
14
|
+
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
2
|
+
# to commit it to your repository.
|
3
|
+
#
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
5
|
+
# or to provide custom queries or build logic.
|
6
|
+
#
|
7
|
+
# ******** NOTE ********
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
10
|
+
# supported CodeQL languages.
|
11
|
+
#
|
12
|
+
name: "CodeQL"
|
13
|
+
|
14
|
+
on:
|
15
|
+
push:
|
16
|
+
branches: [ master ]
|
17
|
+
pull_request:
|
18
|
+
# The branches below must be a subset of the branches above
|
19
|
+
branches: [ master ]
|
20
|
+
schedule:
|
21
|
+
- cron: '32 11 * * 4'
|
22
|
+
|
23
|
+
jobs:
|
24
|
+
analyze:
|
25
|
+
name: Analyze
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
permissions:
|
28
|
+
actions: read
|
29
|
+
contents: read
|
30
|
+
security-events: write
|
31
|
+
|
32
|
+
strategy:
|
33
|
+
fail-fast: false
|
34
|
+
matrix:
|
35
|
+
language: [ 'javascript' ]
|
36
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
37
|
+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
38
|
+
|
39
|
+
steps:
|
40
|
+
- name: Checkout repository
|
41
|
+
uses: actions/checkout@v2
|
42
|
+
|
43
|
+
# Initializes the CodeQL tools for scanning.
|
44
|
+
- name: Initialize CodeQL
|
45
|
+
uses: github/codeql-action/init@v1
|
46
|
+
with:
|
47
|
+
languages: ${{ matrix.language }}
|
48
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
49
|
+
# By default, queries listed here will override any specified in a config file.
|
50
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
51
|
+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
52
|
+
|
53
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
54
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
55
|
+
- name: Autobuild
|
56
|
+
uses: github/codeql-action/autobuild@v1
|
57
|
+
|
58
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
59
|
+
# 📚 https://git.io/JvXDl
|
60
|
+
|
61
|
+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
62
|
+
# and modify them (or add more) to build your code if your project
|
63
|
+
# uses a compiled language
|
64
|
+
|
65
|
+
#- run: |
|
66
|
+
# make bootstrap
|
67
|
+
# make release
|
68
|
+
|
69
|
+
- name: Perform CodeQL Analysis
|
70
|
+
uses: github/codeql-action/analyze@v1
|
package/.husky/pre-commit
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
. "$(dirname "$0")/_/husky.sh"
|
3
|
-
|
4
|
-
npx lint-staged
|
5
|
-
npm run build
|
1
|
+
#!/bin/sh
|
2
|
+
. "$(dirname "$0")/_/husky.sh"
|
3
|
+
|
4
|
+
npx lint-staged
|
5
|
+
npm run build
|
6
6
|
git add dist
|