@hieuzest/koishi-plugin-mahjongpub 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api.js +0 -2
- package/lib/index.js +5 -4
- package/package.json +1 -1
package/lib/api.js
CHANGED
|
@@ -15,7 +15,6 @@ class Team {
|
|
|
15
15
|
constructor(ctx, pw, options) {
|
|
16
16
|
this.pw = pw;
|
|
17
17
|
this.options = options;
|
|
18
|
-
console.log('endpoint', options.endpoint);
|
|
19
18
|
this.http = ctx.http.extend({
|
|
20
19
|
endpoint: options.endpoint,
|
|
21
20
|
});
|
|
@@ -50,7 +49,6 @@ class Team {
|
|
|
50
49
|
};
|
|
51
50
|
const form = new FormData();
|
|
52
51
|
Object.entries(payload).forEach(([key, value]) => form.append(key, value));
|
|
53
|
-
console.log('payload', payload);
|
|
54
52
|
return (await this.http.post('/team_post.php', form, { responseType: 'json' }))?.msg;
|
|
55
53
|
}
|
|
56
54
|
}
|
package/lib/index.js
CHANGED
|
@@ -128,10 +128,11 @@ class MahjongPub {
|
|
|
128
128
|
const team = new api_1.Team(ctx, pw, config);
|
|
129
129
|
try {
|
|
130
130
|
await team.read();
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
for (let i = 0; i < indices.length; i += 2) {
|
|
132
|
+
const t = team.players[indices[i] - 1];
|
|
133
|
+
team.players[indices[i] - 1] = team.players[indices[i + 1] - 1];
|
|
134
|
+
team.players[indices[i + 1] - 1] = t;
|
|
135
|
+
}
|
|
135
136
|
return await team.write() ?? session.text('.success', team);
|
|
136
137
|
}
|
|
137
138
|
catch (e) {
|