ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

记一次无聊便开始动手搞喝水推送小助手了

2022-04-06 15:04:49  阅读:335  来源: 互联网

标签:喝水 fs return 无聊 headers url && const 推送


最开始的时候是青龙面板的 企业微信推送
但是企业微信推送太过于不方便了
之后开始研究了go-cqhttp
直接写一个JS 定时运行 然后推送到QQ群
先看喝水效果图
定时在青龙按照自己心情定
image

提醒喝水效果图
image

通过获取当前时间来推送喝水的第几张图
喝水JS在最下面

然后因为朋友说要在加一个艾特某人喝水没

那么就导致出现了另外一个艾特喝水JS 哈哈哈哈哈哈

方法也是调用艾特的API 然后问其喝水没

因群里有4个人 所以在这里添加了随机数 随机挑选一位幸运的观众
代码在最下面

go-cqhttp官方API地址:https://docs.go-cqhttp.org/cqcode/#qq-表情

喝水JS

const $ = new Env("water");
const notify = $.isNode() ? require("./sendNotify") : "";
var myDate = new Date();
if(myDate.getHours()==9)
{
    notify.sendNotify("", "[CQ:image,file=http://zxinxin.cn/images/water/water1.jpg]", 'https://t.me/FengYun27');
}
else if(myDate.getHours()==10)
{
    notify.sendNotify("", "[CQ:image,file=http://zxinxin.cn/images/water/water2.jpg]", 'https://t.me/FengYun27');
}
else if(myDate.getHours()==11)
{
    notify.sendNotify("", "[CQ:image,file=http://zxinxin.cn/images/water/water3.jpg]", 'https://t.me/FengYun27');
}
else if(myDate.getHours()==13)
{
    notify.sendNotify("", "[CQ:image,file=http://zxinxin.cn/images/water/water4.jpg]", 'https://t.me/FengYun27');
}
else if(myDate.getHours()==14)
{
    notify.sendNotify("", "[CQ:image,file=http://zxinxin.cn/images/water/water5.jpg]", 'https://t.me/FengYun27');
}
else if(myDate.getHours()==15){
    notify.sendNotify("", "[CQ:image,file=http://zxinxin.cn/images/water/water6.jpg]", 'https://t.me/FengYun27');
}
else if(myDate.getHours()==16){
    notify.sendNotify("", "[CQ:image,file=http://zxinxin.cn/images/water/water7.jpg]", 'https://t.me/FengYun27');
}
else if(myDate.getHours()==17){
    notify.sendNotify("", "[CQ:image,file=http://zxinxin.cn/images/water/water8.jpg]", 'https://t.me/FengYun27');
}
function Env (t, e) { 
    "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } 
    send (t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return 
    "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get (t) { return this.send.call(this.env, t) }
     post (t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) 
     { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", 
     this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e),
      this.log("", `

标签:喝水,fs,return,无聊,headers,url,&&,const,推送
来源: https://www.cnblogs.com/xxxlk/p/16106369.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有