Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TelegramAgent FormConfigurable, DryRunable and add logging #2138

Merged
merged 1 commit into from
Oct 3, 2017

Conversation

dsander
Copy link
Collaborator

@dsander dsander commented Sep 30, 2017

Makes the Agent easier to use and to debug. It now verifies the API token and auto completes the chat_id.

Log entries are only created on failure to avoid cluttering the Agent log.

#2135

@dsander dsander requested a review from knu September 30, 2017 15:13
Copy link
Member

@knu knu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@@ -68,18 +84,23 @@ def telegram_bot_uri(method)
end

def receive_event(event)
TELEGRAM_ACTIONS.each do |field, method|
messages_send = TELEGRAM_ACTIONS.map do |field, method|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could say messages_sent = TELEGRAM_ACTIONS.count do |field, method| here and change the condition below from if messages_send.empty? to if messages_sent.zero?.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea

Makes the Agent easier to use and to debug. It now verifies the API
token and auto completes the `chat_id`.

Log entries are only created on failure to avoid cluttering the Agent
log.

 huginn#2135
@dsander
Copy link
Collaborator Author

dsander commented Oct 3, 2017

Thanks for the review!

@dsander dsander merged commit 1448f15 into huginn:master Oct 3, 2017
@dsander dsander deleted the improve-telegram-agent branch October 3, 2017 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants