Giter Club home page Giter Club logo

e5subbot's Introduction

e5subbot's People

Contributors

boris1993 avatar dependabot[bot] avatar iyear avatar kzw200015 avatar minoliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

e5subbot's Issues

0.3.0 预发布版本 bot被用户blocked问题

当用户在微软控制台手动禁用bot时 bot发送请求会返回以下日志:

{"L":"ERROR","T":"2021-07-07T02:57:58.269Z","C":"bots/sender.go:76","M":"failed to send msg","error":"api error: bot was blocked by the user (401)","id":"xxxxxxxxxxx"}

但是此异常并未进入bot的失败列表,多次失败无法成功解绑。

对于数据储存方式的一点建议

大部分情况下,我认为一个小工具不需要和MySQL捆绑,使用轻量级的Sqlite会更好,如果担心对C库的依赖也可以考虑使用json来储存数据

V0.3开发计划

V0.3可能是E5SubBot最后一个版本。主要是代码的重构和稳定性的提升,在功能方面不会做太多的变化。
该版本数据表结构与V0.2不再兼容,需要手动迁移。

将在7月左右开发完成,大致框架查看 dev 分支

大致开发计划如下:

  1. gorm代替原生sql操作,采用 sqlite 作为数据库。
  2. 分包解耦, client 单独写类。
  3. zap作为logger并采取日志切分,优化错误输出,取消 /log 命令
  4. go-i18n作为国际化第三方库,采用 toml 格式。
  5. sling 作为网络请求库。
  6. 请求成功一次即清空该 Client 当前 errorTimes

任何新的建议欢迎提出

Deprecation of deeplink to register applications with Microsoft Identity Platform

Dear developer, I am Yuan Zhou, a product manager in Azure identity team. We found that your app is using deeplink to apps.dev.microsoft.com to register applications with the Microsoft Identity Platform. This is not an official API and we want to notify you that we are deprecating this method in 30 days. You can use official Azure API to create applications instead. Please don't hesitate to reach out to me if you have any questions. Thanks!

是不是此程序已经无法使用了?

Application registrations portal has been deprecated for registering and managing converged applications since May 2019 and this functionality will be removed starting July 2022. We recommend that you manage your existing applications and register new applications by using the App registrations (now Generally Available) experience in the Azure portal. Go to the Azure portal
image

无法运行

直接在命令行执行,跑不起来,提示“【E5Sub】2021/05/10 13:30:25 main.go:132: http.Post failed: Post https://api.telegram.org/bot1878110893:AAEP57mATZAicmlCyUoCl4yQ2H5qyVinUj0/getMe: dial tcp 108.160.165.147:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.”,但是我把报错里面的那个网址复制出来在浏览器粘贴,能访问,显示“{"ok":true,"result":{"id":1878110893,"is_bot":true,"first_name":"E5_BA7JCM_TEST","username":"ba7jcm_bot","can_join_groups":true,"can_read_all_group_messages":false,"supports_inline_queries":false}}”

完整运行日志我输出到这个txt里了:
1.txt

出现了个bug

今天上线发现自动解绑了 又绑定了下 发现一执行就解绑了 除了e5之外都正常 望修

docker-compose.yml mysql should not expose 3306 port

Hello
目前的yml是把mysql映射到主機3306 port上
因此主機是public IP的話 有很大的機會受到攻擊
可以把ports(L5-L6)刪掉, 只要config的host是使用mysql容器名稱連接就不會有問題

mysql:
image: mariadb:10.4.12
ports:
- 3306:3306
command: --character-set-server=utf8mb4
volumes:
- ./mysql/data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: e5sub
restart: always
container_name: mysql

最新源码,config里error limit设为-1失效Bug

Docker部署,版本0.4.0

errlimit: 被设置为-1时应该为忽略错误,不主动清退;但实际疑似会清退所有注册的账户?

(我只绑了一个,admin 敲 /task 后结果为 1/1 成功->错误账户为空,但被清退,改errlimit为999并重启后恢复正常)

一点小建议及时间显示问题

1.机器人查看账户信息的时候能否显示所有日志?或者把日志log在服务器里
2.tg里显示的调用时间好像不是北京时间
3.建议调用间隔改成随机,太规律容易被发现

自动执行任务报错但没提示

我今天突然想起来去看看机器人的日志,发现自动执行的全都大量报错“control.go:156: Send Result ERROR: api error: Unauthorized (401)”和“ control.go:109: api error: Unauthorized (401)”,但是机器人发给我的结果却显示没有出错的账号,如图所示:
image
但是我手动执行任务的时候却又没有报错,如图:
image
不知道这是什么情况

服务器运行报错怎么办…

输入 ./E5SubBot
报错如下

[root@Linux]# ./E5SubBot
2020/06/07 15:20:54 While parsing config: yaml: line 22: mapping values are not allowed in this context
ERROR
panic: While parsing config: yaml: line 22: mapping values are not allowed in this context

goroutine 1 [running]:                                                           
main.CheckErr(0xa3efa0, 0xc00010c760, 0xc00010c760)
        E:/GoProjects/E5SubBot/main/util.go:26 +0x101
main.init.0()
        E:/GoProjects/E5SubBot/main/handle.go:54 +0xb5

配置文件如下:

#bindmax,notice,admin,errlimit可热更新,直接更新config.yml保存即可
##更换为自己的BotToken

bot_token: 10219xxxx1:AAGfUFn3SnERpxFTzAxxxxxxx

##不需要socks5代理删去即可
socks5: 127.0.0.1:1080

##公告,合并至/help
notice: "第一行\n第二行"
##管理员tgid,前往https://t.me/userinfobot获取,用,隔开
##管理员权限: 手动调用任务,获得任务总反馈
admin: 991535xxx1
##任务最大出错次数,满后自动解绑账户并发送通知,无限次数将值改为负数(-1)即可 
##以ms账户为单位,不会解绑所有账户(只解绑错误账户) 
##主要为了减少资源浪费.bot重启后会清零所有错误次数 
errlimit: 5
##API调用频率,使用cron表达式
cron: "1 */3 * * *"
##最大可绑定数
bindmax: 3                                                                       ##mysql配置,请提前创建数据库
mysql:                                                                            
          host: 127.0.0.1                                                                    
          port: 3306                                                                         
          user: e5sub
          password: e5sub                                                                  
          database: e5sub

更改任务循环运行模式

目前任务使用 cron 设置循环运行频率,但运行时间固定易导致续订失败。建议支持其他的计划任务方式,或者支持修改 cron 表达式后实际执行的命令。

Docker 起不来

stdout: ______ _____ _____ _ ____ _
stdout: | | / | | | | _ \ | |
stdout: | |
| || (
_ | |_ | |
) | ___ | |

stdout: | | |
\
| | | | '
| _ < / _ | |
stdout: | |
) |) | || | |) | |) | () | |_
stdout: ||// _,|_./|____/ __/ __|
stdout:
stdout: 【E5Sub】2022/06/14 23:14:35 main.go:76: Read Config……
stdout: 【E5Sub】2022/06/14 23:14:35 main.go:94: Connect MySQL Success!
stdout: 【E5Sub】2022/06/14 23:14:35 main.go:96: dial tcp :0: connect: connection refused

关于编译/二进制文件的建议

  1. 我用的最新版的二进制文件(linux),在arm64平台上无法运行。希望能增加各个平台的二进制文件(虽然能编译吧)

  2. 然后我根据README上的教程编译后,用go build main.go,报错:
    # command-line-arguments ./main.go:50:23: undefined: bStart ./main.go:51:20: undefined: bMy ./main.go:52:22: undefined: bBind1 ./main.go:53:24: undefined: bUnBind ./main.go:54:24: undefined: bExport ./main.go:55:22: undefined: bHelp ./main.go:56:24: undefined: bOnText ./main.go:58:22: undefined: bTask ./main.go:59:21: undefined: bLog ./main.go:64:40: undefined: SignTask ./main.go:64:40: too many errors
    我在网上搜了一下,好像用go build *.go就可以通过go语言编译了,希望能在readme里能改正一下(我不懂go语言,如有出错望指正)

建议增加自用特权模式

您好,可否增加一个特权模式,只响应 admin 参数中用户发来的消息,因为自建打算只给自己使用

在执行时出现了错误 MailboxNotEnabledForRESTAPI

首先用pdf配置并绑定成功但是执行错误,使用自动配置并绑定成功但是执行错误, 都是相同的错误
您的帐户 xx 在执行时出现了错误
您可以选择解绑该用户
错误: {"code":"MailboxNotEnabledForRESTAPI","message":"The mailbox is either inactive, soft-deleted, or is hosted on-premise.","innerError":{"date":"2023-01-05T03:01:23","request-id":"xxx","client-request-id":"xxx"}}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.