Giter VIP home page Giter VIP logo

kevinnovak / friend-time Goto Github PK

View Code? Open in Web Editor NEW
63.0 6.0 25.0 4.62 MB

Discord bot - Friend Time helps your server coordinate times and events by converting times mentioned in chat between time zones!

Home Page: https://novakevin.gitbook.io/friend-time

License: Other

TypeScript 99.89% Dockerfile 0.11%
discord discord-bot momentjs chatbot time timezone zones discord-js discordbot timezones

friend-time's Introduction

Friend Time

top.gg top.gg discord.js License Stars Pull Requests

Discord bot - Friend Time helps your server coordinate times and events by converting times mentioned in chat between time zones!

Documentation | Support Server | Donate with PayPal

Introduction

If you have a discord server with users across multiple countries and time zones then this is the bot for you! With Friend Time you can easily coordinate times between users.

Friend Time will automatically react with a clock emoji (🕰️) to times mentioned in chat:

Example usage

By also reacting, you will be private messaged with the time converted to your time zone:

Example time conversion

Features

  • Automatically reacts with a clock emoji (️️🕰️) to times mentioned in chat.
    • Clicking the clock emoji converts the time to your time zone.
    • Sent in a direct message.
  • A time zone list where you can set up to 10 time zones to always convert to.
    • Sent in the server channel.
  • Reminders for users to set their time zones.
    • Servers and users can disable this reminder if desired.
  • Set time zones for other users or even bots!
  • A private mode for users who don't want to expose their location.
  • Customize the appearance of times (12 or 24 hour).
  • Support for multiple languages.

Documentation

Please see the documentation site for more detailed information on how to use Friend Time.

Self-Hosting

If you'd like to run your own copy of Friend Time for development or personal reasons, see the self-hosting guide.

friend-time's People

Contributors

davi-the-mudkip avatar kevinnovak avatar scottbucher avatar uxster avatar woelfivw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

friend-time's Issues

Daylights savings time is not calculated

When times are entered as EST or ET, daylights savings is not automatically calculated. Even worse, if users select their time zone based on a region like America/New York, it defaults to the DST off time zone.

This is an issue because half the world is on an adjusted daylights time and most of my users are inputting their location or a non daylights time causing an hour off difference.

DST should automatically be calculated or this bot is useless for half the year.

Send reminder to set time zone in direct message rather than public chat

I wanted to know if there was a way that the bot will only send reminders to a certain role that doesn't have their time rather then everyone in the server? I manage a server where we have a general chat for everyone and a specific chat for gamers and i only want reminders to go out to certain members not all.

user not found

a new member of our discord server is attempting to set their time zone, we've checked to make sure they are using the correct format:

-ft set

but they are getting an error message that states "user not found"

i'm sorry i dont have any screenshots

Incorrect time returned from using "ago"

The use of "ago" (for example 1 hour ago) returns incorrect time.

Have checked that -ft time returns the correct time, so there's no telling where the bot got the time from for "ago".

Please see screenshot for the problem in action.

Discord_EZYDZG6U8E

Handle direct message failures if user has blocked bot or enabled privacy settings for the server

The bot uses DM's to convey information and sometimes I've noticed that users in my server have elevated privacy settings. With this, the bot can't DM them regarding the time in their timezone. It was really hard to figure out what happened and I thought it would be better to add an error handler if the bot can't open a DM with the target user. I wish I could have contributed more in this issue but since I am not that experienced in discord.js, I wouldn't know how to patch the situation.

Offline

This bot is exactly what I need to organise my clan. It worked great for the first 5 minutes and has been Offline since.

In order to use it effectively I need it online 24/7 like other bots. Is this possible?

Add more advanced reporting features

The community I'm currently organizing has users across the globe and meets regularly. It would be amazing if we could use the data from friendtime to see where the majority of our users were located to plan events according to the times they were most likely to be available. For this use case, a feature that could generate a table with a list of timezones existing on my server, and a count of the number of users in each timezone would be a really helpful, neat addition.

Support for "h" separator in time

Hello,
Thank you for the work and the help that you bring with!

The following two formats are not supported by the bot:

  • 17 h 42
  • 17h42

J'aurais aimer voir le même comportement que:
4pm
4 pm

Thanks again for your work! :)

24 hour time format

Feature Request:
Is it possible that the bit could be updated to also recognise and handle 24 hour time?

Time detection / parsing (yearly salary)

One message that the bot reacted to:

image

I was wondering what it could have thought was a time in there (my best guess was "year"), but it responded with this:

image

had a base salary of $927,000 a year.

It detected the part of the salary after the comma, a space, and the letter "a" and interpreted that as midnight (I assume, since NL and US are six hours apart).

I would suggest that any commas that are part of a formatted numeric string (including currency signs, decimal points, commas, negative signs, and numeric characters) not be considered as a time.


It's also a side note, but 000 (a|p) both parse as valid times (noon and midnight). I don't know of any time format that represents time in quite this way. The mixture of three digits and meridian indicator doesn't seem to work for non-zero digits (for example, 111 a is not picked up by the bot as a valid time).

Option for answer in Chat or DM

Since my server has quiet a few people using the bot, I would like to have the bot announce the time in the chat like it did in the past.
So I'd like a config option for switching between the old message and dm'ing.

Add a license

It would be beneficial if you included a LICENSE file for your project (and mentioned in the README it only applies to the code, not the image assets).

Without a LICENSE in place, the code is implicitly All Rights Reserved, which means people cannot fork your code and legally make contributions to your repo.

I would suggest, as I always do, the GPLv3. Here are the instructions for including a LICENSE in your repo: https://www.gnu.org/licenses/gpl-howto.html

Compare time of a user to self, time for self to a user, or one user to another user

It would be a great idea to have a command to compare the a compare a specific time of a user to yourself, a specific time for yourself to another user, or from one user to another user.

Currently with the -ft time command this is not possible, since it only shows the current time.

This idea comes from Hyperion_21#1503 (526120327697268736).

Situations:

  • When it is 10pm for me, what time is it for @User?
  • When it is 10pm for @User, what time is it for me?
  • When it is 10pm for @UserOne, what time is it for @UserTwo?

Command Suggestion:
-ft convert me to <@user> <time>
-ft convert <@user> to me <time>
-ft convert <@user> to <@user> <time>

  • "me" could also be "self", or neither and instead require the user the mention their own name, or support both.
  • Might need to use regex to match the "to" format, in the case that the user mentioned has a space in it.
  • How can the be captured by regex? Do we run time parser on the whole string?

Bonus: Support Time Zones as Well:
-ft convert me to America/New_York <time>
-ft convert America/New_York to me <time>
-ft convert America/New_York to America/Chicago <time>

Response message to `-ft set timezone` makes little sense

The introductory message calls to action:

-> Set your time zone by using the -ft set command!

Since there is no syntax diagram offered etc, I immediately type:

# -ft set America/Los_Angeles

This comes back with:

-> This command can only be used in a server.

At this point I'm trying to figure how to talk to the bot in a server-specific way, and am ratholed re: using the bot.

Possible Improvements to alleviate:

1 - Give more explicit instructions. "Set your time zone by typing -ft set" or some similar construction. A command takes arguments. Something you just ask the user to type is more explicit.

2 - If someone types -ft set <explicit_TZ> just work. I know this is theoretically hard because almost any string is a valid TZ at least from the libc specification, but realistically for your design you could limit this to the well-formed time zones you expect from your map.

Reply instead of message

Feature request:
How hard would it be to change all the direct messages in to one reply to a message?

Example

mattben
guys is 4pm good?

mattben guys is 4pm good?
Friend Time
4pm pst is 5pm mnt, 7pm est, 12am gmt

Distinguish timezone of user triggering bot

Enhancement/feature Request:

The app is incredibly useful but one thing I feel is sorely needed is the ability to distinguish the timezone/location of the user that triggered the bot in the first place. If there's a lot of text or multiple time zones are entered into a messages (only the first time entered is converted) then it can get a little tricky.

Would it be possible to have the time zone of the user that triggered the bot to have their time zone and location displayed in the first line followed by a visual line break (even a single "-" would work) before the rest of the time zones and locations are displayed?

Output channels options?

Possible to have an option to change the output channel or limit to direct responses for users setting zones and the like?

Bot going down

Time Bot seems to go down quite often. Everyday for hours on end. Is there a way to host it locally?

Users timezone still applies after leaving server

Nathan (Discord): "Hey just a quick question, i had a member in Discord that registered their country with Friend Time bot, but they have now left Discord, i'm still getting their time display when i use this, how can i remove that country time?"

NovaKevin: "If someone else in the server has their timezones set as that it will still show up, but if they left the server while the bot was down then there could be a problem. I'd need your server ID to manually remove the timezone

https://support.discordapp.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-"

Automatically correct inapplicable time zones

People frequently can't use timezones correctly.

They refer to "3pm pst" when DST is in effect. The bot takes this literally and conversion is then an hour out, because they really meant "3pm pdt".

The bot needs to assume people are wrong when they use time zones in a time period where they are not in effect. For example, if they specify "3pm pst", assume they meant "3pm pt" ("3pm pdt") if the Pacific time zone on that date (and time) is PDT.

No amount of telling people that they're using the wrong time zone will get them to specify time correctly.

TZ abbreviations?

It's kindof annoying how we have to use location names and can't really use TZ abbreviations. Surely it's possible to have both able to be mapped.

friend time not working

So recently on a friend's server friend time just suddenly stopped working and so we tried to kick it and invite it back to see if it would work but all we got was this. please help
friend

Canary Islands timezone missing

Since Canary Islands are part of Spain but do have different timezones I would like to ask for a timezone like Europe/Canary. I can use Dublin for now, sure, but can be confusing sometimes.

No need to trigger friend time when "in" is used

It makes sense to make conversions when an explicit time is mentioned, for example: 8pm.

But it doesn't make sense to trigger a conversion when somebody says: in 15 minutes.

Every time a user says "in X time-unit" friend bot converting the time in chat is messy. Can something be done about this?

Error in "am / pm"

hello,

There are errors in indicating the time, for example, these:
1.
изображение

But in reality:
Europe/Riga: 11:00 pm
Europe/Moscow: 12:00 pm

изображение

But in reality:
Europe/Riga: 12:00 am
Europe/Moscow: 1:00 pm

Auto-detect daylight savings time

Typing in “1pm PT” results in “1pm PT: 5 pm ET, etc” which is wrong (it should be 4 pm ET, etc)

Typing in “1pm MT” results in only “1pm” being read, and the time zones are set against the user’s time zone.

offline

Is this temporary that the bot is offline? my server relies heavily on this bot.

Bot not setting time zones for users

I'm on a Discord server that currently uses this bot. And I noticed that after running -ft set America/Denver to set my time zone, it returned this error:

User not found.

Incorrect date in time conversions

From Pack#3138:

Have someone from Japan, just noticed that the Date is a day behind

America/Los_Angeles: Thu, Feb 13, 2020 11:00 AM
America/Edmonton: Thu, Feb 13, 2020 12:00 PM
America/New_York: Thu, Feb 13, 2020 2:00 PM
Europe/Amsterdam: Thu, Feb 13, 2020 8:00 PM
Europe/Stockholm: Thu, Feb 13, 2020 8:00 PM
Asia/Tokyo: Fri, Feb 14, 2020 4:00 AM

Change "America" to "Americas"

Some users find it confusing to see cities out the US appended with America/ given the strong association of America = USA, for example America/Winnipeg

Would it be possible to change America to Americas to be more clear that the region is for North and South America?

Can't set time zone to UTC

I use UTC on my PCs.

Had this nice conversation with the bot:

image

The linked timezone picker shows UTC, but as you can see the bot doesn't accept that answer.

Support for threads

Currently the bot can be added to threads by pinging, however once added the bot doesn't parse any messages inside of those threads.

Set time zones of other users

I'd like to be able to set a user's time zone myself instead of teaching the entire server how to follow directions.
So say -ft @user set [timezone]??

Offer an explicit trigger for timezone list

Sometimes the Friend-Time bot will list timezones for a time mentioned in a message even when it's not particularly helpful. For example, say I message a channel

I was planning on leaving in 5 minutes

Friend-Time will trigger on "in 5 minutes" and list all the times in the server list. That can get kinda annoying. It would be nice if the timezone list feature could have an explicit trigger - something similar to the "react with ⏰" behavior that it uses for DMs. That way people in the server can prevent false positives.

If we think this is a worthwhile feature, I'm willing to help with a PR (just need some pointers 😅)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.