@botsgram_cu · Post #3153 · 23.11.2020 г., 18:55
Qué puede hacer este bot? @PromoPedidoBot Con este bot puedes hacer un pedido o solicitud de promoción Idioma: Portugués (visto en @botsgram.cu) #publicaciones
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #411 · 9 фев.
reload_flag="" if [[ -n "${DEBUG}" ]]; then reload_flag="--reload" fi if [[ -n "${WORKER_COUNT}" ]]; then workers=${WORKER_COUNT} else workers=2 fi gunicorn --workers ${workers} \ --bind 0.0.0.0:8000 \ ${reload_flag} main.wsgi Писали такие конструкции чтобы проверить наличие флага и сформировать команду правильно? На самом деле можно сделать тоже самое проще. Для этого используются операторы условной подстановки, доступные в оболочках семейства POSIX. :- для установки значений по умолчанию ${WORKER_COUNT:-2} Если переменная не объявлена, то будет дефолтное значение 2. :+ подставляет указанный текст, если переменная не пуста ${DEBUG:+--reload} Если что-то есть в переменной то распечатается текст после символа +, в противном случае - ничего. Удобно для опциональных флагов, как в нашем примере. Итого наш скрипт может выглядеть так: gunicorn --workers ${WORKER_COUNT:-2} \ --bind 0.0.0.0:8000 \ ${DEBUG:+--reload} main.wsgi Есть еще два оператора. := не только подставить дефолтное значение, но и присвоить его переменной, если она пуста # никаких переменных еще нет VAL1=${VAL2:=hello} # теперь доступны обе echo $VAL1 $VAL2 # hello hello :? остановить выполнение с ошибкой, если переменной нет. echo ${MISS:?is required} bash: MISS: is required Код выхода будет 1. #tricks#linux
Пребарај: #publicaciones
@botsgram_cu · Post #3153 · 23.11.2020 г., 18:55
Qué puede hacer este bot? @PromoPedidoBot Con este bot puedes hacer un pedido o solicitud de promoción Idioma: Portugués (visto en @botsgram.cu) #publicaciones
Hashtags
@botsgram_cu · Post #4140 · 25.07.2021 г., 18:02
¿Que puede hacer este bot? @ChannelToGroupsBot Con este bot puedes reenviar todos los mensajes enviados en un canal establecido a todos los grupos con el bot Idiomas: varios incluido español (Visto en @botsgram_cu) #publicaciones#grupos#canales
Hashtags
@botsgram_cu · Post #4119 · 17.07.2021 г., 08:28
¿Que puede hacer este bot? @ChannelToChannelBot Este bot le permitirá tener automáticamente todas las publicaciones de su canal reenviadas a un canal de respaldo Idiomas: varios incluido español (Visto en @botsgram_cu) #canales#publicaciones#herramientas
@botsgram_cu · Post #4572 · 26.12.2021 г., 22:22
¿Que puede hacer este bot? @ViewBoosterBot Con éste bot puedes aumentar las vistas de las publicaciones de tu canal. Idiomas: inglés (Visto en @botsgram_cu) #vistas#publicaciones#canales
Hashtags
@botsgram_cu · Post #3103 · 02.11.2020 г., 18:29
¿Que puede hacer este bot? @Autoforward_Nsbot Este bot puede reenviar mensajes de un canal a otro y agregar el título automáticamente. Idioma: inglés (Visto en @botsgram_cu) #mensajes#publicaciones#canales#herramientas
@botsgram_cu · Post #4573 · 27.12.2021 г., 04:26
¿Que puede hacer este bot? @todoeasybot Perfecto para hacer listas. Debes añadirlo como Administrador a un canal privado o público. Este bot proporcionará a cada publicación dos botones: uno de "Hecho" y otro de "Cancelar" Idiomas: inglés (Visto en @botsgram_cu) #listas#publicaciones#canales
Hashtags
@botsgram_cu · Post #3811 · 15.04.2021 г., 03:09
¿Que puede hacer este bot? @MediaEditorRoBot Este bot ayuda a los administradores de canales a editar publicaciones multimedia Simplemente envíe un mensaje de medios al bot y reenvíe una publicación de canal al bot, luego el bot reemplazará la publicación con los medios enviados por el usuario Idioma: inglés (Visto en @botsgram_cu) #canales#herramientas#multimedia#publicaciones
@botsgram_cu · Post #4149 · 27.07.2021 г., 15:17
¿Que puede hacer este bot? @AJviewCounter_bot Bot para programar alarmas en dependencia de la cantidad de vistas obtenidas en un mensaje. Idioma: español (Visto en @botsgram_cu) #alarma#publicaciones#vistas
Hashtags