Skip to content

Commit

Permalink
config: add option to skip startup message
Browse files Browse the repository at this point in the history
  • Loading branch information
akshettrj committed Aug 11, 2024
1 parent 686729e commit 5089c90
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func main() {
}
SKIP_RESTART:

if !startMessageSuccessful {
if !startMessageSuccessful && !cfg.Telegram.SkipStartupMessage {
state.State.TelegramBot.SendMessage(cfg.Telegram.OwnerID, "Successfully started WaTgBridge", &gotgbot.SendMessageOpts{})
}

Expand Down
2 changes: 2 additions & 0 deletions sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ telegram:
silent_confirmation: true # Send a silent "Successfully sent" message
emoji_confirmation: true # Reacts to the message with a "👍" emoji instead of replying

skip_startup_message: false # If set to true, then a message will NOT be sent to your Telegram DM when the bot starts

whatsapp:
session_name: watgbridge # This will appear in your Linked Devices in mobile app
# All these values can be obtained by running /findcontacts and /getwagroups commands
Expand Down
1 change: 1 addition & 0 deletions state/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type Config struct {
SendMyReadReceipts bool `yaml:"send_my_read_receipts"`
SilentConfirmation bool `yaml:"silent_confirmation"`
EmojiConfirmation bool `yaml:"emoji_confirmation"`
SkipStartupMessage bool `yaml:"skip_startup_message"`
} `yaml:"telegram"`

WhatsApp struct {
Expand Down
2 changes: 1 addition & 1 deletion state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"gorm.io/gorm"
)

const WATGBRIDGE_VERSION = "1.9.2"
const WATGBRIDGE_VERSION = "1.9.3"

type state struct {
Config *Config
Expand Down

0 comments on commit 5089c90

Please sign in to comment.