Skip to content

Instantly share code, notes, and snippets.

View SilencerWeb's full-sized avatar

Max Gorodov SilencerWeb

View GitHub Profile
let productsListsMasonries = [];
const initProductsListsMasonries = () => {
const masonryOptions = {
itemSelector: '.products-list__product-card',
columnWidth: '.products-list__grid-sizer',
percentPosition: true,
gutter: getWindowOuterWidth() >= 768 ? 80 : 40,
};
const Markup = require('telegraf/markup');
const { ACTION_NAMES } = require('../constants');
const generatePostKeyboard = (id, removeCaption) => Markup.inlineKeyboard([
[
removeCaption ?
Markup.callbackButton('🖍 Remove caption', `${ACTION_NAMES.remove_post_caption.string}_${id}`)
:
Markup.callbackButton('✏️ Return caption', `${ACTION_NAMES.return_post_caption.string}_${id}`),
const { Post } = require('../models');
const { generatePostKeyboard } = require('../keyboards');
const { bot } = require('../bot');
const { CHANNELS_INFO, ACTION_NAMES, IS_PRODUCTION, DEVELOPMENT_GROUP_ID } = require('../constants');
const setUpRemovePostCaptionAction = () => {
bot.action(ACTION_NAMES.remove_post_caption.regexp, (context) => {
const id = context.match[1];
const callbackQueryId = context.update.callback_query.id;
const ACTION_NAMES = {
approve_post: {
regexp: /a_p_(.+)/,
string: 'a_p'
},
dismiss_post: {
regexp: /d_p_(.+)/,
string: 'd_p'
},
approve_post_confirmation: {
bot.telegram.sendVideo('', '', {
reply_markup: {
inline_keyboard: [
[
{
text: 'Remove caption',
callback_data: `remove_post_caption_${id}`,
},
],
[
const path = require('path');
const UglifyJsPlugin = require('uglify-js-plugin');
module.exports = {
target: 'node',
mode: 'production',
entry: {
telegram.getUserProfilePhotos(user.id, 0, 1).then((response) => {
const photos = response.photos;
const photo = photos[0];
const largePhoto = photo[2];
telegram.getFileLink(largePhoto.file_id).then((avatarLink) => {
axios.get(avatarLink).then((avatar) => {
const form = new FormData();
form.append('data', new Buffer.from(avatar.data), {
filename: 'example.jpg',
// post options
const options = {
reply_markup: {
inline_keyboard: [
[
{
text: 'Remove caption',
callback_data: 'remove_post_caption',
},
],
import * as React from "react";
import { PropertyControls, ControlType } from "framer";
import Button from "@material-ui/core/Button";
import Icon from "@material-ui/core/Icon";
type Props = {
text: string;
height: number;
width: number;
color: any;
module.exports = {
outputDir: 'wwwroot',
devServer: {
proxy: 'http://localhost:5000',
},
lintOnSave: false,
chainWebpack: (config) => {
const svgRule = config.module.rule('svg');
svgRule.uses.clear();