Commit f761a147 authored by nanahira's avatar nanahira

fix

parent 2d177ee0
Pipeline #43340 passed with stages
in 1 minute and 34 seconds
......@@ -145,21 +145,22 @@ export class Client {
if (this.isInternal) {
return;
}
const normalizedType = typeof type === 'number' ? type : ChatColor.BABYBLUE;
const elements = h.normalize(msg) as KoishiElement[];
const tokens = await collectKoishiTextTokens(elements, (element) =>
this.resolveSendChatElement(element, normalizedType),
const tokens = await collectKoishiTextTokens(
elements,
(element) => this.resolveSendChatElement(element, type),
type,
);
if (type <= NetPlayerType.OBSERVER) {
return this.send(
new YGOProStocChat().fromPartial({
msg: tokens.map((token) => token.text).join(''),
player_type: normalizedType,
player_type: type,
}),
);
}
const messages = splitColoredMessagesByLine(
resolveColoredMessages(tokens, normalizedType),
resolveColoredMessages(tokens, type),
);
if (!messages.length) {
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment