diff --git a/app/src/app.js b/app/src/app.js
index cdb9027d..bfb0b81d 100644
--- a/app/src/app.js
+++ b/app/src/app.js
@@ -370,7 +370,11 @@ function Nothing(context) {
async function App(context) {
traffic.recordPeople(context);
- context.replyText = function (...args) {
+ context.quoteReply = function (...args) {
+ if (!context.event.isText) {
+ return context.reply(...args);
+ }
+
const { quoteToken } = context.event.message;
const [text] = args;
let replyObject = {};
diff --git a/app/src/controller/application/AdvancementController.js b/app/src/controller/application/AdvancementController.js
index 724ef8ae..9842e90f 100644
--- a/app/src/controller/application/AdvancementController.js
+++ b/app/src/controller/application/AdvancementController.js
@@ -29,7 +29,7 @@ async function list(context) {
const data = await advModel.findUserAdvancementsByPlatformId(userId);
if (data.length === 0) {
- return context.replyText(i18n.__("message.advancement.no_data"));
+ return context.quoteReply(i18n.__("message.advancement.no_data"));
}
const rows = data.map(item => {
@@ -62,7 +62,7 @@ async function adminList(context) {
let page = 1;
if (args.help || args.h) {
- return context.replyText(i18n.__("message.advancement.list_usage"));
+ return context.quoteReply(i18n.__("message.advancement.list_usage"));
}
if (args.page) {
@@ -109,7 +109,7 @@ async function adminList(context) {
config
);
- return context.replyText(messages);
+ return context.quoteReply(messages);
}
/**
@@ -120,7 +120,7 @@ async function adminAdd(context) {
const args = minimist(context.event.message.text.split(" "));
if (args.help || args.h) {
- return context.replyText(i18n.__("message.advancement.add_usage"));
+ return context.quoteReply(i18n.__("message.advancement.add_usage"));
}
const ajv = new Ajv();
@@ -165,15 +165,15 @@ async function adminAdd(context) {
const valid = validate(attributes);
if (!valid) {
DefaultLogger.warn("管理員新增成就錯誤", validate.errors);
- return context.replyText(i18n.__("message.advancement.add_invalid_bad_request"));
+ return context.quoteReply(i18n.__("message.advancement.add_invalid_bad_request"));
}
const result = await advModel.create(attributes);
if (result) {
- return context.replyText(i18n.__("message.advancement.add_success", { name: attributes.name }));
+ return context.quoteReply(i18n.__("message.advancement.add_success", { name: attributes.name }));
} else {
- return context.replyText(i18n.__("message.advancement.add_fail"));
+ return context.quoteReply(i18n.__("message.advancement.add_fail"));
}
}
@@ -183,16 +183,16 @@ async function adminAttach(context) {
const mentionees = get(mention, "mentionees", []);
if (args.help || args.h) {
- return context.replyText(i18n.__("message.advancement.attach_usage"));
+ return context.quoteReply(i18n.__("message.advancement.attach_usage"));
}
const advId = get(args, "_.2", null);
if (!isNumber(advId)) {
- return context.replyText(i18n.__("message.advancement.attach_usage"));
+ return context.quoteReply(i18n.__("message.advancement.attach_usage"));
}
if (mentionees.length === 0) {
- return context.replyText(i18n.__("message.advancement.attach_no_mention"));
+ return context.quoteReply(i18n.__("message.advancement.attach_no_mention"));
}
const userIds = mentionees.map(item => item.userId);
@@ -200,13 +200,13 @@ async function adminAttach(context) {
if (result) {
const { name } = await advModel.find(advId);
- return context.replyText(
+ return context.quoteReply(
i18n.__("message.advancement.attach_success", {
players: userIds.length,
name,
})
);
} else {
- return context.replyText(i18n.__("message.advancement.attach_fail"));
+ return context.quoteReply(i18n.__("message.advancement.attach_fail"));
}
}
diff --git a/app/src/controller/application/AdvertisementController.js b/app/src/controller/application/AdvertisementController.js
index 494b7aff..e7249839 100644
--- a/app/src/controller/application/AdvertisementController.js
+++ b/app/src/controller/application/AdvertisementController.js
@@ -24,7 +24,7 @@ async function addAdvertisement(context) {
const strMessage = match ? match[0] : "";
if (!strMessage) {
- await context.replyText(i18n.__("message.advertisement.add_usage"));
+ await context.quoteReply(i18n.__("message.advertisement.add_usage"));
return;
}
@@ -40,7 +40,7 @@ async function addAdvertisement(context) {
const ad = await adModel.findLatestByTitle(title);
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.advertisement.add_success", {
title: ad.title,
id: ad.id,
diff --git a/app/src/controller/application/AliasController.js b/app/src/controller/application/AliasController.js
index ae6779bc..9a45669f 100644
--- a/app/src/controller/application/AliasController.js
+++ b/app/src/controller/application/AliasController.js
@@ -20,7 +20,7 @@ async function alias(context) {
const restStr = message.replace(get(args, "_.0"), "").trim();
if (get(args, "_").length === 1) {
- await context.replyText(i18n.__("message.alias.add_usage"));
+ await context.quoteReply(i18n.__("message.alias.add_usage"));
return;
}
@@ -28,7 +28,7 @@ async function alias(context) {
await setAlias(newAlias, command);
- return context.replyText(`${newAlias} 已經設定成 ${command}`);
+ return context.quoteReply(`${newAlias} 已經設定成 ${command}`);
}
async function setAlias(newAlias, command) {
diff --git a/app/src/controller/application/BullshitController.js b/app/src/controller/application/BullshitController.js
index 107fc180..66b9f0b5 100644
--- a/app/src/controller/application/BullshitController.js
+++ b/app/src/controller/application/BullshitController.js
@@ -13,7 +13,7 @@ exports.router = [
];
async function bullshitManual(context) {
- await context.replyText(i18n.__("message.bullshit.manual"));
+ await context.quoteReply(i18n.__("message.bullshit.manual"));
}
/**
@@ -44,7 +44,7 @@ async function bullshitGenerator(context, props) {
const data = get(result, "data");
if (!data) {
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.bullshit.failed", {
userId: get(context, "event.source.userId"),
})
@@ -59,5 +59,5 @@ async function bullshitGenerator(context, props) {
.trim()
.replace(/
/g, "\n");
- await context.replyText(bullshit);
+ await context.quoteReply(bullshit);
}
diff --git a/app/src/controller/application/ChatLevelController.js b/app/src/controller/application/ChatLevelController.js
index b3f74274..adc2b56b 100644
--- a/app/src/controller/application/ChatLevelController.js
+++ b/app/src/controller/application/ChatLevelController.js
@@ -40,7 +40,7 @@ exports.showStatus = async (context, props) => {
pictureUrl = pictureUrl || "https://i.imgur.com/NMl4z2u.png";
if (!userId || !displayName) {
- context.replyText("獲取失敗,無法辨識用戶");
+ context.quoteReply("獲取失敗,無法辨識用戶");
throw "userId or displayName is empty";
}
@@ -209,7 +209,7 @@ exports.showStatus = async (context, props) => {
const isSelf = context.event.source.userId === userId;
if (!level && isSelf) {
- context.replyText("尚未有任何數據,經驗開始累積後即可投胎!");
+ context.quoteReply("尚未有任何數據,經驗開始累積後即可投胎!");
}
} catch (e) {
DefaultLogger.error(e);
@@ -313,7 +313,7 @@ async function getQuestInfo(userId) {
exports.showFriendStatus = async context => {
const { mention, text } = context.event.message;
if (!mention) {
- return context.replyText("請tag想要查詢的夥伴們!");
+ return context.quoteReply("請tag想要查詢的夥伴們!");
}
let users = mention.mentionees.map(d => ({
...d,
@@ -330,10 +330,10 @@ exports.showFriendStatus = async context => {
);
if (messages.length === 0) {
- context.replyText("查詢失敗!");
+ context.quoteReply("查詢失敗!");
} else {
messages = [">>>查詢結果<<<", ...messages];
- context.replyText(messages.join("\n"));
+ context.quoteReply(messages.join("\n"));
}
};
@@ -348,7 +348,7 @@ exports.setEXP = (context, { match }) => {
console.log(userId, exp, "修改經驗");
ChatLevelModel.setExperience(userId, exp).then(result => {
let msg = result ? "修改成功" : "修改失敗";
- context.replyText(msg, { sender: { name: "管理員指令" } });
+ context.quoteReply(msg, { sender: { name: "管理員指令" } });
});
};
@@ -363,7 +363,7 @@ exports.setEXPRate = (context, { match }) => {
console.log(expRate, "修改經驗倍率");
ChatLevelModel.setExperienceRate(expRate).then(result => {
let msg = result ? "修改成功" : "修改失敗";
- context.replyText(msg, { sender: { name: "管理員指令" } });
+ context.quoteReply(msg, { sender: { name: "管理員指令" } });
});
};
diff --git a/app/src/controller/application/CouponController.js b/app/src/controller/application/CouponController.js
index 0d38807e..f2f1e71d 100644
--- a/app/src/controller/application/CouponController.js
+++ b/app/src/controller/application/CouponController.js
@@ -21,7 +21,7 @@ async function adminAdd(context) {
const args = minimist(context.event.text.split(" "));
if (args.h || args.help) {
- return context.replyText(i18n.__("message.coupon.admin_add_usage"));
+ return context.quoteReply(i18n.__("message.coupon.admin_add_usage"));
}
const [code, startAt, endAt, reward] = [
@@ -39,7 +39,7 @@ async function adminAdd(context) {
DefaultLogger.warn(
`[CouponController.addCoupon] Validation failed: ${JSON.stringify(validate.errors)}`
);
- return context.replyText(i18n.__("message.coupon.admin_add_invalid_param"));
+ return context.quoteReply(i18n.__("message.coupon.admin_add_invalid_param"));
}
try {
@@ -53,10 +53,10 @@ async function adminAdd(context) {
end_at: moment(endAt).toDate(),
});
- return context.replyText(i18n.__("message.coupon.admin_add_success", { id, code }));
+ return context.quoteReply(i18n.__("message.coupon.admin_add_success", { id, code }));
} catch (e) {
DefaultLogger.error(e);
- return context.replyText(i18n.__("message.coupon.admin_add_failed"));
+ return context.quoteReply(i18n.__("message.coupon.admin_add_failed"));
}
}
@@ -69,24 +69,24 @@ async function userUse(context, props) {
const { userId } = context.event.source;
if (!userId) {
- return context.replyText(i18n.__("message.user_unreconized"));
+ return context.quoteReply(i18n.__("message.user_unreconized"));
}
const coupon = await couponCode.findByCode(code);
if (!coupon) {
- return context.replyText(i18n.__("message.coupon.not_found", { code }));
+ return context.quoteReply(i18n.__("message.coupon.not_found", { code }));
}
const [startAt, endAt] = [moment(coupon.start_at), moment(coupon.end_at)];
const now = moment();
if (now.isBefore(startAt)) {
- return context.replyText(i18n.__("message.coupon.not_yet_available", { code }));
+ return context.quoteReply(i18n.__("message.coupon.not_yet_available", { code }));
}
if (now.isAfter(endAt)) {
- return context.replyText(i18n.__("message.coupon.expired", { code }));
+ return context.quoteReply(i18n.__("message.coupon.expired", { code }));
}
const records = await couponUsedHistory.all({
@@ -103,7 +103,7 @@ async function userUse(context, props) {
});
if (records.length > 0) {
- return context.replyText(i18n.__("message.coupon.already_used", { code }));
+ return context.quoteReply(i18n.__("message.coupon.already_used", { code }));
}
try {
@@ -114,7 +114,7 @@ async function userUse(context, props) {
coupon_code_id: coupon.id,
});
- return context.replyText(
+ return context.quoteReply(
i18n.__("message.coupon.success", {
code,
reward: getRewardMessage(coupon.reward),
@@ -122,7 +122,7 @@ async function userUse(context, props) {
);
} catch (e) {
DefaultLogger.error(e);
- return context.replyText(
+ return context.quoteReply(
i18n.__("message.coupon.failed", {
userId,
code,
diff --git a/app/src/controller/application/CreaturesController.js b/app/src/controller/application/CreaturesController.js
index 2d4cd912..b0ae96d0 100644
--- a/app/src/controller/application/CreaturesController.js
+++ b/app/src/controller/application/CreaturesController.js
@@ -45,7 +45,7 @@ async function main(context) {
const userHasCreatures = await creatureModel.findUserCreature(userNo);
if (!userHasCreatures) {
- context.replyText(i18n.__("message.creatures.not_found_to_create"));
+ context.quoteReply(i18n.__("message.creatures.not_found_to_create"));
return await preCreate(context, { isNeedCheck: false });
}
@@ -75,7 +75,7 @@ async function preCreate(context, { isNeedCheck = true }) {
const userHasCreatures = await creatureModel.findUserCreature(userNo);
if (userHasCreatures) {
- await context.replyText(i18n.__("message.creatures.already_exists"));
+ await context.quoteReply(i18n.__("message.creatures.already_exists"));
return;
}
}
@@ -87,7 +87,7 @@ async function preCreate(context, { isNeedCheck = true }) {
});
if (creatures.length === 0) {
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.creatures.admin_error", {
userId: context.event.source.userId,
})
@@ -109,7 +109,7 @@ exports.initCreate = async (context, { payload }) => {
const userHasCreatures = await creatureModel.findUserCreature(userNo);
if (userHasCreatures) {
- await context.replyText(i18n.__("message.creatures.already_exists"));
+ await context.quoteReply(i18n.__("message.creatures.already_exists"));
return;
}
@@ -117,7 +117,7 @@ exports.initCreate = async (context, { payload }) => {
const creature = await creatureModel.findById(creature_id);
if (!creature) {
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.creatures.admin_error", {
userId: context.event.source.userId,
})
@@ -125,7 +125,7 @@ exports.initCreate = async (context, { payload }) => {
return;
}
- context.replyText(i18n.__("message.creatures.ask_for_nickname", { name: creature.name }));
+ context.quoteReply(i18n.__("message.creatures.ask_for_nickname", { name: creature.name }));
context.setState({
creature: {
isCreating: true,
@@ -143,7 +143,7 @@ async function confirmCreate(context) {
const { text: nickname } = context.event.message;
if (hasSpace(nickname)) {
- await context.replyText(i18n.__("message.creatures.nickname_has_space"));
+ await context.quoteReply(i18n.__("message.creatures.nickname_has_space"));
return;
}
@@ -151,21 +151,21 @@ async function confirmCreate(context) {
const userHasCreatures = await creatureModel.findUserCreature(userNo);
if (userHasCreatures) {
- await context.replyText(i18n.__("message.creatures.already_exists"));
+ await context.quoteReply(i18n.__("message.creatures.already_exists"));
clearState(context);
return;
}
const creatureId = get(context.state, "creature.creatureId");
if (!creatureId) {
- await context.replyText(i18n.__("message.creatures.admin_error"));
+ await context.quoteReply(i18n.__("message.creatures.admin_error"));
clearState(context);
return;
}
const creature = await creatureModel.findById(creatureId);
if (!creature) {
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.creatures.admin_error", {
userId: context.event.source.userId,
})
@@ -187,7 +187,7 @@ async function confirmCreate(context) {
items: [quickReplies.yes, quickReplies.no],
};
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.creatures.ask_for_nickname_confirm", {
name: creature.name,
nickname,
@@ -211,13 +211,13 @@ async function create(context) {
if (denyText.includes(text)) {
clearState(context);
- context.replyText(i18n.__("message.creatures.create_user_cancel"));
+ context.quoteReply(i18n.__("message.creatures.create_user_cancel"));
return;
}
const creature = await creatureModel.findById(creatureId);
if (!allowText.includes(text)) {
- context.replyText(
+ context.quoteReply(
i18n.__("message.creatures.ask_for_nickname_confirm", {
name: get(creature, "name", ""),
nickname,
@@ -233,12 +233,12 @@ async function create(context) {
});
if (!id) {
- context.replyText(i18n.__("message.creatures.admin_error"));
+ context.quoteReply(i18n.__("message.creatures.admin_error"));
clearState(context);
return;
}
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.creatures.create_success", {
name: get(creature, "name", ""),
nickname,
@@ -272,7 +272,7 @@ exports.useFood = async (context, { payload }) => {
const creature = await creatureModel.findUserCreature(userNo);
if (!creature) {
- await context.replyText(i18n.__("message.creatures.not_found"));
+ await context.quoteReply(i18n.__("message.creatures.not_found"));
return;
}
@@ -297,7 +297,7 @@ exports.useFood = async (context, { payload }) => {
trx.commit();
} catch (e) {
console.error(e);
- await context.replyText(i18n.__("message.creatures.admin_error"));
+ await context.quoteReply(i18n.__("message.creatures.admin_error"));
trx.rollback();
return;
}
diff --git a/app/src/controller/application/CustomerOrder.js b/app/src/controller/application/CustomerOrder.js
index 91578603..24c9542c 100644
--- a/app/src/controller/application/CustomerOrder.js
+++ b/app/src/controller/application/CustomerOrder.js
@@ -119,10 +119,10 @@ exports.insertCustomerOrder = async (context, props, touchType = 1) => {
CustomerOrderModel.insertOrder(params);
- context.replyText(`${order} 新增成功`);
+ context.quoteReply(`${order} 新增成功`);
} catch (e) {
if (e.name === "CusOrderException") {
- context.replyText(e.message);
+ context.quoteReply(e.message);
} else {
// keep throw
throw e;
@@ -262,7 +262,7 @@ exports.deleteCustomerOrder = async (context, { match }) => {
0
);
- context.replyText(`"${order}"刪除成功!`);
+ context.quoteReply(`"${order}"刪除成功!`);
return;
}
@@ -270,7 +270,7 @@ exports.deleteCustomerOrder = async (context, { match }) => {
CustomerOrderTemplate[context.platform].showDeleteOption(context, deleteOrders);
} catch (e) {
if (e.name === "CusOrderException") {
- context.replyText(e.message);
+ context.quoteReply(e.message);
} else throw e;
}
};
diff --git a/app/src/controller/application/DonateListController.js b/app/src/controller/application/DonateListController.js
index c19a6b58..072f13a5 100644
--- a/app/src/controller/application/DonateListController.js
+++ b/app/src/controller/application/DonateListController.js
@@ -19,7 +19,7 @@ async function adminList(context) {
let page = 1;
if (args.help || args.h) {
- return context.replyText(i18n.__("message.advancement.list_usage"));
+ return context.quoteReply(i18n.__("message.advancement.list_usage"));
}
if (args.page) {
@@ -38,7 +38,7 @@ async function adminList(context) {
const data = await DonateModel.all(options);
if (data.length === 0) {
- return context.replyText(i18n.__("message.donate.no_data"));
+ return context.quoteReply(i18n.__("message.donate.no_data"));
}
const rows = data.map(item => [item.user_id, item.amount]);
@@ -54,7 +54,7 @@ async function adminList(context) {
const message = table(rows, config);
- return context.replyText(message);
+ return context.quoteReply(message);
}
async function adminAdd(context) {
@@ -63,26 +63,26 @@ async function adminAdd(context) {
const mentionees = get(mention, "mentionees", []);
if (args.help || args.h) {
- return context.replyText(i18n.__("message.donate.add_usage"));
+ return context.quoteReply(i18n.__("message.donate.add_usage"));
}
if (mentionees.length === 0) {
- return context.replyText(i18n.__("message.donate.add_no_mention"));
+ return context.quoteReply(i18n.__("message.donate.add_no_mention"));
}
const userId = get(mentionees, "0.userId", null);
const amount = get(args, "_.2", null);
if (!userId || !amount) {
- return context.replyText(i18n.__("message.donate.add_usage"));
+ return context.quoteReply(i18n.__("message.donate.add_usage"));
}
try {
await DonateModel.create({ user_id: userId, amount });
} catch (e) {
DefaultLogger.error(e);
- return context.replyText(i18n.__("message.donate.add_fail"));
+ return context.quoteReply(i18n.__("message.donate.add_fail"));
}
- return context.replyText(i18n.__("message.donate.add_success", { amount }));
+ return context.quoteReply(i18n.__("message.donate.add_success", { amount }));
}
diff --git a/app/src/controller/application/GambleController.js b/app/src/controller/application/GambleController.js
index 09abf7a2..3de86181 100644
--- a/app/src/controller/application/GambleController.js
+++ b/app/src/controller/application/GambleController.js
@@ -34,7 +34,7 @@ exports.adminRouter = [
*/
async function adminNow(context) {
const game = await getHoldingGame();
- context.replyText(i18n.__("message.gamble.admin_now", game));
+ context.quoteReply(i18n.__("message.gamble.admin_now", game));
}
/**
@@ -47,7 +47,7 @@ async function adminAdd(context) {
const messageLines = [];
if (args.help || args.h) {
- await context.replyText(i18n.__("message.gamble.add_help"));
+ await context.quoteReply(i18n.__("message.gamble.add_help"));
return;
}
@@ -91,13 +91,13 @@ async function adminAdd(context) {
const valid = validate(data);
if (!valid) {
- await context.replyText(i18n.__("message.gamble.add_help"));
+ await context.quoteReply(i18n.__("message.gamble.add_help"));
DefaultLogger.error(validate.errors);
return;
}
if (!data.prize && !args.random && !args.r) {
- return await context.replyText(i18n.__("message.gamble.add_prize_required"));
+ return await context.quoteReply(i18n.__("message.gamble.add_prize_required"));
}
messageLines.push(i18n.__("message.gamble.add_name_analyze_success", { name: data.name }));
@@ -135,7 +135,7 @@ async function adminAdd(context) {
end_at: data.end,
});
- await context.replyText(messageLines.join("\n"));
+ await context.quoteReply(messageLines.join("\n"));
}
/**
@@ -147,7 +147,7 @@ async function result(context) {
const args = minimist(context.event.message.text.split(" "));
if (args.help || args.h) {
- await context.replyText(i18n.__("message.gamble.result_usage"));
+ await context.quoteReply(i18n.__("message.gamble.result_usage"));
return;
}
@@ -184,7 +184,7 @@ async function result(context) {
const valid = validate(data);
if (!valid) {
- await context.replyText(i18n.__("message.gamble.result_usage"));
+ await context.quoteReply(i18n.__("message.gamble.result_usage"));
DefaultLogger.error(validate.errors);
return;
}
@@ -192,7 +192,7 @@ async function result(context) {
const game = await GambleGameModel.find(data.id);
if (!game) {
- await context.replyText(i18n.__("message.gamble.no_game"));
+ await context.quoteReply(i18n.__("message.gamble.no_game"));
return;
}
@@ -225,10 +225,10 @@ async function result(context) {
});
purgeGame();
} else {
- context.replyText(i18n.__("message.gamble.simulate_result"));
+ context.quoteReply(i18n.__("message.gamble.simulate_result"));
}
- context.replyText(
+ context.quoteReply(
i18n.__("message.gamble.result", {
time: moment().format("YYYY-MM-DD HH:mm:ss"),
start: get(data, "start"),
@@ -237,7 +237,7 @@ async function result(context) {
})
);
- context.replyText(JSON.stringify(indexResult));
+ context.quoteReply(JSON.stringify(indexResult));
}
/**
@@ -248,7 +248,7 @@ async function show(context) {
const game = await getHoldingGame();
if (!game) {
- await context.replyText(i18n.__("message.gamble.no_game"));
+ await context.quoteReply(i18n.__("message.gamble.no_game"));
return;
}
@@ -289,7 +289,7 @@ async function bet(context, props) {
const { userId } = context.event.source;
if (!game) {
- await context.replyText(i18n.__("message.gamble.no_game"));
+ await context.quoteReply(i18n.__("message.gamble.no_game"));
return;
}
@@ -298,7 +298,7 @@ async function bet(context, props) {
const availableOptions = get(game, "options", []);
if (parseInt(option) > availableOptions.length || parseInt(option) === 0) {
- await context.replyText(i18n.__("message.gamble.invalid_option"));
+ await context.quoteReply(i18n.__("message.gamble.invalid_option"));
return;
}
@@ -307,12 +307,12 @@ async function bet(context, props) {
const ownStones = parseInt(get(sumResult, "amount", 0));
if (usedCoins <= 0) {
- await context.replyText(i18n.__("message.gamble.invalid_coins"));
+ await context.quoteReply(i18n.__("message.gamble.invalid_coins"));
return;
}
if (isNull(ownStones) || usedCoins > ownStones) {
- await context.replyText(i18n.__("message.gamble.not_enough_coins"));
+ await context.quoteReply(i18n.__("message.gamble.not_enough_coins"));
return;
}
@@ -335,13 +335,13 @@ async function bet(context, props) {
} catch (e) {
trx.rollback();
DefaultLogger.error(e);
- await context.replyText(i18n.__("message.gamble.bet_failed"));
+ await context.quoteReply(i18n.__("message.gamble.bet_failed"));
return;
}
trx.commit();
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.gamble.bet_success", {
displayName: context.event.source.displayName,
amount: usedCoins,
diff --git a/app/src/controller/application/GroupConfig.js b/app/src/controller/application/GroupConfig.js
index 48790c94..ba8a8bba 100644
--- a/app/src/controller/application/GroupConfig.js
+++ b/app/src/controller/application/GroupConfig.js
@@ -49,7 +49,7 @@ exports.setSender = async (
if (iconUrl !== undefined) sender.iconUrl = iconUrl;
if (context.event.source.type !== "group") {
- context.replyText("設定成功!\n注意:非群組用戶,自訂頭像非永久性!", { sender });
+ context.quoteReply("設定成功!\n注意:非群組用戶,自訂頭像非永久性!", { sender });
return;
}
@@ -61,10 +61,10 @@ exports.setSender = async (
await GroupConfigModel.setSender(context.event.source.groupId, { name, icon: iconUrl });
}
- context.replyText("設定成功!", { sender });
+ context.quoteReply("設定成功!", { sender });
} catch (e) {
if (e.name !== "GroupConfig") throw e;
- context.replyText(e.message);
+ context.quoteReply(e.message);
}
};
diff --git a/app/src/controller/application/GuildServiceController.js b/app/src/controller/application/GuildServiceController.js
index 6b06bd78..87ee99cc 100644
--- a/app/src/controller/application/GuildServiceController.js
+++ b/app/src/controller/application/GuildServiceController.js
@@ -16,7 +16,7 @@ async function guildService(context) {
const { groupId } = context.event.source;
const guildService = await GuildServiceModel.findByGroupId(groupId);
- context.replyText(JSON.stringify(guildService));
+ context.quoteReply(JSON.stringify(guildService));
}
/**
@@ -34,23 +34,23 @@ async function addService(context) {
const serviceName = _[1];
if (!serviceName) {
- context.replyText(i18n.__("message.service.add_usage"));
+ context.quoteReply(i18n.__("message.service.add_usage"));
return;
}
if (!groupId) {
- context.replyText(i18n.__("message.service.add_usage"));
+ context.quoteReply(i18n.__("message.service.add_usage"));
return;
}
const guildServices = await GuildServiceModel.findByGroupId(groupId);
if (guildServices.includes(serviceName)) {
- context.replyText(i18n.__("message.service.already_exists", { serviceName, groupId }));
+ context.quoteReply(i18n.__("message.service.already_exists", { serviceName, groupId }));
return;
}
const guild = await GuildModel.findByGroupId(groupId);
await GuildServiceModel.create({ guild_id: guild.ID, service: serviceName });
- context.replyText(i18n.__("message.service.add_success", { serviceName, groupId }));
+ context.quoteReply(i18n.__("message.service.add_success", { serviceName, groupId }));
}
diff --git a/app/src/controller/application/ImageController.js b/app/src/controller/application/ImageController.js
index d6d3dcc2..9a1a4e6d 100644
--- a/app/src/controller/application/ImageController.js
+++ b/app/src/controller/application/ImageController.js
@@ -16,7 +16,7 @@ async function handleUpload(context) {
const { quotedMessageId: id } = context.event.message;
if (!id) {
- return context.replyText(i18n.__("message.image.upload_without_quote"));
+ return context.quoteReply(i18n.__("message.image.upload_without_quote"));
}
try {
@@ -30,13 +30,13 @@ async function handleUpload(context) {
const url = get(result, "data.link");
if (!isImageUrl(url)) {
- return context.replyText(i18n.__("message.image.upload_failed"));
+ return context.quoteReply(i18n.__("message.image.upload_failed"));
}
const imageUpload = get(context.state, "imageUpload", []);
imageUpload.splice(imageUpload.indexOf(context.event.source.userId), 1);
- return context.replyText(
+ return context.quoteReply(
i18n.__("message.image.upload_success", {
id: get(result, "data.id"),
url,
@@ -44,6 +44,6 @@ async function handleUpload(context) {
);
} catch (e) {
console.log(e);
- return context.replyText(i18n.__("message.image.upload_failed"));
+ return context.quoteReply(i18n.__("message.image.upload_failed"));
}
}
diff --git a/app/src/controller/application/LotteryController.js b/app/src/controller/application/LotteryController.js
index f17df9a0..681ff8ab 100644
--- a/app/src/controller/application/LotteryController.js
+++ b/app/src/controller/application/LotteryController.js
@@ -28,7 +28,7 @@ async function boughtList(context) {
const lottery = await findLatestLottery();
if (!lottery) {
- await context.replyText(i18n.__("message.lottery.no_holding_event"));
+ await context.quoteReply(i18n.__("message.lottery.no_holding_event"));
return;
}
@@ -43,7 +43,7 @@ async function boughtList(context) {
});
if (orders.length === 0) {
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.lottery.no_bought_lottery", {
displayName,
})
@@ -78,7 +78,7 @@ async function boughtList(context) {
lotteryId,
});
console.log("超過15張");
- return await context.replyText(
+ return await context.quoteReply(
i18n.__("message.lottery.bought_probably_over_limit", { boughtCount })
);
}
@@ -99,7 +99,7 @@ async function lottery(context) {
console.log("isPublic", isPublic);
if (!lottery) {
- await context.replyText(i18n.__("message.lottery.no_holding_event"));
+ await context.quoteReply(i18n.__("message.lottery.no_holding_event"));
return;
}
@@ -148,13 +148,13 @@ async function autoBuy(context, props) {
const costMoney = count * config.get("lottery.price");
if (amount < costMoney) {
- await context.replyText(i18n.__("message.lottery.manual_buy.error_not_enough_money"));
+ await context.quoteReply(i18n.__("message.lottery.manual_buy.error_not_enough_money"));
return;
}
const latestLottery = await findLatestLottery();
if (!latestLottery || latestLottery.status !== lotteryModel.status.selling) {
- await context.replyText(i18n.__("message.lottery.manual_buy.error_no_lottery"));
+ await context.quoteReply(i18n.__("message.lottery.manual_buy.error_no_lottery"));
return;
}
@@ -194,11 +194,11 @@ async function autoBuy(context, props) {
message += i18n.__("message.lottery.auto_buy_notify");
}
- await context.replyText(message);
+ await context.quoteReply(message);
} catch (e) {
await trx.rollback();
console.error(e);
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.lottery.manual_buy.error", {
userId,
})
@@ -256,7 +256,7 @@ async function buy(context, props) {
// 個數檢查
if (isValidLength(numbers) === false) {
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.lottery.manual_buy.error_count", {
max_count: limitCount,
})
@@ -266,13 +266,13 @@ async function buy(context, props) {
// 重複檢查
if (isRepeat(numbers) === true) {
- await context.replyText(i18n.__("message.lottery.manual_buy.error_repeat_number"));
+ await context.quoteReply(i18n.__("message.lottery.manual_buy.error_repeat_number"));
return;
}
// 數字檢查
if (isAllValidNumber(numbers) === false) {
- await context.replyText(i18n.__("message.lottery.manual_buy.error_number_range"));
+ await context.quoteReply(i18n.__("message.lottery.manual_buy.error_number_range"));
return;
}
@@ -281,13 +281,13 @@ async function buy(context, props) {
const ownMoney = parseInt(amount);
if (ownMoney < price) {
- await context.replyText(i18n.__("message.lottery.manual_buy.error_not_enough_money"));
+ await context.quoteReply(i18n.__("message.lottery.manual_buy.error_not_enough_money"));
return;
}
const latestLottery = await findLatestLottery();
if (!latestLottery || latestLottery.status !== lotteryModel.status.selling) {
- await context.replyText(i18n.__("message.lottery.manual_buy.error_no_lottery"));
+ await context.quoteReply(i18n.__("message.lottery.manual_buy.error_no_lottery"));
return;
}
@@ -311,7 +311,7 @@ async function buy(context, props) {
await trx.commit();
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.lottery.manual_buy.success", {
displayName,
numbers: numbers.join(","),
@@ -320,7 +320,7 @@ async function buy(context, props) {
} catch (e) {
await trx.rollback();
console.error(e);
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.lottery.manual_buy.error", {
userId,
})
diff --git a/app/src/controller/application/MarketController.js b/app/src/controller/application/MarketController.js
index c3386f20..71ddb656 100644
--- a/app/src/controller/application/MarketController.js
+++ b/app/src/controller/application/MarketController.js
@@ -36,7 +36,7 @@ async function trade(context) {
const mentionees = get(mention, "mentionees", []);
if (mentionees.length === 0) {
- return context.replyText(i18n.__("message.trade.no_mention"));
+ return context.quoteReply(i18n.__("message.trade.no_mention"));
}
const targetUserId = get(mentionees, "[0].userId");
@@ -45,7 +45,7 @@ async function trade(context) {
const { displayName } = await getProfile(context, targetUserId);
- context.replyText(i18n.__("message.trade.apply", { displayName }));
+ context.quoteReply(i18n.__("message.trade.apply", { displayName }));
await context.replyFlex("交易申請", bubble);
}
@@ -71,16 +71,16 @@ async function transferMoney(context) {
const param = removeOrder(trimText);
if (mentionees.length !== 1) {
- return context.replyText(i18n.__("message.trade.mention_invalid"));
+ return context.quoteReply(i18n.__("message.trade.mention_invalid"));
}
const targetId = get(mentionees, "0.userId");
if (param.length === 0 || !isMoneyParam(param)) {
- return context.replyText(i18n.__("message.trade.transfer_money_invalid"));
+ return context.quoteReply(i18n.__("message.trade.transfer_money_invalid"));
}
if (!isLineUserId(targetId)) {
- return context.replyText(i18n.__("message.trade.mention_invalid"));
+ return context.quoteReply(i18n.__("message.trade.mention_invalid"));
}
const { amount } = await inventoryModel.getUserMoney(userId);
@@ -88,7 +88,7 @@ async function transferMoney(context) {
const transferMoney = parseInt(param);
if (transferMoney > ownMoney) {
- return context.replyText(i18n.__("message.trade.transfer_money_not_enough"));
+ return context.quoteReply(i18n.__("message.trade.transfer_money_not_enough"));
}
const targetUserName = getMentionName(rawText, get(mentionees, "0"));
@@ -109,7 +109,7 @@ async function transferMoney(context) {
transferId,
targetName: targetUserName,
});
- context.replyText(
+ context.quoteReply(
i18n.__("message.trade.transfer_money_established", {
time: config.get("trade.transfer_countdown") + "秒",
displayName,
@@ -138,7 +138,7 @@ function doFastTransfer(context) {
const trimText = trimMentionees(rawText, mentionees);
if (mentionees.length !== 1) {
- return context.replyText(i18n.__("message.trade.mention_invalid"));
+ return context.quoteReply(i18n.__("message.trade.mention_invalid"));
}
const targetId = get(mentionees, "0.userId");
@@ -146,11 +146,11 @@ function doFastTransfer(context) {
const param = removeOrder(trimText);
if (param.length === 0 || !isMoneyParam(param)) {
- return context.replyText(i18n.__("message.trade.transfer_money_invalid"));
+ return context.quoteReply(i18n.__("message.trade.transfer_money_invalid"));
}
if (!isLineUserId(targetId)) {
- return context.replyText(i18n.__("message.trade.mention_invalid"));
+ return context.quoteReply(i18n.__("message.trade.mention_invalid"));
}
const transferMoney = parseInt(param);
@@ -197,7 +197,7 @@ const doTransfer = async (context, { payload }) => {
if (amount > parseInt(ownMoney)) {
// 餘額不足,刪除此次轉帳交易
removeTransfer(transferId);
- return context.replyText(i18n.__("message.trade.transfer_money_not_enough"));
+ return context.quoteReply(i18n.__("message.trade.transfer_money_not_enough"));
}
const result = await inventoryModel.transferGodStone({
@@ -207,11 +207,11 @@ const doTransfer = async (context, { payload }) => {
});
if (!result) {
- return context.replyText(i18n.__("message.trade.transfer_money_failed"));
+ return context.quoteReply(i18n.__("message.trade.transfer_money_failed"));
}
removeTransfer(transferId);
- context.replyText(
+ context.quoteReply(
i18n.__("message.trade.transfer_money_success", {
displayName,
targetDisplayName: targetName,
diff --git a/app/src/controller/application/OpenaiController.js b/app/src/controller/application/OpenaiController.js
index 00951ac0..4a4c7117 100644
--- a/app/src/controller/application/OpenaiController.js
+++ b/app/src/controller/application/OpenaiController.js
@@ -50,7 +50,7 @@ exports.naturalLanguageUnderstanding = async function (context, { next }) {
// 檢查是否可以使用 AI 功能, 這是避免被濫用
const isAbleToUse = await isAbleToUseAIFeature();
if (!isAbleToUse) {
- await context.replyText("窩太累了,等等再問我吧( ˘•ω•˘ )◞");
+ await context.quoteReply("窩太累了,等等再問我吧( ˘•ω•˘ )◞");
return;
}
@@ -68,7 +68,7 @@ exports.naturalLanguageUnderstanding = async function (context, { next }) {
const { finish_reason } = get(result, "0", {});
result = finish_reason === "stop" ? result[0].text.trim() : "窩不知道( ˘•ω•˘ )◞";
await recordSession(sourceId, `小助理:${result}`);
- await context.replyText(result);
+ await context.quoteReply(result);
};
/**
diff --git a/app/src/controller/application/ScratchCardController.js b/app/src/controller/application/ScratchCardController.js
index 7c2b1549..a95c0522 100644
--- a/app/src/controller/application/ScratchCardController.js
+++ b/app/src/controller/application/ScratchCardController.js
@@ -47,7 +47,7 @@ async function showUnused(context) {
const cards = await ScratchCard.fetchMyUnusedCards(userId);
if (cards.length === 0) {
- return await context.replyText("窩沒有刮刮卡了", { sender });
+ return await context.quoteReply("窩沒有刮刮卡了", { sender });
}
const group = groupBy(cards, ({ reward, name }) => `${reward},${name}`);
@@ -75,21 +75,21 @@ async function buy(context, props) {
const { name, count = 1 } = props.match.groups;
const card = await ScratchCard.fetchByName(name);
if (!card) {
- return await context.replyText("沒有這張刮刮卡");
+ return await context.quoteReply("沒有這張刮刮卡");
}
const { amount: ownCostGodStone } = await Inventory.getUserMoney(userId);
const exceptCostGodStone = card.price * count;
if (exceptCostGodStone > ownCostGodStone) {
- return await context.replyText("窩的錢錢不夠QQ", { sender });
+ return await context.quoteReply("窩的錢錢不夠QQ", { sender });
}
const unusedCard = await ScratchCard.fetchRandomCards(card.id, count);
const cardIds = unusedCard.map(c => c.id);
if (cardIds.length === 0) {
- return await context.replyText("購買失敗,刮刮卡庫存不足");
+ return await context.quoteReply("購買失敗,刮刮卡庫存不足");
}
const trx = await ScratchCard.transaction();
@@ -124,10 +124,10 @@ async function buy(context, props) {
} catch (error) {
await trx.rollback();
console.log(error);
- return await context.replyText("購買失敗", { sender });
+ return await context.quoteReply("購買失敗", { sender });
}
- await context.replyText("購買成功", { sender });
+ await context.quoteReply("購買成功", { sender });
}
exports.exchange = exchange;
@@ -147,7 +147,7 @@ async function exchange(context, { payload }) {
const cards = await ScratchCard.fetchMyUnusedCards(userId);
if (cards.length === 0) {
- return await context.replyText("窩沒有刮刮卡了", { sender });
+ return await context.quoteReply("窩沒有刮刮卡了", { sender });
}
// 計算總共可以兌換多少女神石
@@ -175,7 +175,7 @@ async function exchange(context, { payload }) {
throw e;
}
- await context.replyText(`YA~我獲得了 ${totalGodStone} 個女神石`, { sender });
+ await context.quoteReply(`YA~我獲得了 ${totalGodStone} 個女神石`, { sender });
}
exports.api.list = async (req, res) => {
diff --git a/app/src/controller/application/StatusController.js b/app/src/controller/application/StatusController.js
index 062727d4..049a867b 100644
--- a/app/src/controller/application/StatusController.js
+++ b/app/src/controller/application/StatusController.js
@@ -15,7 +15,7 @@ async function godStone(context) {
const { userId } = context.event.source;
const { amount = 0 } = await inventoryModel.getUserMoney(userId);
- context.replyText(i18n.__("message.user_own_god_stone", { god_stone: amount }));
+ context.quoteReply(i18n.__("message.user_own_god_stone", { god_stone: amount }));
}
/**
@@ -26,7 +26,7 @@ async function ownCharacter(context) {
const { userId } = context.event.source;
const result = await inventoryModel.getAllUserOwn(userId);
- context.replyText(
+ context.quoteReply(
i18n.__("message.user_own_character_count", { character_count: result.length })
);
}
diff --git a/app/src/controller/application/SubscribeController.js b/app/src/controller/application/SubscribeController.js
index 1933c81e..0abe8dc4 100644
--- a/app/src/controller/application/SubscribeController.js
+++ b/app/src/controller/application/SubscribeController.js
@@ -13,7 +13,7 @@ const { generateCard, generateEffect } = require("../../templates/application/Su
exports.router = [
text(/^[.#/](訂閱|sub)$/, showInformation),
text(/^[.#/](訂閱兌換|sub-coupon)$/, context =>
- context.replyText(i18n.__("message.subscribe.coupon_exchange_manual"))
+ context.quoteReply(i18n.__("message.subscribe.coupon_exchange_manual"))
),
text(/^[.#/](訂閱兌換|sub-coupon)\s(?[\w-]{36})$/, subscribeCouponExchange),
];
@@ -67,7 +67,7 @@ async function subscribeCouponExchange(context, props) {
}
if (get(coupon, "status") === SubscribeCardCoupon.status.used) {
- await context.replyText(i18n.__("message.subscribe.serial_number_used"));
+ await context.quoteReply(i18n.__("message.subscribe.serial_number_used"));
return;
}
@@ -78,7 +78,7 @@ async function subscribeCouponExchange(context, props) {
});
if (!card) {
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.error_contact_admin", {
user_id: userId,
error_key: "subscribe_card_not_found",
@@ -133,7 +133,7 @@ async function subscribeCouponExchange(context, props) {
trx.commit();
} catch (e) {
trx.rollback();
- await context.replyText(
+ await context.quoteReply(
i18n.__("message.error_contact_admin", {
user_id: userId,
error_key: "subscribe_coupon_exchange",
@@ -171,7 +171,7 @@ async function subscribeCouponExchange(context, props) {
)
);
- await context.replyText(messages.join("\n"));
+ await context.quoteReply(messages.join("\n"));
!isContinue && (await DailyRation());
}
diff --git a/app/src/controller/application/VoteController.js b/app/src/controller/application/VoteController.js
index 7c626cb3..1d7e1ed7 100644
--- a/app/src/controller/application/VoteController.js
+++ b/app/src/controller/application/VoteController.js
@@ -25,17 +25,17 @@ async function commandShowVote(context) {
const args = minimist(context.event.message.text.split(" "));
if (args.h || args.help) {
- return context.replyText(i18n.__("message.vote.help"));
+ return context.quoteReply(i18n.__("message.vote.help"));
}
const ids = get(args, "ids", "").split(",");
if (ids.length === 0) {
- return context.replyText(i18n.__("message.vote.help"));
+ return context.quoteReply(i18n.__("message.vote.help"));
}
const votes = await VoteModel.getAllById(ids);
if (votes.length === 0) {
- return context.replyText(i18n.__("message.vote.notFound"));
+ return context.quoteReply(i18n.__("message.vote.notFound"));
}
const voteList = votes.map(vote => VoteTemplate.generateVote(vote));
@@ -57,13 +57,13 @@ async function show(context, props) {
const vote = await VoteModel.find(voteId);
if (!vote) {
- return context.replyText(i18n.__("message.vote.notFound"));
+ return context.quoteReply(i18n.__("message.vote.notFound"));
}
// 檢查是否在舉辦時間內
const isHolding = await getIsHolding(voteId);
if (!isHolding) {
- return context.replyText(i18n.__("message.vote.notHolding"));
+ return context.quoteReply(i18n.__("message.vote.notHolding"));
}
context.replyFlex(vote.title, VoteTemplate.generateVote(vote));
@@ -92,7 +92,7 @@ exports.decide = async (context, { payload }) => {
},
});
- return context.replyText(i18n.__("message.vote.notHolding"));
+ return context.quoteReply(i18n.__("message.vote.notHolding"));
}
try {
@@ -116,7 +116,7 @@ exports.decide = async (context, { payload }) => {
});
if (context.event.source.type === "user") {
- context.replyText(
+ context.quoteReply(
i18n.__("message.vote.decided", {
title: vote.title,
displayName,
diff --git a/app/src/controller/application/WorldBossController.js b/app/src/controller/application/WorldBossController.js
index 6d68e342..2ce6f897 100644
--- a/app/src/controller/application/WorldBossController.js
+++ b/app/src/controller/application/WorldBossController.js
@@ -53,12 +53,12 @@ async function attack(context, { attackType = "normal" }) {
});
if (!isSet) {
- context.replyText(i18n.__("message.world_boss.request_too_quickly"));
+ context.quoteReply(i18n.__("message.world_boss.request_too_quickly"));
return;
}
if (!eventId) {
- context.replyText(i18n.__("message.world_boss_event_no_ongoing"));
+ context.quoteReply(i18n.__("message.world_boss_event_no_ongoing"));
}
return await attackOnBoss(context, {
@@ -149,10 +149,10 @@ async function worldRank(context) {
// 多起世界事件正在舉行中
if (events.length > 1) {
- context.replyText(i18n.__("message.world_boss_event_multiple_ongoing"));
+ context.quoteReply(i18n.__("message.world_boss_event_multiple_ongoing"));
return;
} else if (events.length === 0) {
- context.replyText(i18n.__("message.world_boss_event_no_ongoing"));
+ context.quoteReply(i18n.__("message.world_boss_event_no_ongoing"));
return;
}
@@ -167,7 +167,7 @@ async function worldRank(context) {
})
);
- context.replyText(JSON.stringify(topTenData));
+ context.quoteReply(JSON.stringify(topTenData));
}
/**
@@ -189,10 +189,10 @@ async function adminAttack(context, props) {
// 多起世界事件正在舉行中
if (events.length > 1) {
- context.replyText(i18n.__("message.world_boss_event_multiple_ongoing"));
+ context.quoteReply(i18n.__("message.world_boss_event_multiple_ongoing"));
return;
} else if (events.length === 0) {
- context.replyText(i18n.__("message.world_boss_event_no_ongoing"));
+ context.quoteReply(i18n.__("message.world_boss_event_no_ongoing"));
return;
}
@@ -205,7 +205,7 @@ async function adminAttack(context, props) {
// 如果已經完成,則不能攻擊
if (hasCompleted) {
- context.replyText(i18n.__("message.world_boss_event_completed"));
+ context.quoteReply(i18n.__("message.world_boss_event_completed"));
return;
}
@@ -218,7 +218,7 @@ async function adminAttack(context, props) {
};
await worldBossEventLogService.create(attributes);
- context.replyText(i18n.__("message.admin_attack_on_world_boss", { damage }));
+ context.quoteReply(i18n.__("message.admin_attack_on_world_boss", { damage }));
}
/**
@@ -231,7 +231,7 @@ async function all(context) {
["end_time", ">", new Date()],
],
});
- context.replyText(JSON.stringify(data));
+ context.quoteReply(JSON.stringify(data));
}
/**
@@ -239,7 +239,7 @@ async function all(context) {
*/
async function bosslist(context) {
const data = await worldBossModel.all();
- context.replyText(JSON.stringify(data));
+ context.quoteReply(JSON.stringify(data));
}
/**
@@ -251,10 +251,10 @@ async function bossEvent(context) {
// 多起世界事件正在舉行中
if (events.length > 1) {
- context.replyText(i18n.__("message.world_boss_event_multiple_ongoing"));
+ context.quoteReply(i18n.__("message.world_boss_event_multiple_ongoing"));
return;
} else if (events.length === 0) {
- context.replyText(i18n.__("message.world_boss_event_no_ongoing"));
+ context.quoteReply(i18n.__("message.world_boss_event_no_ongoing"));
return;
}
@@ -360,7 +360,7 @@ exports.adminSpecialAttack = async (context, { payload }) => {
};
await worldBossEventLogService.create(attributes);
- context.replyText(`造成了 ${causeDamage} 傷害`, {
+ context.quoteReply(`造成了 ${causeDamage} 傷害`, {
sender: {
name: "エリス",
iconUrl:
@@ -396,7 +396,7 @@ const attackOnBoss = async (context, props) => {
);
if (context.event.isText) {
- context.replyText(
+ context.quoteReply(
i18n.__("message.world_boss.can_not_attack", {
name: displayName,
})
@@ -440,7 +440,7 @@ const attackOnBoss = async (context, props) => {
DefaultLogger.info(`no level data ${userId}. Create One.`);
await minigameService.createByUserId(userId, minigameService.defaultData);
levelData = minigameService.defaultData;
- !keepMessage && context.replyText(i18n.__("message.minigame_level_not_found"));
+ !keepMessage && context.quoteReply(i18n.__("message.minigame_level_not_found"));
}
if (["money", "moneyChaos"].includes(attackType)) {
@@ -458,7 +458,7 @@ const attackOnBoss = async (context, props) => {
if (hasFreeQuota === false && userOwnMoney < needMoney) {
if (context.event.isText) {
const message = sample(i18n.__("message.world_boss.money_attack_not_enough"));
- context.replyText(message, {
+ context.quoteReply(message, {
sender: {
iconUrl: pictureUrl,
name: displayName,
@@ -470,7 +470,7 @@ const attackOnBoss = async (context, props) => {
if (hasFreeQuota) {
DefaultLogger.info(`today attack ${todayLogs.length} times, skip money cost`);
- context.replyText(i18n.__("message.world_boss.money_attack_free"));
+ context.quoteReply(i18n.__("message.world_boss.money_attack_free"));
} else {
await Inventory.decreaseGodStone({
userId,
@@ -512,7 +512,7 @@ const attackOnBoss = async (context, props) => {
});
if (newLevelData.levelUp && !keepMessage) {
- context.replyText(
+ context.quoteReply(
i18n.__("message.minigame_level_up", { level: newLevelData.newLevel, displayName })
);
}
@@ -547,7 +547,7 @@ const attackOnBoss = async (context, props) => {
if (keepMessage) {
await handleKeepingMessage(worldBossEventId, context, messages.join("\n"));
} else {
- context.replyText(messages.join("\n"), { sender });
+ context.quoteReply(messages.join("\n"), { sender });
}
};
@@ -597,7 +597,7 @@ async function handleKeepingMessage(worldBossEventId, context, keepMessage) {
if (messages.length > 0) {
const message = messages.join("\n");
- context.replyText(`這是目前累積至今的訊息,下一次會在 5 分鐘後發送:\n${message}`);
+ context.quoteReply(`這是目前累積至今的訊息,下一次會在 5 分鐘後發送:\n${message}`);
context.setState({
worldBoss: {
lastSendTs: new Date().getTime(),
diff --git a/app/src/controller/lineEvent.js b/app/src/controller/lineEvent.js
index b0b76ee0..9d6b6b34 100644
--- a/app/src/controller/lineEvent.js
+++ b/app/src/controller/lineEvent.js
@@ -30,7 +30,7 @@ async function HandleMemberJoined(context) {
const { displayName } = await LineClient.getGroupMemberProfile(groupId, userId);
const { groupName } = await lineAPI.getGroupSummary(groupId);
- context.replyText(
+ context.quoteReply(
assemble(
{
username: displayName,
@@ -46,7 +46,7 @@ function HandleMemberLeft() {
}
function HandleFollow(context) {
- context.replyText(`感謝加我好友,先為您提供以下功能`);
+ context.quoteReply(`感謝加我好友,先為您提供以下功能`);
welcome(context);
}
@@ -56,18 +56,18 @@ async function HandleJoin(context) {
return;
}
- context.replyText("感謝邀請我至群組,群組初始化開始...");
+ context.quoteReply("感謝邀請我至群組,群組初始化開始...");
const [summary, countData] = await Promise.all([
lineAPI.getGroupSummary(context.event.source.groupId),
lineAPI.getGroupCount(context.event.source.groupId),
]);
- context.replyText(
+ context.quoteReply(
`已設置好群組資訊:\n群組名稱:${summary.groupName}\n群組人數:${countData.count}`
);
- context.replyText("如需觀看使用說明,請輸入:#使用說明");
+ context.quoteReply("如需觀看使用說明,請輸入:#使用說明");
}
function HandleUnfollow(context) {
diff --git a/app/src/controller/princess/ArenaController.js b/app/src/controller/princess/ArenaController.js
index de64d20e..10db06d6 100644
--- a/app/src/controller/princess/ArenaController.js
+++ b/app/src/controller/princess/ArenaController.js
@@ -57,14 +57,14 @@ function personalRouter() {
function setPersonalAllowUpload(context) {
context.setState({ arena: { arenaUpload: true } });
- context.replyText("請上傳競技場戰鬥紀錄,全部上傳完畢後請輸入\n#競技場上傳完畢", {
+ context.quoteReply("請上傳競技場戰鬥紀錄,全部上傳完畢後請輸入\n#競技場上傳完畢", {
quickReply: quickReplyUpload,
});
}
function setArenaSearch(context) {
context.setState({ arena: { arenaSearch: true } });
- context.replyText("請上傳要查詢的隊伍", {
+ context.quoteReply("請上傳要查詢的隊伍", {
quickReply: quickReplyUpload,
});
}
@@ -73,7 +73,7 @@ function resetArenaState(context) {
let arenaState = context.state.arena || {};
if (Object.keys(arenaState).length !== 0) {
context.setState({ arena: {} });
- context.replyText("感謝使用競技場功能~~");
+ context.quoteReply("感謝使用競技場功能~~");
}
}
@@ -116,7 +116,7 @@ function receivePersonalImage(context) {
arena: { ...arenaState, storeId },
});
- context.replyText(
+ context.quoteReply(
"請問此圖左邊隊伍為\n1:進攻方 or 2:防守方\n輸入數字回答,手機用戶可直接點選快速回覆鈕",
{ quickReply: quickReplyAskWhich }
);
@@ -137,7 +137,7 @@ async function personalUpload(context) {
context.setState({
arena: { ...arenaState },
});
- return context.replyText("超過60秒沒回應,請重新進行操作");
+ return context.quoteReply("超過60秒沒回應,請重新進行操作");
}
let imageBase = await getImageBase(imageId);
@@ -151,7 +151,7 @@ async function personalUpload(context) {
ArenaTemplate.showUploadInfo(context, resp);
ArenaTemplate.askContinue(context);
} else {
- context.replyText("你已經上傳過此紀錄");
+ context.quoteReply("你已經上傳過此紀錄");
}
}
@@ -160,7 +160,7 @@ async function arenaSearch(context) {
let resp = await OpencvModel.getArenaSearchTeam(imageBase);
if (resp === false) {
- return context.replyText("分析失敗,已將圖片轉發給作者");
+ return context.quoteReply("分析失敗,已將圖片轉發給作者");
}
let searchTeam = RecordRepo.genTeamImages(resp.map(data => ({ unitId: data.unit_id, ...data })));
diff --git a/app/src/controller/princess/BattleReportController.js b/app/src/controller/princess/BattleReportController.js
index ad929a1e..3117968c 100644
--- a/app/src/controller/princess/BattleReportController.js
+++ b/app/src/controller/princess/BattleReportController.js
@@ -52,20 +52,20 @@ exports.reportDamage = async (context, params) => {
}
}
- if (!formId) return context.replyText("取報名表異常,請通知作者");
+ if (!formId) return context.quoteReply("取報名表異常,請通知作者");
let ianUserData = await BattleModel.getIanUserData("2", userId);
let { ianUserId } = ianUserData[0];
let records = await BattleModel.Ian.getUserFormRecords(formId, ianUserId);
if (records.length === 0) {
- context.replyText("尚未在戰隊群組內部報名過!因此找無任何紀錄!");
+ context.quoteReply("尚未在戰隊群組內部報名過!因此找無任何紀錄!");
return;
}
context.setState({ ianUserId });
- context.replyText("請選擇要回報的紀錄");
+ context.quoteReply("請選擇要回報的紀錄");
BattleTemplate.showReportList(
context,
records.map(record => ({
@@ -79,7 +79,7 @@ exports.reportDamage = async (context, params) => {
exports.setAllowReport = (context, params) => {
let { recordId, week, boss } = params.match.groups;
context.setState({ report: { recordId, week, boss } });
- context.replyText(`請上傳 ${week}周 ${boss}王\n戰隊傷害報告圖片`);
+ context.quoteReply(`請上傳 ${week}周 ${boss}王\n戰隊傷害報告圖片`);
};
exports.personalReport = async context => {
@@ -94,7 +94,7 @@ exports.personalReport = async context => {
message: `圖片分析系統分析失敗,訊息ID:${imageId}`,
token: process.env.LINE_NOTIFY_TOKEN,
});
- return context.replyText(
+ return context.quoteReply(
"圖片分析失敗,請確認!\n歡迎至Discord回報 https://discord.gg/Fy82rTb"
);
}
@@ -126,7 +126,7 @@ exports.personalReport = async context => {
await BattleModel.Ian.setRecord(formId, week, boss, ianUserId, option);
let flexMessage = BattleTemplate.genReportInformation({ totalDamage, team });
- context.replyText(`已將 ${week}周 ${boss}王\n傷害紀錄上傳`);
+ context.quoteReply(`已將 ${week}周 ${boss}王\n傷害紀錄上傳`);
context.replyFlex("隊伍詳細資訊", flexMessage);
// 清除state 避免重複收到圖片
diff --git a/app/src/controller/princess/GodStoneShop/router.js b/app/src/controller/princess/GodStoneShop/router.js
index 0f5eee8d..d420e91a 100644
--- a/app/src/controller/princess/GodStoneShop/router.js
+++ b/app/src/controller/princess/GodStoneShop/router.js
@@ -27,7 +27,7 @@ async function showStoneShop(context) {
.filter(item => item);
if (viewData.length === 0) {
- return context.replyText(i18n.__("message.god_stone_shop_empty"));
+ return context.quoteReply(i18n.__("message.god_stone_shop_empty"));
}
const bubbles = viewData.map(item => GodStoneShopTemplate.genShopItem(item));
diff --git a/app/src/controller/princess/battle.js b/app/src/controller/princess/battle.js
index f370c32d..b1cc64a0 100644
--- a/app/src/controller/princess/battle.js
+++ b/app/src/controller/princess/battle.js
@@ -60,7 +60,7 @@ exports.BattleList = async (context, props) => {
}
} catch (e) {
if (e.name === "GuildBattle") {
- context.replyText(e.message);
+ context.quoteReply(e.message);
} else throw e; // keep throw
}
};
@@ -204,7 +204,7 @@ exports.BattleSignUp = async (context, props) => {
stage: getStageByWeek(parseInt(week)),
});
} catch (e) {
- return context.replyText("報名失敗,請稍後再試");
+ return context.quoteReply("報名失敗,請稍後再試");
}
};
@@ -279,11 +279,11 @@ exports.BattleCancel = async (context, props) => {
name: context.state.userDatas[context.event.source.userId].displayName,
iconUrl: context.state.userDatas[context.event.source.userId].pictureUrl,
};
- context.replyText(`我取消了${week}周${boss}王`, { sender });
+ context.quoteReply(`我取消了${week}周${boss}王`, { sender });
} else throw setResult.detail;
} catch (e) {
if (e.name === "GuildBattle") {
- context.replyText(e.message);
+ context.quoteReply(e.message);
} else throw e; // keep throw
}
};
@@ -331,7 +331,7 @@ exports.CurrentBattle = async context => {
this.BattleList(context, { match: { groups: { week: currWeek } } });
} catch (e) {
if (e.name === "GuildBattle") {
- context.replyText(e.message);
+ context.quoteReply(e.message);
} else throw e; // keep throw
}
};
@@ -350,7 +350,7 @@ exports.SetWeek = async (context, props) => {
await WeekModel.setWeek(groupId, getNowMonth(), parseInt(week));
- context.replyText(`已將周次設定為${week}`, {
+ context.quoteReply(`已將周次設定為${week}`, {
sender: {
name: "戰隊秘書",
iconUrl: "https://i.imgur.com/NuZZR7Q.jpg",
@@ -358,7 +358,7 @@ exports.SetWeek = async (context, props) => {
});
} catch (e) {
if (e.name === "GuildBattle") {
- context.replyText(e.message);
+ context.quoteReply(e.message);
} else throw e; // keep throw
}
};
@@ -379,7 +379,7 @@ exports.NextBattleList = context => {
);
} catch (e) {
if (e.name === "GuildBattle") {
- context.replyText(e.message);
+ context.quoteReply(e.message);
} else throw e; // keep throw
}
};
@@ -403,7 +403,7 @@ exports.PreBattleList = context => {
);
} catch (e) {
if (e.name === "GuildBattle") {
- context.replyText(e.message);
+ context.quoteReply(e.message);
} else throw e; // keep throw
}
};
@@ -486,7 +486,7 @@ exports.reportFinish = context => {
let userName = context.state.userDatas[userId].displayName || "路人甲";
BattleModel.setFinishBattle(groupId, userId).then(() =>
- context.replyText(`恭喜${userName}今日已成為成功人士(出完三刀)!`, { sender: BattleSender })
+ context.quoteReply(`恭喜${userName}今日已成為成功人士(出完三刀)!`, { sender: BattleSender })
);
};
@@ -498,7 +498,7 @@ exports.reportReset = async context => {
const { groupId, userId } = context.event.source;
await BattleModel.resetFinishBattle(groupId, userId);
- context.replyText("吶吶,那你剛剛回報是不是騙我,嘖!\n幫你清除了啦!", { sender: BattleSender });
+ context.quoteReply("吶吶,那你剛剛回報是不是騙我,嘖!\n幫你清除了啦!", { sender: BattleSender });
};
/**
@@ -516,24 +516,24 @@ exports.showSigninList = async (context, { match }) => {
let FinishDatas = await BattleModel.getFinishList(groupId, objDate);
if (FinishDatas.length > 50) {
- context.replyText("此指令不適用於非戰隊群組(人數超過50人)", { sender: BattleSender });
+ context.quoteReply("此指令不適用於非戰隊群組(人數超過50人)", { sender: BattleSender });
return;
}
if (FinishDatas.find(data => data.isSignin) === undefined) {
- context.replyText(`${date}號查無任何出刀紀錄!`, { sender: BattleSender });
+ context.quoteReply(`${date}號查無任何出刀紀錄!`, { sender: BattleSender });
return;
}
if (FinishDatas.filter(data => data.isSignin).length === FinishDatas.length) {
- context.replyText(`${date}號全群皆已完成出刀!`, { sender: BattleSender });
+ context.quoteReply(`${date}號全群皆已完成出刀!`, { sender: BattleSender });
return;
}
let sentKey = `FinishList_${groupId}`;
if ((await redis.get(sentKey)) !== null) {
- context.replyText("此指令限制30秒呼叫一次", { sender: BattleSender });
+ context.quoteReply("此指令限制30秒呼叫一次", { sender: BattleSender });
return;
}
diff --git a/app/src/controller/princess/character.js b/app/src/controller/princess/character.js
index 05d4ad80..b14732ef 100644
--- a/app/src/controller/princess/character.js
+++ b/app/src/controller/princess/character.js
@@ -234,7 +234,7 @@ module.exports = {
const desc = sample(comments.map(c => c.description));
- context.replyText(desc.replace(/\\n/g, "\n"), {
+ context.quoteReply(desc.replace(/\\n/g, "\n"), {
sender: {
name: data.Name,
iconUrl: data.HeadImage,
diff --git a/app/src/controller/princess/gacha.js b/app/src/controller/princess/gacha.js
index 04bcf816..7462ba45 100644
--- a/app/src/controller/princess/gacha.js
+++ b/app/src/controller/princess/gacha.js
@@ -239,9 +239,9 @@ async function gacha(context, { match, pickup, ensure = false }) {
// 檢查是否有足夠的女神石
if (pickup && userOwnStone < pickupCost) {
- return context.replyText(i18n.__("message.gacha.not_enough_stone"));
+ return context.quoteReply(i18n.__("message.gacha.not_enough_stone"));
} else if (ensure && userOwnStone < ensureCost) {
- return context.replyText(i18n.__("message.gacha.not_enough_stone"));
+ return context.quoteReply(i18n.__("message.gacha.not_enough_stone"));
}
const queries = [];
@@ -373,7 +373,7 @@ async function gacha(context, { match, pickup, ensure = false }) {
} catch (err) {
await trx.rollback();
console.log(err);
- return context.replyText(
+ return context.quoteReply(
i18n.__("message.error_contact_admin", {
user_id: userId,
error_key: "gacha_daily: transaction error when insert data",
diff --git a/app/src/templates/application/ChatLevel.js b/app/src/templates/application/ChatLevel.js
index 8b8db749..650d20d7 100644
--- a/app/src/templates/application/ChatLevel.js
+++ b/app/src/templates/application/ChatLevel.js
@@ -154,10 +154,10 @@ exports.showTopRank = (context, { rankData, sendType }) => {
let message = sendType === "text" ? genTextTopRank(rankData) : genTextTopRank(rankData);
if (sendType === "text") {
- context.replyText(message);
+ context.quoteReply(message);
}
- context.replyText("為減少伺服器負擔,此訊息一分鐘只能查一次!");
+ context.quoteReply("為減少伺服器負擔,此訊息一分鐘只能查一次!");
};
/**
diff --git a/app/src/templates/application/CustomerOrder/line.js b/app/src/templates/application/CustomerOrder/line.js
index ed1b37cb..e1fb6683 100644
--- a/app/src/templates/application/CustomerOrder/line.js
+++ b/app/src/templates/application/CustomerOrder/line.js
@@ -216,7 +216,7 @@ exports.showInsertManual = context => {
},
});
} else if (context.event.source.type !== "user") {
- context.replyText("剛剛才發送此訊息,我才不想洗版..");
+ context.quoteReply("剛剛才發送此訊息,我才不想洗版..");
}
};
@@ -246,7 +246,7 @@ exports.showDeleteManual = context => {
},
});
} else if (context.event.source.type !== "user") {
- context.replyText("剛剛才發送此訊息,我才不想洗版..");
+ context.quoteReply("剛剛才發送此訊息,我才不想洗版..");
}
};
diff --git a/app/src/templates/application/CustomerOrder/telegram.js b/app/src/templates/application/CustomerOrder/telegram.js
index 074aacb3..6fe7566a 100644
--- a/app/src/templates/application/CustomerOrder/telegram.js
+++ b/app/src/templates/application/CustomerOrder/telegram.js
@@ -1,11 +1,11 @@
exports.showInsertManual = context => {
- context.replyText(
+ context.quoteReply(
"使用方式:.新增指令 指令 回覆\n特殊回覆關鍵字:{princess} {user} {1,100} [1,2,3]"
);
};
exports.showDeleteManual = context => {
- context.replyText("使用方式:.移除指令 指令 指令金鑰");
+ context.quoteReply("使用方式:.移除指令 指令 指令金鑰");
};
exports.showDeleteOption = (context, deleteOrders) => {
@@ -13,5 +13,5 @@ exports.showDeleteOption = (context, deleteOrders) => {
.map(data => data.orderKey)
.filter((key, index, selfAry) => selfAry.indexOf(key) === index);
- context.replyText(`請問要刪除哪一筆?\n${uniqKeys.join("\n")}`);
+ context.quoteReply(`請問要刪除哪一筆?\n${uniqKeys.join("\n")}`);
};
diff --git a/app/src/templates/application/Group/line.js b/app/src/templates/application/Group/line.js
index c8190a5e..cf2ca55f 100644
--- a/app/src/templates/application/Group/line.js
+++ b/app/src/templates/application/Group/line.js
@@ -264,7 +264,7 @@ exports.showGroupConfig = context => {
`公主查詢:${getIcon(guildConfig.PrincessCharacter)}`,
`公主資訊:${getIcon(guildConfig.PrincessInformation)}`,
];
- context.replyText(messages.join("\n"));
+ context.quoteReply(messages.join("\n"));
function getIcon(isOpen) {
return isOpen === "Y" ? "✔" : "❌";
diff --git a/app/src/templates/application/Order.js b/app/src/templates/application/Order.js
index 2aadfb3d..899fbbe4 100644
--- a/app/src/templates/application/Order.js
+++ b/app/src/templates/application/Order.js
@@ -27,7 +27,7 @@ exports.send = (context, replyDatas, sender = { name: null, iconUrl: null }) =>
_sendImage(context, content, sender);
return;
case "text":
- context.replyText(content, { sender });
+ context.quoteReply(content, { sender });
return;
}
});
@@ -143,7 +143,7 @@ function _sendImage(context, url, sender) {
context.sendPhoto(url);
break;
default:
- context.replyText(url);
+ context.quoteReply(url);
break;
}
}
diff --git a/app/src/templates/princess/ArenaTeamplate.js b/app/src/templates/princess/ArenaTeamplate.js
index ec312fb9..656f4537 100644
--- a/app/src/templates/princess/ArenaTeamplate.js
+++ b/app/src/templates/princess/ArenaTeamplate.js
@@ -8,7 +8,7 @@ exports.showUploadInfo = (context, info) => {
`右方:${info.right.team.map(char => char.name).join(" ")} *${isSuccess[info.right.result]}*`
);
- context.replyText(messages.join("\n"));
+ context.quoteReply(messages.join("\n"));
};
/**
* 詢問是否繼續操作
@@ -135,7 +135,7 @@ exports.askContinue = context => {
exports.showSearchNoneData = (context, searchTeam) => {
context.replyFlex("查無結果", genSearchCover(searchTeam));
- context.replyText("很抱歉,查無此陣容的解法!");
+ context.quoteReply("很抱歉,查無此陣容的解法!");
};
/**
diff --git a/app/src/templates/princess/character/console.js b/app/src/templates/princess/character/console.js
index e5048faf..03748741 100644
--- a/app/src/templates/princess/character/console.js
+++ b/app/src/templates/princess/character/console.js
@@ -1,29 +1,29 @@
module.exports = {
showInfo: function (context, name) {
- context.replyText(`${name}的資訊`);
+ context.quoteReply(`${name}的資訊`);
},
showSkill: function (context, name) {
- context.replyText(`${name}的技能一覽`);
+ context.quoteReply(`${name}的技能一覽`);
},
showAction: function (context, name) {
- context.replyText(`${name}的行動模式`);
+ context.quoteReply(`${name}的行動模式`);
},
showUniqEquip: function (context, name) {
- context.replyText(`${name}的專武清單`);
+ context.quoteReply(`${name}的專武清單`);
},
showEquipRequire: function (context, name) {
- context.replyText(`${name}的裝備需求清單`);
+ context.quoteReply(`${name}的裝備需求清單`);
},
showCharacter: function (context, name) {
- context.replyText(`${name}的角色資訊`);
+ context.quoteReply(`${name}的角色資訊`);
},
showRecommend: function (context, name) {
- context.replyText(`${name}的角色Rank推薦`);
+ context.quoteReply(`${name}的角色Rank推薦`);
},
};
diff --git a/app/src/templates/princess/character/telegram.js b/app/src/templates/princess/character/telegram.js
index e5048faf..03748741 100644
--- a/app/src/templates/princess/character/telegram.js
+++ b/app/src/templates/princess/character/telegram.js
@@ -1,29 +1,29 @@
module.exports = {
showInfo: function (context, name) {
- context.replyText(`${name}的資訊`);
+ context.quoteReply(`${name}的資訊`);
},
showSkill: function (context, name) {
- context.replyText(`${name}的技能一覽`);
+ context.quoteReply(`${name}的技能一覽`);
},
showAction: function (context, name) {
- context.replyText(`${name}的行動模式`);
+ context.quoteReply(`${name}的行動模式`);
},
showUniqEquip: function (context, name) {
- context.replyText(`${name}的專武清單`);
+ context.quoteReply(`${name}的專武清單`);
},
showEquipRequire: function (context, name) {
- context.replyText(`${name}的裝備需求清單`);
+ context.quoteReply(`${name}的裝備需求清單`);
},
showCharacter: function (context, name) {
- context.replyText(`${name}的角色資訊`);
+ context.quoteReply(`${name}的角色資訊`);
},
showRecommend: function (context, name) {
- context.replyText(`${name}的角色Rank推薦`);
+ context.quoteReply(`${name}的角色Rank推薦`);
},
};
diff --git a/app/src/templates/princess/guild/battle.js b/app/src/templates/princess/guild/battle.js
index 020c6bde..1cca97b1 100644
--- a/app/src/templates/princess/guild/battle.js
+++ b/app/src/templates/princess/guild/battle.js
@@ -3,7 +3,7 @@ const i18n = require("../../../util/i18n");
const format = require("date-format");
exports.sendSignFeedback = (context, template, data, sender) => {
- return context.replyText(assemble(data, template), { sender });
+ return context.quoteReply(assemble(data, template), { sender });
};
exports.showBattleList = (context, data) => {
diff --git a/app/src/util/error.js b/app/src/util/error.js
index a41a2d62..c31d9dd1 100644
--- a/app/src/util/error.js
+++ b/app/src/util/error.js
@@ -2,7 +2,7 @@ module.exports = {
sendError: function (context, errMsg) {
switch (context.platform) {
case "line":
- context.replyText(errMsg);
+ context.quoteReply(errMsg);
break;
case "telegram":
context.sendMessage(errMsg);