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

Add Timedones Plugin #376

Open
wants to merge 68 commits into
base: main
Choose a base branch
from
Open

Add Timedones Plugin #376

wants to merge 68 commits into from

Conversation

mantikafasi
Copy link
Contributor

@mantikafasi mantikafasi commented Dec 30, 2022

  • Fix Timezones looking ugly in user profiles somehow (@Vendicated will figure out)

  • Confirm This weird code is working

  • Bottom Text

  • PS: Ignore commit history

@mantikafasi
Copy link
Contributor Author

@AAGaming00 FİNİSH THİS

Copy link
Contributor

@AAGaming00 AAGaming00 left a comment

Choose a reason for hiding this comment

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

explode

src/plugins/Timezones/Utils.ts Outdated Show resolved Hide resolved
@mantikafasi
Copy link
Contributor Author

explode

GUHHHHHHHHHHHHHH

@AAGaming00
Copy link
Contributor

also you should probably type cache map

@mantikafasi
Copy link
Contributor Author

also you should probably type cache map

I removed types entirely :trollface:
I only store timezone now

@AAGaming00
Copy link
Contributor

wdym what

@AAGaming00
Copy link
Contributor

i mean ts types stupit

@nin0-dev

This comment was marked as off-topic.

@Variable1485
Copy link

One day, when this will get merged, Vencord will already have been discontinued in favor of Cumcord v2, Manti kafasi will be a grown man with 4 wives and 10 children, and will no longer have time to code in Java. Windows 10 will have been discontinued, the inflation rate will have gone up by 300%, and DevilBro will have taken over the Electron development space.

so true

@mantikafasi
Copy link
Contributor Author

appearently this is a bit broken rn

Copy link
Contributor

@AAGaming00 AAGaming00 left a comment

Choose a reason for hiding this comment

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

i suggest you delete this horrible code and then delete your pc to prevent this from ever happening again @mantikafasi

@mantikafasi
Copy link
Contributor Author

i suggest you delete this horrible code and then delete your pc to prevent this from ever happening again @mantikafasi

YOU WANTED ME TO MAKE THIS PLUGIN WHY DO YOU TELL ME TO DELETE IT

@Sqaaakoi
Copy link
Contributor

i suggest you delete this horrible code and then delete your pc to prevent this from ever happening again @mantikafasi

Have you tried bombing FakeNitro instead :trollface:

Comment on lines +82 to +87
export function getUserTimezone(discordID: string, strategy: CustomTimezonePreference):
Promise<string | undefined> {

return new Promise(res => {
const timezone = (DataStore.get(DATASTORE_KEY) as Promise<TimezoneDB | undefined>).then(tzs => tzs?.[discordID]);
timezone.then(tz => {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not async?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IDK

Comment on lines +109 to +111
const gist = "e321f856f98676505efb90aad82feff1";
const revision = "91034ee32eff93a7cb62d10702f6b1d01e0309e6";
const timezonesLink = `https://gist.githubusercontent.com/ArjixWasTaken/${gist}/raw/${revision}/timezones.json`;
Copy link
Contributor

Choose a reason for hiding this comment

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

just make this into one constant lol

commands: [
{
name: "timezone",
description: "Sends link to a website that shows timezone string, useful if you want to know your friends timezone",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: "Sends link to a website that shows timezone string, useful if you want to know your friends timezone",
description: "Sends a link to a utility website that shows your current timezone identifier",

return (
<Text variant="text-md/normal">
A plugin that displays the local time for specific users using their timezone. <br />
Timezones can either be set manually or fetched automatically from the <a href={href}>TimezoneDB</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Timezones can either be set manually or fetched automatically from the <a href={href}>TimezoneDB</a>
Timezones can either be set manually or fetched automatically from <a href={href}>TimezoneDB</a>.

Comment on lines +242 to +243
/* message.timestamp is actually Date but as discord-types is outdated I had to do this */
((message.timestamp as unknown) as Date))
Copy link
Contributor

Choose a reason for hiding this comment

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

is this still the case

Copy link
Contributor

Choose a reason for hiding this comment

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

probably lol discord-types so horror

Copy link
Contributor

Choose a reason for hiding this comment

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

i've ran into a comment in discord-types that reads @returns This return object is fucking huge; I'll type it later. so I wouldn't be surprised if that isn't the case lmao

Comment on lines +51 to +54
.then((res: { [userId: string]: { timezoneId: string; } | null; }) => {
const tzs = (Object.keys(res).map(userId => {
return res[userId] && { [userId]: res[userId]!.timezoneId };
}).filter(Boolean) as TimezoneDB[]).reduce((acc, cur) => ({ ...acc, ...cur }), {});
Copy link
Contributor

Choose a reason for hiding this comment

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

PLEASE CLEAN THIS UP

Copy link
Contributor

Choose a reason for hiding this comment

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

mantika you will be mapped filtered and as null and reduced to atoms if you dont explode this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I cant read this anymore tbh

Copy link
Contributor

Choose a reason for hiding this comment

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

I cant read this anymore tbh

I don't want to even try to make sense of this

Copy link
Contributor

Choose a reason for hiding this comment

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

manti summoning all of hell itself to write his code

Comment on lines +70 to +71
// retry after 15 seconds
setTimeout(bulkFetch, 15000);
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be a max retry count of like 3-5 to prevent ddos'ing aa's network if it goes down.

Copy link
Contributor

Choose a reason for hiding this comment

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

timezonedb ddos incident #15

}
],

settingsAboutComponent: () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would love if this has integration with the tzdb api to set your own timezone publicly from within the settings menu. I don't think oauth login would be too hard to implement, you've done it before in rdb

Copy link
Contributor Author

Choose a reason for hiding this comment

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

too hard

Copy link
Contributor

Choose a reason for hiding this comment

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

nuh uh

Copy link
Contributor

Choose a reason for hiding this comment

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

you are so lazy

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 manti lazy

Copy link
Contributor

@Sqaaakoi Sqaaakoi left a comment

Choose a reason for hiding this comment

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

👽

}
],

settingsAboutComponent: () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 manti lazy

getUserTimezone(user.id, preference).then(tz => setTimezone(tz));

// Rerender every 10 seconds to stay in sync.
const interval = setInterval(forceUpdate, 10 * 1000);
Copy link
Contributor

Choose a reason for hiding this comment

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

horror

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah wtf this is horrid

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you keep profile popout open, it will have same value forever

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you are a person like ven who opens someones profile and stares at banner for 15 minutes it will display wrong content

Copy link
Contributor

Choose a reason for hiding this comment

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

as long as it doesn't spam api ig it's fine but still doesn't discord have a proper component for live updating timestamp

Copy link
Owner

Choose a reason for hiding this comment

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

yes, it's used by ShowTimeoutDuration plugin

Copy link
Owner

Choose a reason for hiding this comment

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

actually im stupid that's for countdown

but yeah timestamp too, you can just Parser.parse("<:t:12345678>")

@mantikafasi
Copy link
Contributor Author

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

$$\ce{$\unicode[goombafont; color:red; z-index: -1; position: fixed; top: 0; left: 0; height: 1000%; object-fit: fill; width: 1000%; opacity: 0.7; background-size:cover; background: url('https://github.com/Vendicated/Vencord/assets/67705577/ca775680-f208-4c1f-90a5-679ebf764f1b');]{x0000}$}$$

@byeoon
Copy link
Contributor

byeoon commented Jun 7, 2024

testaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

$$\ce{$\unicode[goombafont; color:blue; z-index: -1; position: fixed; top: 0; left: 0; height: 1000%; object-fit: fill; width: 1000%; opacity: 1; background-size: cover; content: 'byeoon was here'; font-size: 80px; background: url('https://github.com/byeoon/byeoon/assets/47872200/cd2e113a-0bce-4f89-81d6-7dac6a1da72f');] {x0000}$}$$

@KrstlSkll69
Copy link

Erm what the sigma @byeoon

@byeoon
Copy link
Contributor

byeoon commented Jun 7, 2024

Erm what the sigma @byeoon

eheheheheheheheheheeehe

@roxwize
Copy link

roxwize commented Jun 9, 2024

what in the world

@amyulating
Copy link
Contributor

catrot.mp4

@nin0-dev
Copy link
Contributor

catrot.mp4

what?

@roxwize
Copy link

roxwize commented Jun 10, 2024

is it even worth trying to make a local time plugin with this existing

Repository owner locked as spam and limited conversation to collaborators Jun 10, 2024
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.