如何将聊天图标设置为电报机器人?

问题描述

我有一个'Bot'类,扩展了'TelegramLongPollingBot',并且有一个空白来设置机器人图标:

private void setChatIcon() {
    ClassLoader loader = ClassLoader.getSystemClassLoader();
    URL url = loader.getResource("/sky.jpg");
    assert url != null;
    File file = new File(url.getPath());
    SetChatPhoto setChatPhoto = new SetChatPhoto();
    try {
        execute(setChatPhoto.setPhoto(file));
    } catch (TelegramApiException e) {
        e.printstacktrace();
    }
}

我应该在哪里调用它,我的代码中有什么错误

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)