#!/bin/bash

for JHM in `cat /opt/ziyuan/Telegram/JHM.txt |grep -v "#"`
do
        if [ -n "$JHM" ];then
       curl -X POST  "https://api.telegram.org/bot5213478982:AAFcXgSr8ppQ-Eq5B_Ip0pHxfj_-tFY1y4g/sendmessage?chat_id=1471099059&text= $JHM"
        fi
done

### 机器人 游明羽 :  @YouMingYu_BOT ###
### 机器人API:   5213478982:AAFcXgSr8ppQ-Eq5B_Ip0pHxfj_-tFY1y4g  ###
### 查询与机器人沟通的的ID  ###
### https://api.telegram.org/bot5213478982:AAFcXgSr8ppQ-Eq5B_Ip0pHxfj_-tFY1y4g/getUpdates ###
### "id": 1471099059, 代表玩家的ID 这个ID是玩家的  ###

##### nohup ./bot.sh > BOT.log  2>&1 &  ###
###   后台运行 bot.sh 脚本把日志输出去 BOT.log  2>&1 不知道怎么意思  & 是后台运行 ###
### 参考文档:   https://blog.csdn.net/sitebus/article/details/100554789  ###
###  nohup yourcommand 2>&1 & ###
### 在上面的例子中，0 – stdin (standard input)，1 – stdout (standard output)，2 – stderr (standard error); ###
###  2>&1是将标准错误（2）重定向到标准输出（&1），标准输出（&1）再被重定向输入到日志文件中 ### 
### 如果希望将日志输出到别的文件中，可以增加一个输出重定位参数。例子如下  ###
### nohup yourcommand > myout.log 2>&1 &   ###
### 其中myout.log是保存输出的文件名称。 ###
