使用 bark, telegram bot, dingding bot, serverJ 发送手机推送 :param title: :param content: :return:
(title, content)
| 333 | return respone["errmsg"] |
| 334 | |
| 335 | def send(title, content): |
| 336 | """ |
| 337 | 使用 bark, telegram bot, dingding bot, serverJ 发送手机推送 |
| 338 | :param title: |
| 339 | :param content: |
| 340 | :return: |
| 341 | """ |
| 342 | for i in notify_mode: |
| 343 | if i == 'bark': |
| 344 | if BARK: |
| 345 | bark(title=title, content=content) |
| 346 | else: |
| 347 | print('未启用 bark') |
| 348 | continue |
| 349 | if i == 'sc_key': |
| 350 | if SCKEY: |
| 351 | serverJ(title=title, content=content) |
| 352 | else: |
| 353 | print('未启用 Server酱') |
| 354 | continue |
| 355 | elif i == 'dingding_bot': |
| 356 | if DD_BOT_TOKEN and DD_BOT_SECRET: |
| 357 | dingding_bot(title=title, content=content) |
| 358 | else: |
| 359 | print('未启用 钉钉机器人') |
| 360 | continue |
| 361 | elif i == 'telegram_bot': |
| 362 | if TG_BOT_TOKEN and TG_USER_ID: |
| 363 | telegram_bot(title=title, content=content) |
| 364 | else: |
| 365 | print('未启用 telegram机器人') |
| 366 | continue |
| 367 | elif i == 'coolpush_bot': |
| 368 | if QQ_SKEY and QQ_MODE: |
| 369 | coolpush_bot(title=title, content=content) |
| 370 | else: |
| 371 | print('未启用 QQ机器人') |
| 372 | continue |
| 373 | elif i == 'pushplus_bot': |
| 374 | if PUSH_PLUS_TOKEN: |
| 375 | pushplus_bot(title=title, content=content) |
| 376 | else: |
| 377 | print('未启用 PUSHPLUS机器人') |
| 378 | continue |
| 379 | elif i == 'wecom_app': |
| 380 | if QYWX_AM: |
| 381 | wecom_app(title=title, content=content) |
| 382 | else: |
| 383 | print('未启用企业微信应用消息推送') |
| 384 | continue |
| 385 | elif i == 'qywx_bot': |
| 386 | if QYWX_KEY: |
| 387 | wxBot(title=title, content=content) |
| 388 | else: |
| 389 | print('未启用企业机器人') |
| 390 | continue |
| 391 | else: |
| 392 | print('此类推送方式不存在') |
no test coverage detected