小编Mar*_*mso的帖子

当用户询问时自动将用户添加到频道

我想做一个非常简单的项目来做到这一点:

一个用户(让我们称他为 John)打开与我的机器人的 Telegram 聊天,并输入以下内容:

用户约翰:/join channel1

我的机器人响应将用户“John”添加到频道“channel1”

这其实就是我想要的。问题是 Telegram BOT API 没有实现任何将用户添加到组的方法。我尝试使用电报-cli,但“chat_add_user”似乎只接受将用户添加到聊天中,而不接受添加到群组中。

有什么办法可以将用户添加到这样的频道吗?(无需手动操作)还是我应该忘记这一点?

谢谢!

telegram

14
推荐指数
2
解决办法
2万
查看次数

使用css将帮助提示框放在正确的位置

我正在尝试正确调整帮助提示框的位置,因此它总是显示如下:

我想要的位置

我的意思是,指针只在"帮助圈子"中.但我遇到配置问题.垂直它已经可以,但我无法水平调整它.这里我留下了JS Fiddle URL:

https://jsfiddle.net/28dsnmxs/2/

正如你在那里看到的那样,帮助提示框完全搞砸了,而不是应该在哪里.我想纠正这个.

.help-tip {
  display: inline-block;
  position: static;
  text-align: center;
  background-color: #BCDBEA;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  line-height: 26px;
  cursor: default;
}
.help-tip:before {
  content: '?';
  font-weight: bold;
  color: #fff;
}
.help-tip:hover p {
  display: block;
  transform-origin: 100% 0%;
  -webkit-animation: fadeIn 0.3s ease-in-out;
  animation: fadeIn 0.3s ease-in-out;
}
.help-tip p {
  /* The tooltip */
  display: none;
  text-align: left;
  background-color: #1E2021;
  padding: 10px;
  width: 200px;
  position: absolute;
  border-radius: 3px;
  box-shadow: 1px 1px …
Run Code Online (Sandbox Code Playgroud)

html css

4
推荐指数
1
解决办法
493
查看次数

截取当前显示屏幕的屏幕截图,而不是当前活动

我正在尝试创建一个小应用程序,当出现特定通知时触发当前显示屏幕的屏幕截图.例如,我正在使用whatsapp并显示Whatsapp通知 - >这会触发whatsapp捕获.

好吧,我当前的代码实际上检测到通知并在收到通知时触发屏幕截图,但不是我想要的方式.我得到了MainActivity的屏幕截图,即使它没有在屏幕上显示.我只想截图它出现在屏幕上的内容.这似乎很容易,但我无法做到!

我留下了我当前的NotificationReceiver类,它失败了,因为它捕获了MainActivity而不是屏幕:

class NotificationReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        String temp = intent.getStringExtra("notification_event") + "\n" + txtView.getText();
        txtView.setText(temp);

        if (intent.getStringExtra("notification_event").contains("bet")) {
            Log.i("Dentro", "dentro");

            Date now = new Date();
            android.text.format.DateFormat.format("yyyy-MM-dd_hh:mm:ss", now);

            try {
                // image naming and path  to include sd card  appending name you choose for file
                String mPath = Environment.getExternalStorageDirectory().toString() + "/" + now + ".jpg";

                // create bitmap screen capture
                View v1 = getWindow().getDecorView().getRootView();
                v1.setDrawingCacheEnabled(true);
                Bitmap bitmap = Bitmap.createBitmap(v1.getDrawingCache()); …
Run Code Online (Sandbox Code Playgroud)

android screenshot

2
推荐指数
1
解决办法
1004
查看次数

标签 统计

android ×1

css ×1

html ×1

screenshot ×1

telegram ×1