当前位置: 首页>>代码示例>>PHP>>正文


PHP Update::getMessage方法代码示例

本文整理汇总了PHP中Update::getMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Update::getMessage方法的具体用法?PHP Update::getMessage怎么用?PHP Update::getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Update的用法示例。


在下文中一共展示了Update::getMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     $log = new Logging();
     //        $parenClass = new ParentClass();
     // set path and name of log file (optional)
     $log->lfile('log.txt');
     $json = file_get_contents('php://input');
     $log->lwrite("post: " . $json);
     $update = new Update($json);
     $message = $update->getMessage();
     $chat = $message->getChat();
     $chat_id = $chat->getId();
     $text = $message->getText();
     $client = new Client();
     $client->sendMessage($chat_id, $text, null, null, null);
     $client->sendLocation($chat_id, 53.480759, -2.242631, null, null);
     $client->sendPhoto($chat_id, 'pic.jpg', 'sweety', null, null);
     $log->lclose();
 }
开发者ID:raniongolu,项目名称:Telegram-Bot-Client,代码行数:19,代码来源:index.php

示例2: Update

    // get acceptedID
    $accepted = Accepted::getByUserID(Session::getUserID(), $task->getID());
    // update status
    $accepted->setStatus($status);
    $accepted->save();
    // create the update
    $update = new Update(array('creator_id' => Session::getUserID(), 'accepted_id' => $accepted->getID(), 'project_id' => $project->getID(), 'title' => $title, 'message' => $message));
    $update->save();
    // save uploaded files to database
    foreach ($_POST['file'] as $stored => $orig) {
        $stored = Filter::text($stored);
        $orig = Filter::text($orig);
        Upload::saveToDatabase($orig, $stored, Upload::TYPE_UPDATE, $update->getID(), $project->getID());
    }
    // log it
    $logEvent = new Event(array('event_type_id' => 'create_update', 'user_1_id' => Session::getUserID(), 'project_id' => $project->getID(), 'item_1_id' => $update->getID(), 'item_2_id' => $accepted->getID(), 'item_3_id' => $task->getID(), 'data_1' => $update->getTitle(), 'data_2' => $update->getMessage()));
    $logEvent->save();
    // we're done here
    Session::setMessage('You created a new update for this task.');
    $json = array('success' => '1', 'successUrl' => Url::update($update->getID()));
    echo json_encode($json);
} elseif ($action == 'edit-update') {
    // validate update
    $updateID = Filter::numeric($_GET['u']);
    $update = Update::load($updateID);
    if ($update == null) {
        header('Location: ' . Url::error());
        exit;
    }
    // get update content
    $title = Filter::text($_POST['txtTitle']);
开发者ID:malimu,项目名称:Pipeline,代码行数:31,代码来源:update.process.php


注:本文中的Update::getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。