Terisback / discord.v

Discord Bot Framework written in V
MIT License
120 stars 12 forks source link

Remove deprecated function calls #15

Closed SurmanPP closed 3 years ago

SurmanPP commented 3 years ago

time.sleep_ms is deprecated replace with wait

Terisback commented 3 years ago

This code is invalid :\ You can't wrap the value into a constant, if they were aliases then maybe that would be the solution, but no. I have already written in the review the values of the arguments to be used

Terisback commented 3 years ago

the constants in the "time" package are u64 values, so simply multiplying them by a number will be enough.

Terisback commented 3 years ago

By multiplying 5 by time.second we get exactly 5 seconds

SurmanPP commented 3 years ago

I used the functions from the time package to do this

SurmanPP commented 3 years ago

time.seconds(5) returns the seconds converted to nanoseconds

Terisback commented 3 years ago

I used the functions from the time package to do this

There is no such functions :\

Terisback commented 3 years ago

image

Terisback commented 3 years ago

Only constants with that name in that module image

SurmanPP commented 3 years ago

https://github.com/vlang/v/blob/1a8e502e2c6f87ce4dd07df566cb1f891021ccf0/vlib/time/time.v#L412 There is the seconds function I don't know why it does not work

Terisback commented 3 years ago

https://github.com/vlang/v/blob/1a8e502e2c6f87ce4dd07df566cb1f891021ccf0/vlib/time/time.v#L412 There is the seconds function I don't know why it does not work

It's for Duration type :\

SurmanPP commented 3 years ago

Ups

SurmanPP commented 3 years ago

I changed to constants in the latest commit

Terisback commented 3 years ago

Yes, thanks)