mirror of
https://github.com/usememos/memos.git
synced 2025-01-26 23:18:46 +08: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:
parent
ddf4cae537
commit
845297ec03
16 changed files with 80 additions and 80 deletions
|
@ -35,8 +35,8 @@ const (
|
|||
SystemSettingLocalStoragePathName SystemSettingName = "local-storage-path"
|
||||
// SystemSettingOpenAIConfigName is the name of OpenAI config.
|
||||
SystemSettingOpenAIConfigName SystemSettingName = "openai-config"
|
||||
// SystemSettingTelegramRobotToken is the name of Telegram Robot Token.
|
||||
SystemSettingTelegramRobotTokenName SystemSettingName = "telegram-robot-token"
|
||||
// SystemSettingTelegramBotToken is the name of Telegram Bot Token.
|
||||
SystemSettingTelegramBotTokenName SystemSettingName = "telegram-bot-token"
|
||||
SystemSettingMemoDisplayWithUpdatedTsName SystemSettingName = "memo-display-with-updated-ts"
|
||||
)
|
||||
|
||||
|
@ -87,8 +87,8 @@ func (key SystemSettingName) String() string {
|
|||
return "local-storage-path"
|
||||
case SystemSettingOpenAIConfigName:
|
||||
return "openai-config"
|
||||
case SystemSettingTelegramRobotTokenName:
|
||||
return "telegram-robot-token"
|
||||
case SystemSettingTelegramBotTokenName:
|
||||
return "telegram-bot-token"
|
||||
case SystemSettingMemoDisplayWithUpdatedTsName:
|
||||
return "memo-display-with-updated-ts"
|
||||
}
|
||||
|
@ -178,11 +178,11 @@ func (upsert SystemSettingUpsert) Validate() error {
|
|||
if err := json.Unmarshal([]byte(upsert.Value), &value); err != nil {
|
||||
return fmt.Errorf(systemSettingUnmarshalError, settingName)
|
||||
}
|
||||
case SystemSettingTelegramRobotTokenName:
|
||||
case SystemSettingTelegramBotTokenName:
|
||||
if upsert.Value == "" {
|
||||
return nil
|
||||
}
|
||||
// Robot Token with Reverse Proxy shoule like `http.../bot<token>`
|
||||
// Bot Token with Reverse Proxy shoule like `http.../bot<token>`
|
||||
if strings.HasPrefix(upsert.Value, "http") {
|
||||
slashIndex := strings.LastIndexAny(upsert.Value, "/")
|
||||
if strings.HasPrefix(upsert.Value[slashIndex:], "/bot") {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
// EditMessage make an editMessageText api request.
|
||||
func (r *Robot) EditMessage(ctx context.Context, chatID, messageID int, text string) (*Message, error) {
|
||||
func (b *Bot) EditMessage(ctx context.Context, chatID, messageID int, text string) (*Message, error) {
|
||||
formData := url.Values{
|
||||
"message_id": {strconv.Itoa(messageID)},
|
||||
"chat_id": {strconv.Itoa(chatID)},
|
||||
|
@ -15,7 +15,7 @@ func (r *Robot) EditMessage(ctx context.Context, chatID, messageID int, text str
|
|||
}
|
||||
|
||||
var result Message
|
||||
err := r.postForm(ctx, "/editMessageText", formData, &result)
|
||||
err := b.postForm(ctx, "/editMessageText", formData, &result)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -6,13 +6,13 @@ import (
|
|||
)
|
||||
|
||||
// GetFile get download info of File by fileID from Telegram.
|
||||
func (r *Robot) GetFile(ctx context.Context, fileID string) (*File, error) {
|
||||
func (b *Bot) GetFile(ctx context.Context, fileID string) (*File, error) {
|
||||
formData := url.Values{
|
||||
"file_id": {fileID},
|
||||
}
|
||||
|
||||
var result File
|
||||
err := r.postForm(ctx, "/getFile", formData, &result)
|
||||
err := b.postForm(ctx, "/getFile", formData, &result)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -7,14 +7,14 @@ import (
|
|||
)
|
||||
|
||||
// GetUpdates make a getUpdates api request.
|
||||
func (r *Robot) GetUpdates(ctx context.Context, offset int) ([]Update, error) {
|
||||
func (b *Bot) GetUpdates(ctx context.Context, offset int) ([]Update, error) {
|
||||
formData := url.Values{
|
||||
"timeout": {"60"},
|
||||
"offset": {strconv.Itoa(offset)},
|
||||
}
|
||||
|
||||
var result []Update
|
||||
err := r.postForm(ctx, "/getUpdates", formData, &result)
|
||||
err := b.postForm(ctx, "/getUpdates", formData, &result)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
// SendReplyMessage make a sendMessage api request.
|
||||
func (r *Robot) SendReplyMessage(ctx context.Context, chatID, replyID int, text string) (*Message, error) {
|
||||
func (b *Bot) SendReplyMessage(ctx context.Context, chatID, replyID int, text string) (*Message, error) {
|
||||
formData := url.Values{
|
||||
"reply_to_message_id": {strconv.Itoa(replyID)},
|
||||
"chat_id": {strconv.Itoa(chatID)},
|
||||
|
@ -15,7 +15,7 @@ func (r *Robot) SendReplyMessage(ctx context.Context, chatID, replyID int, text
|
|||
}
|
||||
|
||||
var result Message
|
||||
err := r.postForm(ctx, "/sendMessage", formData, &result)
|
||||
err := b.postForm(ctx, "/sendMessage", formData, &result)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -12,28 +12,28 @@ import (
|
|||
)
|
||||
|
||||
type Handler interface {
|
||||
RobotToken(ctx context.Context) string
|
||||
BotToken(ctx context.Context) string
|
||||
MessageHandle(ctx context.Context, message Message, blobs map[string][]byte) error
|
||||
}
|
||||
|
||||
type Robot struct {
|
||||
type Bot struct {
|
||||
handler Handler
|
||||
}
|
||||
|
||||
// NewRobotWithHandler create a telegram robot with specified handler.
|
||||
func NewRobotWithHandler(h Handler) *Robot {
|
||||
return &Robot{handler: h}
|
||||
// NewBotWithHandler create a telegram bot with specified handler.
|
||||
func NewBotWithHandler(h Handler) *Bot {
|
||||
return &Bot{handler: h}
|
||||
}
|
||||
|
||||
const noTokenWait = 30 * time.Second
|
||||
const errRetryWait = 10 * time.Second
|
||||
|
||||
// Start start an infinity call of getUpdates from Telegram, call r.MessageHandle while get new message updates.
|
||||
func (r *Robot) Start(ctx context.Context) {
|
||||
func (b *Bot) Start(ctx context.Context) {
|
||||
var offset int
|
||||
|
||||
for {
|
||||
updates, err := r.GetUpdates(ctx, offset)
|
||||
updates, err := b.GetUpdates(ctx, offset)
|
||||
if err == ErrInvalidToken {
|
||||
time.Sleep(noTokenWait)
|
||||
continue
|
||||
|
@ -55,7 +55,7 @@ func (r *Robot) Start(ctx context.Context) {
|
|||
|
||||
// skip message other than text or photo
|
||||
if message.Text == nil && message.Photo == nil {
|
||||
_, err := r.SendReplyMessage(ctx, message.Chat.ID, message.MessageID, "Only text or photo message be supported")
|
||||
_, err := b.SendReplyMessage(ctx, message.Chat.ID, message.MessageID, "Only text or photo message be supported")
|
||||
if err != nil {
|
||||
log.Error(fmt.Sprintf("fail to telegram.SendReplyMessage for messageID=%d", message.MessageID), zap.Error(err))
|
||||
}
|
||||
|
@ -68,14 +68,14 @@ func (r *Robot) Start(ctx context.Context) {
|
|||
continue
|
||||
}
|
||||
|
||||
err = r.handleSingleMessage(ctx, message)
|
||||
err = b.handleSingleMessage(ctx, message)
|
||||
if err != nil {
|
||||
log.Error(fmt.Sprintf("fail to handleSingleMessage for messageID=%d", message.MessageID), zap.Error(err))
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
err = r.handleGroupMessages(ctx, groupMessages)
|
||||
err = b.handleGroupMessages(ctx, groupMessages)
|
||||
if err != nil {
|
||||
log.Error("fail to handle plain text message", zap.Error(err))
|
||||
}
|
||||
|
@ -84,8 +84,8 @@ func (r *Robot) Start(ctx context.Context) {
|
|||
|
||||
var ErrInvalidToken = errors.New("token is invalid")
|
||||
|
||||
func (r *Robot) apiURL(ctx context.Context) (string, error) {
|
||||
token := r.handler.RobotToken(ctx)
|
||||
func (b *Bot) apiURL(ctx context.Context) (string, error) {
|
||||
token := b.handler.BotToken(ctx)
|
||||
if token == "" {
|
||||
return "", ErrInvalidToken
|
||||
}
|
|
@ -9,12 +9,12 @@ import (
|
|||
)
|
||||
|
||||
// downloadFileId download file with fileID, return the filepath and blob.
|
||||
func (r *Robot) downloadFileID(ctx context.Context, fileID string) (string, []byte, error) {
|
||||
file, err := r.GetFile(ctx, fileID)
|
||||
func (b *Bot) downloadFileID(ctx context.Context, fileID string) (string, []byte, error) {
|
||||
file, err := b.GetFile(ctx, fileID)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
blob, err := r.downloadFilepath(ctx, file.FilePath)
|
||||
blob, err := b.downloadFilepath(ctx, file.FilePath)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
@ -23,8 +23,8 @@ func (r *Robot) downloadFileID(ctx context.Context, fileID string) (string, []by
|
|||
}
|
||||
|
||||
// downloadFilepath download file with filepath, you can get filepath by calling GetFile.
|
||||
func (r *Robot) downloadFilepath(ctx context.Context, filePath string) ([]byte, error) {
|
||||
apiURL, err := r.apiURL(ctx)
|
||||
func (b *Bot) downloadFilepath(ctx context.Context, filePath string) ([]byte, error) {
|
||||
apiURL, err := b.apiURL(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ const (
|
|||
)
|
||||
|
||||
// handleSingleMessage handle a message not belongs to group.
|
||||
func (r *Robot) handleSingleMessage(ctx context.Context, message Message) error {
|
||||
reply, err := r.SendReplyMessage(ctx, message.Chat.ID, message.MessageID, workingMessage)
|
||||
func (b *Bot) handleSingleMessage(ctx context.Context, message Message) error {
|
||||
reply, err := b.SendReplyMessage(ctx, message.Chat.ID, message.MessageID, workingMessage)
|
||||
if err != nil {
|
||||
return fmt.Errorf("fail to SendReplyMessage: %s", err)
|
||||
}
|
||||
|
@ -25,10 +25,10 @@ func (r *Robot) handleSingleMessage(ctx context.Context, message Message) error
|
|||
|
||||
// download blob if need
|
||||
if len(message.Photo) > 0 {
|
||||
filepath, blob, err := r.downloadFileID(ctx, message.GetMaxPhotoFileID())
|
||||
filepath, blob, err := b.downloadFileID(ctx, message.GetMaxPhotoFileID())
|
||||
if err != nil {
|
||||
log.Error("fail to downloadFileID", zap.Error(err))
|
||||
_, err = r.EditMessage(ctx, message.Chat.ID, reply.MessageID, err.Error())
|
||||
_, err = b.EditMessage(ctx, message.Chat.ID, reply.MessageID, err.Error())
|
||||
if err != nil {
|
||||
return fmt.Errorf("fail to EditMessage: %s", err)
|
||||
}
|
||||
|
@ -37,15 +37,15 @@ func (r *Robot) handleSingleMessage(ctx context.Context, message Message) error
|
|||
blobs = map[string][]byte{filepath: blob}
|
||||
}
|
||||
|
||||
err = r.handler.MessageHandle(ctx, message, blobs)
|
||||
err = b.handler.MessageHandle(ctx, message, blobs)
|
||||
if err != nil {
|
||||
if _, err := r.EditMessage(ctx, message.Chat.ID, reply.MessageID, err.Error()); err != nil {
|
||||
if _, err := b.EditMessage(ctx, message.Chat.ID, reply.MessageID, err.Error()); err != nil {
|
||||
return fmt.Errorf("fail to EditMessage: %s", err)
|
||||
}
|
||||
return fmt.Errorf("fail to MessageHandle: %s", err)
|
||||
}
|
||||
|
||||
if _, err := r.EditMessage(ctx, message.Chat.ID, reply.MessageID, successMessage); err != nil {
|
||||
if _, err := b.EditMessage(ctx, message.Chat.ID, reply.MessageID, successMessage); err != nil {
|
||||
return fmt.Errorf("fail to EditMessage: %s", err)
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ func (r *Robot) handleSingleMessage(ctx context.Context, message Message) error
|
|||
}
|
||||
|
||||
// handleGroupMessages handle a message belongs to group.
|
||||
func (r *Robot) handleGroupMessages(ctx context.Context, groupMessages []Message) error {
|
||||
func (b *Bot) handleGroupMessages(ctx context.Context, groupMessages []Message) error {
|
||||
captions := make(map[string]string, len(groupMessages))
|
||||
messages := make(map[string]Message, len(groupMessages))
|
||||
blobs := make(map[string]map[string][]byte, len(groupMessages))
|
||||
|
@ -68,7 +68,7 @@ func (r *Robot) handleGroupMessages(ctx context.Context, groupMessages []Message
|
|||
captions[groupID] += *message.Caption
|
||||
}
|
||||
|
||||
filepath, blob, err := r.downloadFileID(ctx, message.GetMaxPhotoFileID())
|
||||
filepath, blob, err := b.downloadFileID(ctx, message.GetMaxPhotoFileID())
|
||||
if err != nil {
|
||||
return fmt.Errorf("fail to downloadFileID")
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ func (r *Robot) handleGroupMessages(ctx context.Context, groupMessages []Message
|
|||
|
||||
// Handle each group message
|
||||
for groupID, message := range messages {
|
||||
reply, err := r.SendReplyMessage(ctx, message.Chat.ID, message.MessageID, workingMessage)
|
||||
reply, err := b.SendReplyMessage(ctx, message.Chat.ID, message.MessageID, workingMessage)
|
||||
if err != nil {
|
||||
return fmt.Errorf("fail to SendReplyMessage: %s", err)
|
||||
}
|
||||
|
@ -88,14 +88,14 @@ func (r *Robot) handleGroupMessages(ctx context.Context, groupMessages []Message
|
|||
// replace Caption with all Caption in the group
|
||||
caption := captions[groupID]
|
||||
message.Caption = &caption
|
||||
if err := r.handler.MessageHandle(ctx, message, blobs[groupID]); err != nil {
|
||||
if _, err = r.EditMessage(ctx, message.Chat.ID, reply.MessageID, err.Error()); err != nil {
|
||||
if err := b.handler.MessageHandle(ctx, message, blobs[groupID]); err != nil {
|
||||
if _, err = b.EditMessage(ctx, message.Chat.ID, reply.MessageID, err.Error()); err != nil {
|
||||
return fmt.Errorf("fail to EditMessage: %s", err)
|
||||
}
|
||||
return fmt.Errorf("fail to MessageHandle: %s", err)
|
||||
}
|
||||
|
||||
if _, err := r.EditMessage(ctx, message.Chat.ID, reply.MessageID, successMessage); err != nil {
|
||||
if _, err := b.EditMessage(ctx, message.Chat.ID, reply.MessageID, successMessage); err != nil {
|
||||
return fmt.Errorf("fail to EditMessage: %s", err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ import (
|
|||
"net/url"
|
||||
)
|
||||
|
||||
func (r *Robot) postForm(ctx context.Context, apiPath string, formData url.Values, result any) error {
|
||||
apiURL, err := r.apiURL(ctx)
|
||||
func (b *Bot) postForm(ctx context.Context, apiPath string, formData url.Values, result any) error {
|
||||
apiURL, err := b.apiURL(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ type Server struct {
|
|||
Profile *profile.Profile
|
||||
Store *store.Store
|
||||
|
||||
telegramRobot *telegram.Robot
|
||||
telegramBot *telegram.Bot
|
||||
}
|
||||
|
||||
func NewServer(ctx context.Context, profile *profile.Profile) (*Server, error) {
|
||||
|
@ -48,8 +48,8 @@ func NewServer(ctx context.Context, profile *profile.Profile) (*Server, error) {
|
|||
storeInstance := store.New(db.DBInstance, profile)
|
||||
s.Store = storeInstance
|
||||
|
||||
telegramRobotHandler := newTelegramHandler(storeInstance)
|
||||
s.telegramRobot = telegram.NewRobotWithHandler(telegramRobotHandler)
|
||||
telegramBotHandler := newTelegramHandler(storeInstance)
|
||||
s.telegramBot = telegram.NewBotWithHandler(telegramBotHandler)
|
||||
|
||||
e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
|
||||
Format: `{"time":"${time_rfc3339}",` +
|
||||
|
@ -125,7 +125,7 @@ func (s *Server) Start(ctx context.Context) error {
|
|||
return errors.Wrap(err, "failed to create activity")
|
||||
}
|
||||
|
||||
go s.telegramRobot.Start(ctx)
|
||||
go s.telegramBot.Start(ctx)
|
||||
|
||||
return s.e.Start(fmt.Sprintf(":%d", s.Profile.Port))
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
|
|||
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find system setting list").SetInternal(err)
|
||||
}
|
||||
for _, systemSetting := range systemSettingList {
|
||||
if systemSetting.Name == api.SystemSettingServerIDName || systemSetting.Name == api.SystemSettingSecretSessionName || systemSetting.Name == api.SystemSettingOpenAIConfigName || systemSetting.Name == api.SystemSettingTelegramRobotTokenName {
|
||||
if systemSetting.Name == api.SystemSettingServerIDName || systemSetting.Name == api.SystemSettingSecretSessionName || systemSetting.Name == api.SystemSettingOpenAIConfigName || systemSetting.Name == api.SystemSettingTelegramBotTokenName {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ func newTelegramHandler(store *store.Store) *telegramHandler {
|
|||
return &telegramHandler{store: store}
|
||||
}
|
||||
|
||||
func (t *telegramHandler) RobotToken(ctx context.Context) string {
|
||||
return t.store.GetSystemSettingValueOrDefault(&ctx, api.SystemSettingTelegramRobotTokenName, "")
|
||||
func (t *telegramHandler) BotToken(ctx context.Context) string {
|
||||
return t.store.GetSystemSettingValueOrDefault(&ctx, api.SystemSettingTelegramBotTokenName, "")
|
||||
}
|
||||
|
||||
func (t *telegramHandler) MessageHandle(ctx context.Context, message telegram.Message, blobs map[string][]byte) error {
|
||||
|
|
|
@ -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 密钥",
|
||||
|
|
Loading…
Reference in a new issue