Skip to content

Instantly share code, notes, and snippets.

bot.use(posts());
bot.command('papin', async (c) => {
c.replyWithPhoto(new InputFile('/example/Georges_Perec.jpg'))
.then(async update => {
c.api.raw.deleteMessage({
chat_id: update.chat.id,
message_id: update.message_id
})
update.photo.sort((a, b) => b.height * b.width - a.height * a.width)
const fileTelegramPath = (await c.api.raw.getFile({ file_id: update.photo[0].file_id })).file_path
@carafelix
carafelix / enum.ts
Last active May 25, 2024 03:40
Typescript Enum for all ISO 639-1 language codes
// https://www.loc.gov/standards/iso639-2/php/code_list.php
enum Langs {
Abkhazian = "ab",
Afar = "aa",
Afrikaans = "af",
Akan = "ak",
Albanian = "sq",
Amharic = "am",
Arabic = "ar",
Aragonese = "an",
@carafelix
carafelix / README.md
Last active March 23, 2024 05:20
All default VS code file.associations

Pulled from VS Code official repository which itself pulls from Seti UI repository. It's possible to manually edit the vs-seti-icon-theme.json file located in $VSCODE_PATH/resources/app/extensions/theme-seti/icons/vs-seti-icon-theme.json. WithVSCODE_PATH being the installation folder. In Linux defaults to /usr/share/code/

Anytime you wonder which and where were all the file.associations for customizing the file extension icons in VS Code? Well here they are.

Your settings.json would look the following example (first one being place holders and the second one being a working icon file association)

"files.associations": {
        "REGEX_PATTERN": "FILE.ASSOCIATION",
        "*.xcu": "xml"