This repository has been archived by the owner on May 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
178 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
{ | ||
"widget_token": "", | ||
"guild_id": 1, | ||
"icon_id": null | ||
"clusters": [ | ||
{ | ||
"widget_token": "", | ||
"guild_id": 1, | ||
"icon_id": "" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
import { Widget } from "./modules/Widget"; | ||
|
||
const updateWidget = () => { | ||
const widget = new Widget(); | ||
import config from "./config.json"; | ||
|
||
widget.updateWidget(); | ||
}; | ||
config.clusters.forEach((cluster, index) => { | ||
cluster.index = index + 1; | ||
|
||
updateWidget(); | ||
const updateWidget = () => { | ||
const widget = new Widget(cluster); | ||
|
||
setInterval(updateWidget, 15 * 60 * 1000); // Обновление виджета происходит раз в 15 минут, так как информация о гильдии обновляется раз в 10-15 минут. | ||
widget.updateWidget(); | ||
}; | ||
|
||
console.log("[VimeWidget] Запущен!"); | ||
updateWidget(); | ||
|
||
// | ||
// Made with ♥ by MrZillaGold (https://vk.com/mrzillagold) | ||
// | ||
// VimeWidget доступен по лицензии Creative Commons «Attribution-NonCommercial-ShareAlike» | ||
// («Атрибуция — Некоммерческое использование — На тех же условиях») 4.0 Всемирная. | ||
// | ||
setInterval(updateWidget, 15 * 60 * 1000); | ||
// Обновление виджета происходит раз в 15 минут, так как информация о гильдии обновляется раз в 10-15 минут. | ||
|
||
}); | ||
|
||
console.log("[VimeWidget] Запущен!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// https://gist.github.com/realmyst/1262561#gistcomment-2299442 | ||
export function declOfNum(n, titles) { | ||
return titles[(n % 10 === 1 && n % 100 !== 11) ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2]; | ||
} | ||
|
||
export function humanizeDate(time) { | ||
const currentDate = new Date(time * 1000); | ||
|
||
const day = currentDate.getDate(); | ||
const month = currentDate.getMonth() + 1; | ||
const year = currentDate.getFullYear(); | ||
|
||
const hours = currentDate.getUTCHours() + 3; | ||
const minutes = currentDate.getMinutes(); | ||
const seconds = currentDate.getSeconds(); | ||
|
||
return `${pad(day)}.${pad(month)}.${year} ${pad(hours)}:${pad(minutes)}:${pad(seconds)}`; | ||
} | ||
|
||
export function pad(number) { | ||
return (number > 9 ? "" : "0") + number; | ||
} | ||
|
||
export const TOP_TYPES = [ | ||
"level", | ||
"total_coins" | ||
]; | ||
|
||
export const ranks = new Map([ | ||
["PLAYER", ""], | ||
["VIP", "VIP"], | ||
["PREMIUM", "Premium"], | ||
["HOLY", "Holy"], | ||
["IMMORTAL", "Immortal"], | ||
["BUILDER", "Билдер"], | ||
["MAPLEAD", "Гл. билдер"], | ||
["YOUTUBE", "YouTube"], | ||
["DEV", "Dev"], | ||
["ORGANIZER", "Организатор"], | ||
["MODER", "Модер"], | ||
["WARDEN", "Модер"], | ||
["CHIEF", "Гл. модер"], | ||
["ADMIN", "Гл. админ"] | ||
]); |
Oops, something went wrong.