Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

add ping with response time example #30

Merged
merged 1 commit into from Oct 21, 2016

Conversation

greenbigfrog
Copy link
Contributor

No description provided.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

a truly stunning work

Copy link
Contributor

@RX14 RX14 left a comment

Choose a reason for hiding this comment

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

Is this really a significant metric?

# We first create a new Message, and then we check how long it took to send the message by comparing it to the current time
m = client.create_message(payload.channel_id, "Pong!")
time = Time.utc_now - payload.timestamp
client.edit_message(m.channel_id, m.id, "Pong! Time taken: #{time.seconds}.#{time.milliseconds} seconds.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Use a time format here

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not possible for TIme Spans (I'll push other way/fix in a minute)

@clickbait
Copy link

imo this could go inside the multicommand example, as it's not a very significant example

@colinrioux
Copy link
Contributor

@neko Or it could go with the current ping example (ping.cr), since they are both ping examples. Unless ping.cr is meant to be simplistic and easy, then this example would fit better in multicommand.cr.

@RX14
Copy link
Contributor

RX14 commented Oct 20, 2016

Ping example is meant to be the first, simple, example: listen for x, respond with y.

Copy link
Contributor

@RX14 RX14 left a comment

Choose a reason for hiding this comment

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

Squash these two

Copy link
Contributor

@RX14 RX14 left a comment

Choose a reason for hiding this comment

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

examples/ping_with_response_time.cr

@RX14
Copy link
Contributor

RX14 commented Oct 21, 2016

its k

@meew0 meew0 merged commit e5915a9 into discordcr:master Oct 21, 2016
@greenbigfrog greenbigfrog deleted the ping-with-response-time branch October 21, 2016 17:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants