Add automatic publish notification #17

Merged
klmp200 merged 5 commits from bro-features into master 2019-01-02 23:03:57 +00:00
Owner
No description provided.
bro requested changes 2019-01-02 22:24:57 +00:00
bro left a comment
Member

minor tweaks

minor tweaks
@ -243,19 +320,74 @@ func Retrieve(m *tb.Message) {
shared.Bot.Send(m.Chat, "--- Messages publiés ---")
}
// ToggleUpdates activate/deactivate automatic updates from the chat it's emmited
Member

ToggleUpdates activate/deactivate automatic updates from the current chat

(just to keep consistency with the other descriptions, i'm a consistency nazi sorry mate)

ToggleUpdates activate/deactivate automatic updates from the current chat (just to keep consistency with the other descriptions, i'm a consistency nazi sorry mate)
doc/publish.md Outdated
@ -37,3 +37,3 @@
### 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.
**Description** : Publish a message to Alfred for this group chat and sends this message via MP to every subscriber of the group chat if the have not mutted it. The message can then be retrieved using the *retrieve* command.
Member

if they* have not muted* it

if they* have not muted* it
doc/publish.md Outdated
@ -68,0 +71,4 @@
**Command syntax** : /toggleupdates
**note** : No notification can be send if the user has never done /registerprivate on a private chat with the bot, this is a limitation of the telegram bot API.
Member

note instead of note to be consistent (I know)

*note* instead of **note** to be consistent (I know)
shared/users.go Outdated
@ -4,2 +4,2 @@
* @Last Modified by: klmp200
* @Last Modified time: 2018-07-24 17:49:51
* @Last Modified by: Bartuccio Antoine
* @Last Modified time: 2019-01-02 22:37:58
Member

I hate your fkin headers x) <3

I hate your fkin headers x) <3
Author
Owner

2 swag 4 u <3

2 swag 4 u <3
krophil approved these changes 2019-01-02 22:48:07 +00:00
krophil left a comment
First-time contributor

Well done!

Well done!
@ -50,6 +116,7 @@ func setPublishedMessages(chatID int64, messages []tb.Message) {
// Subscribe user sending the command to the current chat
// Command syntax : /subscribe
func Subscribe(m *tb.Message) {
First-time contributor

Why an entry?!

:P

Why an entry?! :P
Author
Owner

For lisibility :)

For lisibility :)
@ -100,0 +168,4 @@
subscriptions := getUserSubscribedChats(m.Sender.Username)
if len(subscriptions) == 0 {
shared.Bot.Send(m.Chat, "Vous n'êtes abonnés à aucun chat")
First-time contributor

-s if you're talking to the user :)

-s if you're talking to the user :)
Author
Owner

👍

:+1:
@ -231,2 +306,4 @@
for _, sub := range chatList {
messages := getPublishedMessages(sub.ChatID)
if len(messages) > 0 {
hasMessage = true
First-time contributor

Désolé de ma méconnaissance mais y'a pas un genre de ternaire pour éviter une grosse condition pour ça ?

Désolé de ma méconnaissance mais y'a pas un genre de ternaire pour éviter une grosse condition pour ça ?
Author
Owner

Nope, c'est fait exprès dans le design du langage

Nope, c'est fait exprès dans le design du langage
bro approved these changes 2019-01-02 22:48:31 +00:00
bro requested changes 2019-01-02 22:55:58 +00:00
@ -0,0 +16,4 @@
func RegisterPrivate(m *tb.Message) {
if m.Chat.Type != tb.ChatPrivate {
shared.Bot.Send(m.Chat, "Cette commande n'est disponnible qu'en messages privés")
Member

disponible*

disponible*
@ -0,0 +31,4 @@
func UnRegisterPrivate(m *tb.Message) {
if m.Chat.Type != tb.ChatPrivate {
shared.Bot.Send(m.Chat, "Cette commande n'est disponnible qu'en messages privés")
Member

disponible*

disponible*
klmp200 closed this pull request 2019-01-02 23:03:56 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ALFRED/ALFRED#17
No description provided.