MCPcopy
hub / github.com/EverythingSuckz/TG-FileStreamBot / start

Function start

internal/commands/start.go:19–31  ·  view source on GitHub ↗
(ctx *ext.Context, u *ext.Update)

Source from the content-addressed store, hash-verified

17}
18
19func start(ctx *ext.Context, u *ext.Update) error {
20 chatId := u.EffectiveChat().GetID()
21 peerChatId := ctx.PeerStorage.GetPeerById(chatId)
22 if peerChatId.Type != int(storage.TypeUser) {
23 return dispatcher.EndGroups
24 }
25 if len(config.ValueOf.AllowedUsers) != 0 && !utils.Contains(config.ValueOf.AllowedUsers, chatId) {
26 ctx.Reply(u, ext.ReplyTextString("You are not allowed to use this bot."), nil)
27 return dispatcher.EndGroups
28 }
29 ctx.Reply(u, ext.ReplyTextString("Hi, send me any file to get a direct streamable link to that file."), nil)
30 return dispatcher.EndGroups
31}

Callers

nothing calls this directly

Calls 1

ContainsFunction · 0.92

Tested by

no test coverage detected