0xbe73eafba762eefa59263dcbde06ab0b2019da2d
UQBu_SyqdPtv3g_GJIq6cHOVjTdWNFReb4iNY_V6r_M-Zp2T
Before execute you must install curl
.
module.exports = (ctx, next) => { | |
switch (ctx.updateType) { | |
case 'message': | |
if (new Date().getTime() / 1000 - ctx.message.date < 5 * 60) { | |
next(); | |
} else { | |
console.log(`Ignoring messages updateType: 'message' from ${ctx.chat.id}`); | |
} | |
break; | |
case 'callback_query': |
const {Context} = require('telegraf'); | |
class Aliases extends Context { | |
constructor(update, telegram, options) { | |
super(update, telegram, options); | |
this.t = telegram; | |
} | |
sendAction(...args) { | |
return super.replyWithChatAction(...args); |
If you are use Unix/Linux create a bash script with a loop. In this case I want to backup the extensions list and install again:
First create a list of the extensions:
$ code --list-extensions > extensions.txt
Create a bash script for example with the name vscode-extension-install.sh
and input the following code:
Aliases ~/.bashrc
or ~/.zshrc
:
alias pmr='sudo reflector -c "Indonesia" -c "Singapore" -c "US" -c "China" --score 100 --latest 25 --sort rate --save /etc/pacman.d/mirrorlist --verbose'
alias update-mirror='pmr && cat /etc/pacman.d/mirrorlist > mirrorlist && gist -u 3ac7c21617513627a906d314f63a7eca mirrorlist'
Just update /etc/pacman.d/mirrorlist
:
$ pmr
Update and push to gist:
<?xml version="1.0" encoding="UTF-8"?> | |
<actions> | |
<action> | |
<icon></icon> | |
<name>Delete/Bypass Recycle Bin</name> | |
<unique-id>1583421083799085-2</unique-id> | |
<command>rmtrash -rf %f %F</command> | |
<description>Description: Removes the selected file(s) from the disk, bypassing any local Recycle bin.</description> | |
<patterns>*</patterns> | |
<directories/> |