koishi-plugin-ll-brick 1.0.0 → 1.0.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/index.js +5 -4
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -88,7 +88,7 @@ async function apply(ctx, config) {
|
|
|
88
88
|
return `已经在烧砖了`;
|
|
89
89
|
}
|
|
90
90
|
users[user].burning = true;
|
|
91
|
-
await session.send(
|
|
91
|
+
await session.send(`${koishi_1.h.image('https://img3.tofaka.com/autoupload/ontjZmlK09ZHnuFOv9znC7KXl_QqVl-bpSwqP4fJO68/20260624/xsnm/447X447/images_%282%29.jpg/webp')}现在开始烧砖啦,群友每发送${config.cost}条消息就烧好一块砖`);
|
|
92
92
|
let messageCount = 0;
|
|
93
93
|
const dispose = ctx.guild(session.guildId).middleware(async (session_in, next) => {
|
|
94
94
|
if (![session.selfId, session.userId].includes(session_in.userId)) {
|
|
@@ -101,7 +101,7 @@ async function apply(ctx, config) {
|
|
|
101
101
|
brick: koishi_1.$.add(row.brick, 1),
|
|
102
102
|
}], ["userId", "guildId"]);
|
|
103
103
|
users[user].burning = false;
|
|
104
|
-
await session.send(`${koishi_1.h.at(session.userId)} 砖已经烧好啦`);
|
|
104
|
+
await session.send(`${koishi_1.h.image('https://img3.tofaka.com/autoupload/ontjZmlK09ZHnuFOv9znC7KXl_QqVl-bpSwqP4fJO68/20260624/xsnm/447X447/images_%282%29.jpg/webp')}${koishi_1.h.at(session.userId)} 砖已经烧好啦`);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
return next();
|
|
@@ -215,6 +215,7 @@ async function apply(ctx, config) {
|
|
|
215
215
|
const date = new Date();
|
|
216
216
|
const today = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
|
|
217
217
|
let brick = koishi_1.Random.int(config.minGain, config.maxGain + 1);
|
|
218
|
+
const signImg = koishi_1.h.image('https://img3.tofaka.com/autoupload/ontjZmlK09ZHnuFOv9znC7KXl_QqVl-bpSwqP4fJO68/20260624/yNf2/447X447/images_%281%29.jpg/webp');
|
|
218
219
|
const userData = await ctx.database.get('brick', {
|
|
219
220
|
userId: session.userId,
|
|
220
221
|
guildId: session.guildId,
|
|
@@ -226,7 +227,7 @@ async function apply(ctx, config) {
|
|
|
226
227
|
brick: brick,
|
|
227
228
|
checkingDay: today
|
|
228
229
|
});
|
|
229
|
-
return
|
|
230
|
+
return `${signImg}签到成功,你获得了 ${brick} 块砖头,现在有${brick}/${config.maxBrick}块砖头`;
|
|
230
231
|
}
|
|
231
232
|
if (userData[0].checkingDay === today) {
|
|
232
233
|
return "你今天已经签到过了";
|
|
@@ -246,7 +247,7 @@ async function apply(ctx, config) {
|
|
|
246
247
|
brick: koishi_1.$.add(row.brick, brick),
|
|
247
248
|
checkingDay: today
|
|
248
249
|
}], ["userId", "guildId"]);
|
|
249
|
-
return
|
|
250
|
+
return `${signImg}签到成功,你获得了 ${brick} 块砖头,现在有 ${userData[0].brick + brick}/${config.maxBrick} 块砖头`;
|
|
250
251
|
});
|
|
251
252
|
}
|
|
252
253
|
}
|