mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
refactor: change all Robot
to Bot
(#1767)
* Change all `Robot` to `Bot` * Change all `r` of `Bot` to `b` * Change `Robot` to `bot` in comments * Fix typo --------- Co-authored-by: Athurg Feng <athurg@gooth.org>
This commit is contained in:
@@ -34,7 +34,7 @@ const SystemSection = () => {
|
||||
maxUploadSizeMiB: systemStatus.maxUploadSizeMiB,
|
||||
memoDisplayWithUpdatedTs: systemStatus.memoDisplayWithUpdatedTs,
|
||||
});
|
||||
const [telegramRobotToken, setTelegramRobotToken] = useState<string>("");
|
||||
const [telegramBotToken, setTelegramBotToken] = useState<string>("");
|
||||
const [openAIConfig, setOpenAIConfig] = useState<OpenAIConfig>({
|
||||
key: "",
|
||||
host: "",
|
||||
@@ -51,9 +51,9 @@ const SystemSection = () => {
|
||||
setOpenAIConfig(JSON.parse(openAIConfigSetting.value));
|
||||
}
|
||||
|
||||
const telegramRobotSetting = systemSettings.find((setting) => setting.name === "telegram-robot-token");
|
||||
if (telegramRobotSetting) {
|
||||
setTelegramRobotToken(telegramRobotSetting.value);
|
||||
const telegramBotSetting = systemSettings.find((setting) => setting.name === "telegram-bot-token");
|
||||
if (telegramBotSetting) {
|
||||
setTelegramBotToken(telegramBotSetting.value);
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
@@ -135,22 +135,22 @@ const SystemSection = () => {
|
||||
toast.success("OpenAI Config updated");
|
||||
};
|
||||
|
||||
const handleTelegramRobotTokenChanged = (value: string) => {
|
||||
setTelegramRobotToken(value);
|
||||
const handleTelegramBotTokenChanged = (value: string) => {
|
||||
setTelegramBotToken(value);
|
||||
};
|
||||
|
||||
const handleSaveTelegramRobotToken = async () => {
|
||||
const handleSaveTelegramBotToken = async () => {
|
||||
try {
|
||||
await api.upsertSystemSetting({
|
||||
name: "telegram-robot-token",
|
||||
value: telegramRobotToken,
|
||||
name: "telegram-bot-token",
|
||||
value: telegramBotToken,
|
||||
});
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toast.error(error.response.data.message);
|
||||
return;
|
||||
}
|
||||
toast.success("OpenAI Config updated");
|
||||
toast.success("Telegram Bot Token updated");
|
||||
};
|
||||
|
||||
const handleAdditionalStyleChanged = (value: string) => {
|
||||
@@ -292,14 +292,14 @@ const SystemSection = () => {
|
||||
<div className="form-label">
|
||||
<div className="flex flex-row items-center">
|
||||
<div className="w-auto flex items-center">
|
||||
<span className="text-sm mr-1">{t("setting.system-section.telegram-robot-token")}</span>
|
||||
<span className="text-sm mr-1">{t("setting.system-section.telegram-bot-token")}</span>
|
||||
<HelpButton
|
||||
hint={t("setting.system-section.telegram-robot-token-description")}
|
||||
hint={t("setting.system-section.telegram-bot-token-description")}
|
||||
url="https://usememos.com/docs/integration/telegram-bot"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Button onClick={handleSaveTelegramRobotToken}>{t("common.save")}</Button>
|
||||
<Button onClick={handleSaveTelegramBotToken}>{t("common.save")}</Button>
|
||||
</div>
|
||||
<Input
|
||||
className="w-full"
|
||||
@@ -307,9 +307,9 @@ const SystemSection = () => {
|
||||
fontFamily: "monospace",
|
||||
fontSize: "14px",
|
||||
}}
|
||||
placeholder={t("setting.system-section.telegram-robot-token-placeholder")}
|
||||
value={telegramRobotToken}
|
||||
onChange={(event) => handleTelegramRobotTokenChanged(event.target.value)}
|
||||
placeholder={t("setting.system-section.telegram-bot-token-placeholder")}
|
||||
value={telegramBotToken}
|
||||
onChange={(event) => handleTelegramBotTokenChanged(event.target.value)}
|
||||
/>
|
||||
<Divider className="!mt-3 !my-4" />
|
||||
<div className="form-label">
|
||||
|
@@ -193,7 +193,7 @@
|
||||
"mobile-editor-style": "Mobile editor style",
|
||||
"default-memo-sort-option": "Memo display time",
|
||||
"telegram-user-id": "Telegram UserID",
|
||||
"telegram-user-id-placeholder": "Send any words to Your Telegram Robot to get",
|
||||
"telegram-user-id-placeholder": "Send any words to Your Telegram Bot to get",
|
||||
"created_ts": "Created Time",
|
||||
"updated_ts": "Updated Time",
|
||||
"daily-review-time-offset": "Daily Review Time Offset",
|
||||
@@ -258,9 +258,9 @@
|
||||
"additional-script": "Additional script",
|
||||
"additional-style-placeholder": "Additional CSS code",
|
||||
"additional-script-placeholder": "Additional JavaScript code",
|
||||
"telegram-robot-token": "Telegram Robot Token",
|
||||
"telegram-robot-token-description": "Telegram Robot Token or API Proxy like `http.../bot<token>`",
|
||||
"telegram-robot-token-placeholder": "Your Telegram Robot token",
|
||||
"telegram-bot-token": "Telegram Bot Token",
|
||||
"telegram-bot-token-description": "Telegram Bot Token or API Proxy like `http.../bot<token>`",
|
||||
"telegram-bot-token-placeholder": "Your Telegram Bot token",
|
||||
"openai-api-key": "OpenAI: API Key",
|
||||
"openai-api-key-description": "Get API key",
|
||||
"openai-api-key-placeholder": "Your OpenAI API Key",
|
||||
|
@@ -258,9 +258,9 @@
|
||||
"additional-script": "추가적인 스크립트",
|
||||
"additional-style-placeholder": "추가적인 CSS 코드",
|
||||
"additional-script-placeholder": "추가적인 JavaScript 코드",
|
||||
"telegram-robot-token": "텔레그램 봇 연동",
|
||||
"telegram-robot-token-description": "텔레그램 @BotFather 에서 얻을 수 있습니다",
|
||||
"telegram-robot-token-placeholder": "서버의 텔레그램 봇 토큰",
|
||||
"telegram-bot-token": "텔레그램 봇 연동",
|
||||
"telegram-bot-token-description": "텔레그램 @BotFather 에서 얻을 수 있습니다",
|
||||
"telegram-bot-token-placeholder": "서버의 텔레그램 봇 토큰",
|
||||
"openai-api-key": "OpenAI: API 키",
|
||||
"openai-api-key-description": "API 키 받아오기",
|
||||
"openai-api-key-placeholder": "내 OpenAI API 키",
|
||||
|
@@ -410,10 +410,10 @@
|
||||
"database-file-size": "数据库文件大小",
|
||||
"disable-public-memos": "禁用公共备忘录",
|
||||
"ignore-version-upgrade": "忽略版本升级",
|
||||
"telegram-robot-token": "Telegram 机器人 Token",
|
||||
"telegram-robot-token-description": "从 Telegram 的 @BotFather 处获取",
|
||||
"telegram-robot-token-description": "Telegram 机器人Token或`http.../bot<token>`格式的代理地址",
|
||||
"telegram-robot-token-placeholder": "Telegram 的机器人 Token",
|
||||
"telegram-bot-token": "Telegram 机器人 Token",
|
||||
"telegram-bot-token-description": "从 Telegram 的 @BotFather 处获取",
|
||||
"telegram-bot-token-description": "Telegram 机器人Token或`http.../bot<token>`格式的代理地址",
|
||||
"telegram-bot-token-placeholder": "Telegram 的机器人 Token",
|
||||
"openai-api-host": "OpenAI:API Host",
|
||||
"openai-api-host-placeholder": "默认:https://api.openai.com/",
|
||||
"openai-api-key": "OpenAI:API 密钥",
|
||||
|
Reference in New Issue
Block a user