Compare commits
2 commits
5f97b11571
...
f7d7b66cf6
Author | SHA1 | Date | |
---|---|---|---|
f7d7b66cf6 | |||
eefc750f3a |
5 changed files with 60 additions and 57 deletions
88
package-lock.json
generated
88
package-lock.json
generated
|
@ -22,8 +22,8 @@
|
||||||
"uuid": "^10.0.0"
|
"uuid": "^10.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "~8.7.0",
|
"@typescript-eslint/eslint-plugin": "~8.6.0",
|
||||||
"@typescript-eslint/parser": "~8.7.0",
|
"@typescript-eslint/parser": "~8.6.0",
|
||||||
"dotenv": "~16.4.5",
|
"dotenv": "~16.4.5",
|
||||||
"prettier-eslint": "~16.3.0",
|
"prettier-eslint": "~16.3.0",
|
||||||
"ts-node-dev": "~2.0.0"
|
"ts-node-dev": "~2.0.0"
|
||||||
|
@ -616,17 +616,17 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||||
"version": "8.7.0",
|
"version": "8.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.6.0.tgz",
|
||||||
"integrity": "sha512-RIHOoznhA3CCfSTFiB6kBGLQtB/sox+pJ6jeFu6FxJvqL8qRxq/FfGO/UhsGgQM9oGdXkV4xUgli+dt26biB6A==",
|
"integrity": "sha512-UOaz/wFowmoh2G6Mr9gw60B1mm0MzUtm6Ic8G2yM1Le6gyj5Loi/N+O5mocugRGY+8OeeKmkMmbxNqUCq3B4Sg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/regexpp": "^4.10.0",
|
"@eslint-community/regexpp": "^4.10.0",
|
||||||
"@typescript-eslint/scope-manager": "8.7.0",
|
"@typescript-eslint/scope-manager": "8.6.0",
|
||||||
"@typescript-eslint/type-utils": "8.7.0",
|
"@typescript-eslint/type-utils": "8.6.0",
|
||||||
"@typescript-eslint/utils": "8.7.0",
|
"@typescript-eslint/utils": "8.6.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.7.0",
|
"@typescript-eslint/visitor-keys": "8.6.0",
|
||||||
"graphemer": "^1.4.0",
|
"graphemer": "^1.4.0",
|
||||||
"ignore": "^5.3.1",
|
"ignore": "^5.3.1",
|
||||||
"natural-compare": "^1.4.0",
|
"natural-compare": "^1.4.0",
|
||||||
|
@ -650,16 +650,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser": {
|
"node_modules/@typescript-eslint/parser": {
|
||||||
"version": "8.7.0",
|
"version": "8.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.6.0.tgz",
|
||||||
"integrity": "sha512-lN0btVpj2unxHlNYLI//BQ7nzbMJYBVQX5+pbNXvGYazdlgYonMn4AhhHifQ+J4fGRYA/m1DjaQjx+fDetqBOQ==",
|
"integrity": "sha512-eQcbCuA2Vmw45iGfcyG4y6rS7BhWfz9MQuk409WD47qMM+bKCGQWXxvoOs1DUp+T7UBMTtRTVT+kXr7Sh4O9Ow==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "8.7.0",
|
"@typescript-eslint/scope-manager": "8.6.0",
|
||||||
"@typescript-eslint/types": "8.7.0",
|
"@typescript-eslint/types": "8.6.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.7.0",
|
"@typescript-eslint/typescript-estree": "8.6.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.7.0",
|
"@typescript-eslint/visitor-keys": "8.6.0",
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
@ -679,14 +679,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/scope-manager": {
|
"node_modules/@typescript-eslint/scope-manager": {
|
||||||
"version": "8.7.0",
|
"version": "8.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.6.0.tgz",
|
||||||
"integrity": "sha512-87rC0k3ZlDOuz82zzXRtQ7Akv3GKhHs0ti4YcbAJtaomllXoSO8hi7Ix3ccEvCd824dy9aIX+j3d2UMAfCtVpg==",
|
"integrity": "sha512-ZuoutoS5y9UOxKvpc/GkvF4cuEmpokda4wRg64JEia27wX+PysIE9q+lzDtlHHgblwUWwo5/Qn+/WyTUvDwBHw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.7.0",
|
"@typescript-eslint/types": "8.6.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.7.0"
|
"@typescript-eslint/visitor-keys": "8.6.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
@ -697,14 +697,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/type-utils": {
|
"node_modules/@typescript-eslint/type-utils": {
|
||||||
"version": "8.7.0",
|
"version": "8.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.6.0.tgz",
|
||||||
"integrity": "sha512-tl0N0Mj3hMSkEYhLkjREp54OSb/FI6qyCzfiiclvJvOqre6hsZTGSnHtmFLDU8TIM62G7ygEa1bI08lcuRwEnQ==",
|
"integrity": "sha512-dtePl4gsuenXVwC7dVNlb4mGDcKjDT/Ropsk4za/ouMBPplCLyznIaR+W65mvCvsyS97dymoBRrioEXI7k0XIg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/typescript-estree": "8.7.0",
|
"@typescript-eslint/typescript-estree": "8.6.0",
|
||||||
"@typescript-eslint/utils": "8.7.0",
|
"@typescript-eslint/utils": "8.6.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"ts-api-utils": "^1.3.0"
|
"ts-api-utils": "^1.3.0"
|
||||||
},
|
},
|
||||||
|
@ -722,9 +722,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/types": {
|
"node_modules/@typescript-eslint/types": {
|
||||||
"version": "8.7.0",
|
"version": "8.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.6.0.tgz",
|
||||||
"integrity": "sha512-LLt4BLHFwSfASHSF2K29SZ+ZCsbQOM+LuarPjRUuHm+Qd09hSe3GCeaQbcCr+Mik+0QFRmep/FyZBO6fJ64U3w==",
|
"integrity": "sha512-rojqFZGd4MQxw33SrOy09qIDS8WEldM8JWtKQLAjf/X5mGSeEFh5ixQlxssMNyPslVIk9yzWqXCsV2eFhYrYUw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
@ -736,14 +736,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree": {
|
"node_modules/@typescript-eslint/typescript-estree": {
|
||||||
"version": "8.7.0",
|
"version": "8.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.6.0.tgz",
|
||||||
"integrity": "sha512-MC8nmcGHsmfAKxwnluTQpNqceniT8SteVwd2voYlmiSWGOtjvGXdPl17dYu2797GVscK30Z04WRM28CrKS9WOg==",
|
"integrity": "sha512-MOVAzsKJIPIlLK239l5s06YXjNqpKTVhBVDnqUumQJja5+Y94V3+4VUFRA0G60y2jNnTVwRCkhyGQpavfsbq/g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.7.0",
|
"@typescript-eslint/types": "8.6.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.7.0",
|
"@typescript-eslint/visitor-keys": "8.6.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"fast-glob": "^3.3.2",
|
"fast-glob": "^3.3.2",
|
||||||
"is-glob": "^4.0.3",
|
"is-glob": "^4.0.3",
|
||||||
|
@ -765,16 +765,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/utils": {
|
"node_modules/@typescript-eslint/utils": {
|
||||||
"version": "8.7.0",
|
"version": "8.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.6.0.tgz",
|
||||||
"integrity": "sha512-ZbdUdwsl2X/s3CiyAu3gOlfQzpbuG3nTWKPoIvAu1pu5r8viiJvv2NPN2AqArL35NCYtw/lrPPfM4gxrMLNLPw==",
|
"integrity": "sha512-eNp9cWnYf36NaOVjkEUznf6fEgVy1TWpE0o52e4wtojjBx7D1UV2WAWGzR+8Y5lVFtpMLPwNbC67T83DWSph4A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.4.0",
|
"@eslint-community/eslint-utils": "^4.4.0",
|
||||||
"@typescript-eslint/scope-manager": "8.7.0",
|
"@typescript-eslint/scope-manager": "8.6.0",
|
||||||
"@typescript-eslint/types": "8.7.0",
|
"@typescript-eslint/types": "8.6.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.7.0"
|
"@typescript-eslint/typescript-estree": "8.6.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
@ -788,13 +788,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/visitor-keys": {
|
"node_modules/@typescript-eslint/visitor-keys": {
|
||||||
"version": "8.7.0",
|
"version": "8.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.6.0.tgz",
|
||||||
"integrity": "sha512-b1tx0orFCCh/THWPQa2ZwWzvOeyzzp36vkJYOpVg0u8UVOIsfVrnuC9FqAw9gRKn+rG2VmWQ/zDJZzkxUnj/XQ==",
|
"integrity": "sha512-wapVFfZg9H0qOYh4grNVQiMklJGluQrOUiOhYRrQWhx7BY/+I1IYb8BczWNbbUpO+pqy0rDciv3lQH5E1bCLrg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.7.0",
|
"@typescript-eslint/types": "8.6.0",
|
||||||
"eslint-visitor-keys": "^3.4.3"
|
"eslint-visitor-keys": "^3.4.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
"uuid": "^10.0.0"
|
"uuid": "^10.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "~8.7.0",
|
"@typescript-eslint/eslint-plugin": "~8.6.0",
|
||||||
"@typescript-eslint/parser": "~8.7.0",
|
"@typescript-eslint/parser": "~8.6.0",
|
||||||
"dotenv": "~16.4.5",
|
"dotenv": "~16.4.5",
|
||||||
"prettier-eslint": "~16.3.0",
|
"prettier-eslint": "~16.3.0",
|
||||||
"ts-node-dev": "~2.0.0"
|
"ts-node-dev": "~2.0.0"
|
||||||
|
|
|
@ -133,9 +133,17 @@ export default async (message: Message, client: Client) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Footer
|
// Footer
|
||||||
let footer = `Posté le ${showDate(loc, quoted_post.createdAt)}`;
|
let footer = `Posté le ${showDate(
|
||||||
|
message.guild?.preferredLocale ?? client.config.default_lang,
|
||||||
|
loc,
|
||||||
|
quoted_post.createdAt,
|
||||||
|
)}`;
|
||||||
if (quoted_post.editedAt) {
|
if (quoted_post.editedAt) {
|
||||||
footer += ` et modifié le ${showDate(loc, quoted_post.editedAt)}`;
|
footer += ` et modifié le ${showDate(
|
||||||
|
message.guild?.preferredLocale ?? client.config.default_lang,
|
||||||
|
loc,
|
||||||
|
quoted_post.editedAt,
|
||||||
|
)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
let author = "Auteur";
|
let author = "Auteur";
|
||||||
|
@ -143,6 +151,7 @@ export default async (message: Message, client: Client) => {
|
||||||
author += " & Citateur";
|
author += " & Citateur";
|
||||||
} else {
|
} else {
|
||||||
footer += `\nCité par ${userWithNickname(message.member!) ?? "?"} le ${showDate(
|
footer += `\nCité par ${userWithNickname(message.member!) ?? "?"} le ${showDate(
|
||||||
|
message.guild?.preferredLocale ?? client.config.default_lang,
|
||||||
loc,
|
loc,
|
||||||
message.createdAt,
|
message.createdAt,
|
||||||
)}`;
|
)}`;
|
||||||
|
|
|
@ -414,6 +414,7 @@ export const embedListReminders = async (
|
||||||
const expiration = `${loc.get("c_reminder8")} ${timeDeltaToString(remind.expiration_date)}`;
|
const expiration = `${loc.get("c_reminder8")} ${timeDeltaToString(remind.expiration_date)}`;
|
||||||
embed.addFields({
|
embed.addFields({
|
||||||
name: `#${remind.id} • ${loc.get("c_reminder9")} ${showDate(
|
name: `#${remind.id} • ${loc.get("c_reminder9")} ${showDate(
|
||||||
|
local,
|
||||||
loc,
|
loc,
|
||||||
new Date(Number(remind.creation_date)),
|
new Date(Number(remind.creation_date)),
|
||||||
)}\n${expiration}`,
|
)}\n${expiration}`,
|
||||||
|
|
|
@ -5,15 +5,8 @@
|
||||||
* @param date Date
|
* @param date Date
|
||||||
* @returns String
|
* @returns String
|
||||||
*/
|
*/
|
||||||
export const showDate = (locale: Map<string, unknown>, date: Date) => {
|
export const showDate = (tz: string, locale: Map<string, unknown>, date: Date) =>
|
||||||
const timezoned = new Date(date.getTime() + date.getTimezoneOffset() * 60000);
|
date.toLocaleString(tz).replace(" ", ` ${locale.get("u_time_at")} `);
|
||||||
|
|
||||||
console.log(date.getTimezoneOffset());
|
|
||||||
|
|
||||||
return `${timezoned.toDateString()} ${locale.get("u_time_at")} ${
|
|
||||||
timezoned.toTimeString().split(" ")[0]
|
|
||||||
}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum TimeSecond {
|
enum TimeSecond {
|
||||||
Year = 31536000,
|
Year = 31536000,
|
||||||
|
|
Loading…
Reference in a new issue