Add approval message
This commit is contained in:
parent
c3402bb973
commit
18e606f368
2 changed files with 10 additions and 7 deletions
|
|
@ -37,10 +37,11 @@ func (c *Config) CreateConfig() error {
|
|||
defer f.Close()
|
||||
|
||||
defaultConfig := Config{
|
||||
BotToken: "YOUR_BOT_TOKEN_HERE",
|
||||
AdminChatId: 0,
|
||||
TargetChatId: 0,
|
||||
EntryMessage: "You have requested to join the group, please write a brief message explaining why you want to join.",
|
||||
BotToken: "YOUR_BOT_TOKEN_HERE",
|
||||
AdminChatId: 0,
|
||||
TargetChatId: 0,
|
||||
EntryMessage: "You have requested to join the group, please write a brief message explaining why you want to join.",
|
||||
ApprovalMessage: "",
|
||||
}
|
||||
|
||||
encoder := yaml.NewEncoder(f)
|
||||
|
|
|
|||
8
main.go
8
main.go
|
|
@ -147,9 +147,11 @@ func (bot *Bot) handleCallbackQuery(query *api.CallbackQuery) {
|
|||
edit.ParseMode = api.ModeMarkdown
|
||||
bot.API.Send(edit)
|
||||
|
||||
m := api.NewMessage(user.From.ID, bot.Config.ApprovalMessage)
|
||||
m.ParseMode = api.ModeMarkdown
|
||||
bot.API.Send(m)
|
||||
if bot.Config.ApprovalMessage != "" {
|
||||
m := api.NewMessage(user.From.ID, bot.Config.ApprovalMessage)
|
||||
m.ParseMode = api.ModeMarkdown
|
||||
bot.API.Send(m)
|
||||
}
|
||||
|
||||
case "reject":
|
||||
r := api.DeclineChatJoinRequest{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue