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()
|
defer f.Close()
|
||||||
|
|
||||||
defaultConfig := Config{
|
defaultConfig := Config{
|
||||||
BotToken: "YOUR_BOT_TOKEN_HERE",
|
BotToken: "YOUR_BOT_TOKEN_HERE",
|
||||||
AdminChatId: 0,
|
AdminChatId: 0,
|
||||||
TargetChatId: 0,
|
TargetChatId: 0,
|
||||||
EntryMessage: "You have requested to join the group, please write a brief message explaining why you want to join.",
|
EntryMessage: "You have requested to join the group, please write a brief message explaining why you want to join.",
|
||||||
|
ApprovalMessage: "",
|
||||||
}
|
}
|
||||||
|
|
||||||
encoder := yaml.NewEncoder(f)
|
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
|
edit.ParseMode = api.ModeMarkdown
|
||||||
bot.API.Send(edit)
|
bot.API.Send(edit)
|
||||||
|
|
||||||
m := api.NewMessage(user.From.ID, bot.Config.ApprovalMessage)
|
if bot.Config.ApprovalMessage != "" {
|
||||||
m.ParseMode = api.ModeMarkdown
|
m := api.NewMessage(user.From.ID, bot.Config.ApprovalMessage)
|
||||||
bot.API.Send(m)
|
m.ParseMode = api.ModeMarkdown
|
||||||
|
bot.API.Send(m)
|
||||||
|
}
|
||||||
|
|
||||||
case "reject":
|
case "reject":
|
||||||
r := api.DeclineChatJoinRequest{
|
r := api.DeclineChatJoinRequest{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue