Publish module beta #14
Loading…
Reference in New Issue
No description provided.
Delete Branch "bro-features"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Publish system patch preview
The publish module intend to be a "multi-pin" feature for chats, allowing users to retrieve importants messages in a crowded conversation.
Commands
Subscribe
Description : Subscribe to this group chat publications
Usage location : Group chat only
Command syntax : /subscribe
Unsubscribe
Description : Unsubscribe [target chat member] from this group chat publications. If no member is provided, unsubscribe yourself.
Usage location : Group chat
Command syntax : /unsubscribe [target chat member]
note : parameter [target chat member] not implemented
ListSubscribers
Description : List all subscribers of this group chat
Usage location : Group chat
Command syntax : /listsubscribers
Publish
Description : Publish a message to Alfred for this group chat and sends this message via MP to every subscriber of the group chat. The message can then be retrieved using the retrieve command.
Usage location : Group chat only
Usage conditions : Reply to the message to publish
Command syntax : /publish
note : MP not implemented
Unpublish
Description : Remove a published message from Alfred for this group chat
Usage location : Group chat only
Command syntax : /unpublish [publication ID]
Retrieve
Description : if MP, retrieve all messages from subscribed sources for user, if Group Chat, retrieve all published messages for this chat
Usage location : Group Chat or MP
Command syntax : /retrieve
Can you add all the documentation in a README file inside commands ?
@ -61,6 +67,7 @@ func main() {
b.Handle(key, value)
}
log.Println("token : " + settings.Settings["token"].(string))
To be removed
@ -0,0 +1 @@
aethor@pc60.home.13981:1546264820
This is wierd
@ -0,0 +29,4 @@
userSubscribedChats, exists := shared.Users.Get(m.Sender.Username, "subscribed_chats")
if !exists {
shared.Bot.Send(m.Chat, "Abonnement au chat : "+m.Chat.Title)
shared.Users.Set(m.Sender.Username, "subscribed_chats", strconv.FormatInt(m.Chat.ID, 10))
What is 10 ? If it's important, can you make a constant ?
mmh a constant would not fit, it's just an argument saying it's in base 10 for the conversion
Oh, yeah, I've not seen the strconv
@ -0,0 +70,4 @@
shared.Users.Set(m.Sender.Username, "subscribed_chats", strings.Join(splittedChats, ":"))
}
// List all subscribers of the current chat
Always use the name of the function first in functions comments, here : ListSubscribers list all subscribers of the current chat
@ -0,0 +106,4 @@
// Remove a message from published messages in the current chat
// Command syntax : /unpublish [publication ID]
func Unpublish(m *tb.Message) {
Unpublish remove a message from published messages
@ -0,0 +131,4 @@
shared.Bot.Send(m.Chat, "Message supprimé des publication")
}
// If performed in MP : retrieve all messages from all subscribed sources for the user
Start the command with Retrieve
@ -61,6 +61,17 @@ func (u users) Set(username string, key, data string) {
go uf.write()
}
// Get all known usernames
GetUsernames get all usernames stored in the settings
Just the doc and it's ready