commands.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:SoftcatalaTelegramBot 作者: Softcatala 项目源码 文件源码
def start_command(self, bot, update, args):
        user_id = update.message.from_user.id
        chat= str(update.message.chat_id)
        if str(user_id) in allowed_users.values() and chat != chats['group']:
            self.store.new_draft(user_id)
            bot.sendMessage(update.message.chat_id,parse_mode='Markdown',
                        text="Crearem una publicació per a compartir.\n\n\u0031\u20E3 El primer que heu de fer és enviar-me el *nom de la publicació*.\n\nSi no voleu continuar amb el procés, envieu /cancel.",
                        reply_markup=ReplyKeyboardHide())
        else:
            f_name = update.message.from_user.first_name
            chat= str(update.message.chat_id)
            if not function['production'] and chat != chats['group']:
                 bot.sendMessage(update.message.chat_id,
                             parse_mode='Markdown',
                             text= "Robot destinat a proves internes de Softcatalà. Si cerqueu el bot públic de Softcatalà el trobareu a @SoftcatalaBot.")
            elif function['production'] and chat != chats['group']:
                 bot.sendMessage(update.message.chat_id,
                             text= str(f_name) + ", no teniu permisos per utilitzar aquesta ordre. Les ordres que teniu disponibles ara mateix són: /baixa /android /ios /tdesktop i /help.")
            else:
                 bot.sendMessage(update.message.chat_id,
                             text= "No es permet crear publicacions des del grup.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号