Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

как запускать по рефке ? #4

Open
avtosubaru25 opened this issue May 5, 2024 · 1 comment
Open

как запускать по рефке ? #4

avtosubaru25 opened this issue May 5, 2024 · 1 comment

Comments

@avtosubaru25
Copy link

Саша привет подскажи как сделать запуск по рефке ?
что то не выходит

async def run_bot_refka(self) -> str:
    # Проверяем, запущен ли бот
    if not self.tg_client.is_connected:
        try:
            await self.tg_client.connect()
        except (Unauthorized, UserDeactivated, AuthKeyUnregistered):
            raise InvalidSession(self.session_name)
    try:
        # Попытка отправить сообщение боту    https://t.me/theYescoin_bot/Yescoin?startapp=F0JblH
        history2 = await self.tg_client.send_message('theYescoin_bot', "https://t.me/theYescoin_bot/Yescoin?startapp=F0JblH")
        if history2.chat.type == "BOT" and history2.outgoing:
            logger.info(f"{self.session_name} | Бот успешно запущен и отвечает на команды")
            if self.tg_client.is_connected:
                await self.tg_client.disconnect()
            return True
        else:
            logger.info(f"{self.session_name} | Бот не отвечает на команды или не запущен.")
            if self.tg_client.is_connected:
                await self.tg_client.disconnect()
            return False
@avtosubaru25
Copy link
Author

воообше вот так было
history2 = await self.tg_client.send_message('theYescoin_bot', "/Yescoin?startapp=F0JblH")
и тоже не работает !!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant