获取电报组成员的数量

时间:2018-07-02 07:03:50

标签: telegram telegram-bot

我这样尝试

    <?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id');


            $table->string('name');
            $table->string('email',150)->unique();
            $table->string('password');
            $table->integer('roleid')->unsigned();
            $table->rememberToken();

            /*Common Fields*/
            $table->integer('status');
            $table->integer('createdby');
            $table->integer('modifiedby');
            $table->string('publicguid');
            $table->string('privateguid');
            $table->timestamps();

           /*From other table */
            $table->foreign('roleid') ->references('id')->on('userroles')->onDelete('cascade');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */

    public function down()
    {
        Schema::dropIfExists('users');
    }
}

但有例外

  

'无法构造的实例   org.telegram.telegrambots.api.objects.replykeyboard.ApiResponse   (尽管至少存在一个创建者):没有布尔/布尔参数   从布尔值(false)反序列化的构造函数/工厂方法。

1 个答案:

答案 0 :(得分:0)

通过这种方式,我得到了组成员的人数。

GetChatMemberCount chatMemberCount = new GetChatMemberCount().setChatId(message.getChatId());
try { Integer count = execute(chatMemberCount); } catch (TelegramApiException e) { logger.error(e.getMessage()); }