Skip to content

Commit

Permalink
Merge pull request #2 from LightningTipBot/no_username_message
Browse files Browse the repository at this point in the history
No username message
  • Loading branch information
LightningTipBot authored Aug 16, 2021
2 parents 8b4c5e2 + da82835 commit b6b73e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ You can either use your own LNbits instance (recommended) or create an account a

### Live tooltips

The bot replies to a tipped message to indicate to all participants how much tips a post has received. This message will be updated as new tips are given to a post.
The bot replies to a tipped message to indicate to all participants how many and what amount of tips a post has received. This tooltip will be updated as new tips are given to a post.

<p align="center">
<img alt="How to set up a lnbits wallet and the User Manager extension." src="resources/tooltips.png" >
Expand Down
5 changes: 5 additions & 0 deletions start.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
const (
startSettingWalletMessage = "🧮 Setting up your wallet..."
startWalletReadyMessage = "✅ *Your wallet is ready.*"
startNoUsernameMessage = "☝️ It looks like you don't have a Telegram @username yet. You don't need one to use this bot. However, to make better use of your new wallet, please set up a username in the [Telegram settings](https://telegram.org/faq#q-what-are-usernames-how-do-i-get-one). Then, enter /balance so the bot can update its record of you."
)

func (bot TipBot) startHandler(m *tb.Message) {
Expand All @@ -32,6 +33,10 @@ func (bot TipBot) startHandler(m *tb.Message) {
}
bot.telegram.Edit(walletCreationMsg, startWalletReadyMessage)
bot.balanceHandler(m)

if len(m.Sender.Username) == 0 {
bot.telegram.Send(m.Sender, startNoUsernameMessage, tb.NoPreview)
}
return
}

Expand Down

0 comments on commit b6b73e8

Please sign in to comment.