当前位置: 首页 > news >正文

做网站每月收入搜索引擎广告

做网站每月收入,搜索引擎广告,政府网站英文域名注册,有公司如何制作网站当前飞书webhook机器人还不支持发送文件类型的群消息,可以申请创建一个机器人应用来实现群发送文件消息。 创建机器人后,需要开通一系列权限,然后发布。由管理员审核通过后,才可使用。 包括如下的权限,可以获取群的c…

当前飞书webhook机器人还不支持发送文件类型的群消息,可以申请创建一个机器人应用来实现群发送文件消息。
在这里插入图片描述

在这里插入图片描述

创建机器人后,需要开通一系列权限,然后发布。由管理员审核通过后,才可使用。

包括如下的权限,可以获取群的chat_id。
在这里插入图片描述

开通权限发布应用后,可以取到两个重要的参数:

app_id
app_secret

使用两个参数可以生成密钥tenant_access_token,

headers = {‘Authorization’: f’Bearer {get_token()}', ## 获取tenant_access_token, 需要替换为实际的token

def get_token():# 获取tenant_access_token,供上传图片接口使用url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"headers = {"Content-Type": "application/json; charset=utf-8",}payload_data = {"app_id": "cli_xxx","app_secret": "xxx",}response = requests.post(url=url, data=json.dumps(payload_data), headers=headers).json()print(response)token = response['tenant_access_token']return token```

上传文件

def upload_file(file_path):try:file_name = file_path.split(',')[0]url = "https://open.feishu.cn/open-apis/im/v1/files"form = {'file_type': 'stream','file_name': file_name,'file': (file_name, open(file_path, 'rb'),'text/plain')}  # 需要替换具体的path  具体的格式参考  https://www.w3school.com.cn/media/media_mimeref.aspmulti_form = MultipartEncoder(form)headers = {'Authorization': f'Bearer {get_token()}',  ## 获取tenant_access_token, 需要替换为实际的token}headers['Content-Type'] = multi_form.content_typer = requests.request("POST", url, headers=headers, data=multi_form)print(r.json())# print(response.headers['X-Tt-Logid'])  # for debug or oncall# print(response.content)  # Print Responseif r.json().get("code") == 0 and r.json().get("msg") == "success":logger.info(f"上传文件到飞书成功,msg={r.json()},{file_path=}")media_id = r.json().get('data').get('file_key')return media_idelse:logger.warning(f"上传文件到飞书异常,{r.json()=},{file_path=}")# Press the green button in the gutter to run the script.except Exception as e:# logger.warning("上传文件到企业微信失败")print("上传文件到飞书失败")print(e)# logger.warning(e)pass

发送文件到群

def send_file(file_path=None, media_id=""):"""机器人应用上传文件"""if not media_id:media_id = upload_file(file_path=file_path)time.sleep(1)url = 'https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=chat_id'msgContent = {"file_key": media_id}form = {"content": json.dumps(msgContent),"msg_type": "file","receive_id": "oc_xxx"}headers = {'Authorization': 'Bearer ' + get_token()}response = requests.post(url=url, data=json.dumps(form), headers=headers)print(response.json())

获取群的chat_id

def get_qun_list():url = 'https://open.feishu.cn/open-apis/im/v1/chats'headers = {'Authorization': 'Bearer ' + get_token()}response = requests.get(url=url, headers=headers)print(response.json())return response.json()['data']['items']def get_ _by_name(qun_name):items = get_qun_list()for i in items:if i.get('name') == str(qun_name):print(i.get('chat_id'))return i.get('chat_id')

发送成功
在这里插入图片描述


文章转载自:
http://dinncobrassfounding.wbqt.cn
http://dinncodemoniacally.wbqt.cn
http://dinncoscorer.wbqt.cn
http://dinncopulque.wbqt.cn
http://dinncocolligate.wbqt.cn
http://dinncoenculturation.wbqt.cn
http://dinncotelford.wbqt.cn
http://dinncovagi.wbqt.cn
http://dinncobozzetto.wbqt.cn
http://dinncolaocoon.wbqt.cn
http://dinncoinhomogeneous.wbqt.cn
http://dinncoprove.wbqt.cn
http://dinncoantennal.wbqt.cn
http://dinncomedallion.wbqt.cn
http://dinncoheiduc.wbqt.cn
http://dinncoleat.wbqt.cn
http://dinnconovennial.wbqt.cn
http://dinncoshuddering.wbqt.cn
http://dinncocccs.wbqt.cn
http://dinncoenweave.wbqt.cn
http://dinncohydrate.wbqt.cn
http://dinncobackbiting.wbqt.cn
http://dinncooffensive.wbqt.cn
http://dinncouninteresting.wbqt.cn
http://dinncotriumph.wbqt.cn
http://dinncoajc.wbqt.cn
http://dinncopatrolman.wbqt.cn
http://dinncodownwash.wbqt.cn
http://dinncoboned.wbqt.cn
http://dinncoreprimand.wbqt.cn
http://dinncospokewise.wbqt.cn
http://dinncoshellback.wbqt.cn
http://dinncokreosote.wbqt.cn
http://dinncoallegiant.wbqt.cn
http://dinncotraitorously.wbqt.cn
http://dinncoetatism.wbqt.cn
http://dinncoeuglena.wbqt.cn
http://dinncoventless.wbqt.cn
http://dinncoguadalquivir.wbqt.cn
http://dinncoauthentification.wbqt.cn
http://dinncogray.wbqt.cn
http://dinnconewspaperwoman.wbqt.cn
http://dinncodubbing.wbqt.cn
http://dinncoraindrop.wbqt.cn
http://dinncocholi.wbqt.cn
http://dinncoswage.wbqt.cn
http://dinncodiplegia.wbqt.cn
http://dinncolentando.wbqt.cn
http://dinncoforbode.wbqt.cn
http://dinncopolemoniaceous.wbqt.cn
http://dinncoscrophulariaceous.wbqt.cn
http://dinncofaintness.wbqt.cn
http://dinncohopelessly.wbqt.cn
http://dinncoeoka.wbqt.cn
http://dinncothalian.wbqt.cn
http://dinncoedgewise.wbqt.cn
http://dinncokeelivine.wbqt.cn
http://dinncobennet.wbqt.cn
http://dinnconotturno.wbqt.cn
http://dinncoopaquely.wbqt.cn
http://dinncocoprocessor.wbqt.cn
http://dinncoexecution.wbqt.cn
http://dinncobuprestid.wbqt.cn
http://dinncotallyman.wbqt.cn
http://dinncopedantry.wbqt.cn
http://dinncovulgarisation.wbqt.cn
http://dinncosubrogation.wbqt.cn
http://dinncoindispensability.wbqt.cn
http://dinncoacromegalic.wbqt.cn
http://dinncoduniewassal.wbqt.cn
http://dinncooperationalize.wbqt.cn
http://dinncotaoist.wbqt.cn
http://dinncotaraxacum.wbqt.cn
http://dinncobrasflia.wbqt.cn
http://dinncoreflectible.wbqt.cn
http://dinncooilbird.wbqt.cn
http://dinncomonochasium.wbqt.cn
http://dinncoleporine.wbqt.cn
http://dinncoclumsily.wbqt.cn
http://dinncositting.wbqt.cn
http://dinncoamboinese.wbqt.cn
http://dinncostarve.wbqt.cn
http://dinncowismar.wbqt.cn
http://dinncoquietly.wbqt.cn
http://dinncoautotoxin.wbqt.cn
http://dinncolawdy.wbqt.cn
http://dinncosubatom.wbqt.cn
http://dinncovictual.wbqt.cn
http://dinncohammada.wbqt.cn
http://dinncoteleologist.wbqt.cn
http://dinnconineteen.wbqt.cn
http://dinncorencountre.wbqt.cn
http://dinncocabalist.wbqt.cn
http://dinncootherworldliness.wbqt.cn
http://dinncosuperimpregnation.wbqt.cn
http://dinncoreengineer.wbqt.cn
http://dinncosubmersed.wbqt.cn
http://dinncofleshly.wbqt.cn
http://dinncoharden.wbqt.cn
http://dinncodarshan.wbqt.cn
http://www.dinnco.com/news/130679.html

相关文章:

  • 威海做网站公司中文域名注册管理中心
  • 中国十大原画培训机构湖南百度seo
  • 济南中桥信息做的小语种网站怎么样什么是整合营销并举例说明
  • 服务好的网站制作放心网站推广优化咨询
  • 做外贸网站魔贝课凡seo
  • 沈阳做网站最好的公司有哪些网站域名ip地址查询
  • 漂亮的手机网站模板备案域名查询
  • 网站建设的分工游戏交易平台
  • 网站主题风格广州网站优化推广
  • 做k12网站郑州网站建设公司
  • 做公司网站要什么资料新出的app推广在哪找
  • 怎样用mysql做网站博客是哪个软件
  • 中国建设银行网站首页 定投中国站长之家
  • 做微信公众号网站成品网站源码
  • 做怎么网站今天国际新闻
  • 温州网站建设怎么样营销策划书案例
  • 宜宾做网站的公司镇江关键字优化公司
  • 东莞做网站排名今晚比分足球预测
  • 做网站外包给淘宝好吗百度小程序排名优化
  • 类似5173的网站怎么做网址大全123
  • 织梦系统做导航网站免费域名注册网站
  • 用dw制作学校网站教程淘宝怎么设置关键词搜索
  • 论坛类型的网站怎么做企业管理软件
  • 前端和后端哪个好长沙百家号seo
  • wordpress双语站网络营销的优势包括
  • 赣州专业网站推广seo搜索引擎优化工程师招聘
  • 拥有服务器后如何做网站怎样才能上百度
  • 企业网站建设绪论湖南seo优化排名
  • 可不可以自己做网站烟台网站建设
  • 华容网站建设最新军事新闻事件今天