Documentation ¶
Index ¶
- Constants
- Variables
- func ActiveSourceDeactivated(sourceName string) string
- func ActiveSourceIsSet(sourceName string, timeoutMinutes int) string
- func ConfirmLibraryChange(YesAnswer, NoAnswer string) string
- func EditSource(source *db.Source, sourceData any) (string, error)
- func InvalidSourceKind(sourceKind string) string
- func ListOfSources(sources []db.Source) string
- func ListOfYourOutputs(outputs []db.Output) string
- func MalformedSetActiveSource(defaultTimeMins int) string
- func Quote(q *utils.Quote) string
- func SourceDoesNotExist(sourceName string) string
- func SourceInfo(source *db.Source, sourceData any) (string, error)
- func UpdatedSource(newSource *db.Source) (string, error)
- func WelcomeToBot(firstName string) string
- func YourLibraryToken(token string, lifetimeStr string) string
Constants ¶
View Source
const ActiveSourceExpired = "✅ Active source expired."
View Source
const COMMAND_DEACTIVATE_SOURCE = "/deactivatesource"
View Source
const COMMAND_GET_LIBRARY_TOKEN = "/getlibtoken"
View Source
const COMMAND_GET_OUTPUTS = "/getoutputs"
View Source
const COMMAND_GET_SOURCES = "/getsources"
View Source
const COMMAND_HELP = "/help"
View Source
const COMMAND_SET_ACTIVE_SOURCE = "/setactivesource"
View Source
const COMMAND_SET_LIBRARY_TOKEN = "/setlibtoken"
View Source
const COMMAND_START = "/start"
COMMANDS ///////////////////////////////////////////////////////
View Source
const ConfirmLibraryChangeCancelAnswer = "cancel"
View Source
const ConfirmLibraryChangeYesAnswer = "Yes, I want use this library."
View Source
const GoingBackToNormalMode = "❌ There was an error in operation. Operation is canceled and you went back to normal state."
View Source
const InternalServerErr = "❌ Something unexpected happened.Text me (@aigic8) if the issue persists."
COMMON STRINGS ////////////////////////////////////////////////
View Source
const LibraryChangedSuccessfully = "✅ Library changed successfully."
View Source
const LibraryNoLongerExistsOPCanceled = "❌ Library you wanted to join, no longer exists."
View Source
const LibraryTokenExpired = "❌ Library Token is expired.\nAsk the owner for a new token."
View Source
const MergeOrDeleteCurrentLibraryData = `` /* 182-byte string literal not displayed */
View Source
const NoActiveSource = "Currently you have no active source. 😊"
View Source
const NoLibraryExistsWithToken = "❌ Library token is not valid."
View Source
const OnlyOneSourceKindFilterIsAllowed = "You can only filter sources based on one source kind. 🧐"
View Source
const OnlyTheOwnerCanAddNewUsers = "❌ Only the owner of library can add new users. (the first person who have created the library)"
LIBRARIES /////////////////////////////////////////////////////
View Source
const OperationCanceled = "✅ Operation canceled"
View Source
const QuoteAdded = "✅ Quote added"
View Source
const QuoteAddedButFailedToPublish = "❌ Quote is added, but failed to publish it to outputs."
View Source
const SOURCE_ARTICLE_AUTHOR = "author"
View Source
const SOURCE_ARTICLE_URL = "url"
View Source
const SOURCE_BOOK_AUTHOR = "author"
View Source
const SOURCE_BOOK_AUTHOR_URL = "author url"
View Source
const SOURCE_BOOK_INFO_URL = "info url"
View Source
const SOURCE_KIND = "kind"
View Source
const SOURCE_NAME = "name"
View Source
const SOURCE_PERSON_INFO_URL = "info url"
View Source
const SOURCE_PERSON_LIVED_IN = "lived in"
View Source
const SOURCE_PERSON_TITLE = "title"
View Source
const SourceNoLongerExists = "❌ Source no longer exists."
View Source
const SourceTimeoutShouldBeGreaterThanZero = "Active source timeout should greater than zero. 🧐"
SOURCES ///////////////////////////////////////////////////////
View Source
const UnknownLibraryConfirmationMessage = "Couldn't understand what you mean.\nValid answers are either '" + ConfirmLibraryChangeYesAnswer + "' or '" + ConfirmLibraryChangeCancelAnswer + "'."
View Source
const YouAreAlreadyJoined = "Joining this bot is like seeing a good movie for the first time, you can only experience it for once. 😌"
View Source
const YourDataIsLost = "Looks like your data is lost.\nFeel free to text me (@aigic8) if you've lost any valuable information."
Variables ¶
View Source
var Help = fmt.Sprintf(`WarmLight Bot This bot is created to help you saving your quotes. You can add a quote simply by sending a message in this format: We should forget about small efficiencies, say about 97%% of the time: premature optimization is the root of all evil. sources: Donald Ervin Knuth #programming #optimization There are several important commands in this bot: %s you can search your sources, it will return results and you can view their info and also edit them. For example: %s Animal Farm will search for a source with name of "Animal Farm". Also, you can use source type specifier to search more specifically for source. For example: %s Animal Farm @book Will only search for books with name "Animal Farm". %s will activate a source for certain amount of time. During that time period every quote you send will automatically be added to that source. For example: %s Animal Farm, 20 Will set source "Animal Farm" as active source for "20 minutes". The time period is optional, for example: %s Animal Farm This command will set source "Animal Farm" as active source for default timeout (60 minutes) %s will show you your outputs. Outputs are Telegram channels when you send a new quote, your quotes will be forwarded to there. You can activate and deactivate your outputs with this command. %s and %s are used to share a quote library between multiple accounts. The owner of the library will use command %s to get his library token. The second account will use command %s to set library token received by the owner. `, COMMAND_GET_SOURCES, COMMAND_GET_SOURCES, COMMAND_GET_SOURCES, COMMAND_SET_ACTIVE_SOURCE, COMMAND_SET_ACTIVE_SOURCE, COMMAND_SET_ACTIVE_SOURCE, COMMAND_GET_OUTPUTS, COMMAND_GET_LIBRARY_TOKEN, COMMAND_SET_LIBRARY_TOKEN, COMMAND_GET_LIBRARY_TOKEN, COMMAND_SET_LIBRARY_TOKEN)
View Source
var MalformedEditSourceText = fmt.Sprintf(`Couldn't understand what you mean. 🤔 To edit the source properly, you should use this format: [option1]: [value1] [option2]: [value2] ... For example for a book: %s: book %s: https://en.wikipedia.org/wiki/Animal_Farm %s: George Orwell %s: https://en.wikipedia.org/wiki/George_Orwell You can set the source kind with option named '%s'. Based on source kind you will have different options: book: %s, %s, %s person: %s, %s, %s article: %s, %s unknown: [HAVE NO OPTIONS] You can also send '%s' to cancel the operation.`, SOURCE_KIND, SOURCE_BOOK_INFO_URL, SOURCE_BOOK_AUTHOR, SOURCE_BOOK_AUTHOR_URL, SOURCE_KIND, SOURCE_BOOK_INFO_URL, SOURCE_BOOK_AUTHOR, SOURCE_BOOK_AUTHOR_URL, SOURCE_PERSON_INFO_URL, SOURCE_PERSON_LIVED_IN, SOURCE_PERSON_TITLE, SOURCE_ARTICLE_URL, SOURCE_ARTICLE_AUTHOR, ConfirmLibraryChangeCancelAnswer)
View Source
var MalformedLibraryToken = fmt.Sprintf(`Couldn't understand what you mean. 🤔 To use '%s' command properly, use it in this format: %s [libraryToken]`, COMMAND_SET_LIBRARY_TOKEN, COMMAND_SET_LIBRARY_TOKEN)
View Source
var MalformedPersonDates = fmt.Sprintf(`Malformed value for '%s'. The correct format is: %s: 1960-2000`, SOURCE_PERSON_LIVED_IN, SOURCE_PERSON_LIVED_IN)
Functions ¶
func ActiveSourceDeactivated ¶
func ActiveSourceIsSet ¶
func ConfirmLibraryChange ¶
func InvalidSourceKind ¶
func ListOfSources ¶
IMPORTANT needs support for Markdown parseMode
func ListOfYourOutputs ¶
OUTPUTS /////////////////////////////////////////////////////// IMPORTANT needs support for Markdown parseMode
func Quote ¶
QUOTES //////////////////////////////////////////////////////// IMPORTANT needs support Markdown parseMode
func SourceDoesNotExist ¶
func WelcomeToBot ¶
func YourLibraryToken ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.