Repost-instagram

Материал из wiki-MyMakerBot

Назад: Авто репост

{key_clear}
{if !isset($black_list)}{$black_list=[]}{/if}
{if !isset($white_list)}{$white_list=[]}{/if}
{if !isset($registered)}{$registered=1}{/if}
{if !isset($src_link)}{$src_link=1}{/if}
{if !isset($sign_up)}{$sign_up=''}{/if}
{if !isset($sign)}{$sign=''}{/if}
{if !isset($media_post)}{$media_post=1}{/if}
{if !isset($group)}{$group='instagram'}{/if}

{if $v.message|check_black_list:$black_list && $v.message|check_white_list:$white_list 
	&& (!$registered || !$v.guid|group_instagram:$group:1)}
	{* tg_sendMessage text=$v|json disable_web_page_preview=1 chat_id=$chat_id *}
{if !isset($keys)}
   {$keys=0}
{/if}

{if isset($like) && $like}
	{import c=$like}
{/if}

{* SIGN *}
{if $sign_up && !empty($v.message) }
{$v.message = "{$sign_up}`$v.message`"}
{/if}
{if $sign && !empty($v.message) }
{$v.message = "`$v.message`{$sign}"}
{/if}


{if $src_link && !empty($v.message) }
{$v.message = "`$v.message`

<a href='{$v.src_link}'>🔗 Инстаграм</a>"}
{/if}

  {$longMessage=''}
  {if (mb_strlen($v.message, 'utf-8')>1024)}
    {$longMessage=$v.message}
    {$v.message=''}
  {/if}
  {if (count($v.video)>0)}
  	 {if isset($videofile) && $videofile}
     	{tg_sendVideofile chat_id=$chat_id video=$v['video'][0]['media'] caption=$v.message keys=1}
     {else}
       {$v.message = "<a href='`$v.src_link`'>​</a><a href='{$v.src_link}'>🔗 Инстаграм</a>"}
       {tg_sendMessage chat_id=$chat_id text=$v.message}
     {/if}
  {else}
    {if (count($v.photo) == 1 && mb_strlen($v.message, 'utf-8') < 1024)}
        {tg_sendPhoto chat_id=$chat_id photo=$v.photo[0]['media'] caption=$v.message keys=1}
    {/if}

    {if count($v.photo) > 1 && $media_post}
        {tg_sendMediaGroup chat_id=$chat_id media=$v.photo caption=$v.message}
    {/if}
  {/if}  
  {if (!empty($longMessage))}
	{tg_sendMessage text=$longMessage disable_web_page_preview=0 chat_id=$chat_id keys=1}
  {/if}

{/if}
{key_clear}