Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:Aewait/Valorant-kaiheila-bot int…
Browse files Browse the repository at this point in the history
…o develop
  • Loading branch information
musnows committed Aug 22, 2022
2 parents 89a055e + b00be48 commit eb95c26
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 35 deletions.
59 changes: 37 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@



<h1 align="center">Valorant-kaiheila-bot</h1>
<h1 align="center">Kook-Valorant--bot</h1>


<h4 align="center">这是一个KOOK的「Valorant」小机器人</h4>
Expand All @@ -18,30 +18,42 @@
</div>

## 功能
当前机器人处于极极极其早期版本,目前只支持回复valorant游戏错误码,和一些简单功能
当前机器人处于早期版本,目前支持回复valorant游戏错误码,查询valorant每日商店,和一些简单功能



下面是目前支持的功能列表:

| 帮助命令 | 功能 |
| ------------- | ------------------------------------------ |
| `/Ahri` | 回复使用帮助(因`/help`和其他机器人冲突,故用阿狸的英文名`Ahri`替代) |
| `/vhelp` | Valorant相关查询功能的帮助命令 |


| 游戏相关 | 功能 |
| ------------- | ------------------------------------------ |
| `/val 错误码` | 回复游戏错误码解决方法 |
| `/saveid` | 保存(修改)用户的游戏id |
| `/myid` | 显示用户的游戏id |
| `/skin name` | 搜索已有皮肤系列包含什么枪械 |
| `/lead 30 20` | 显示出亚服(ap)排行榜前30名胜场超过20的玩家 |
| `/roll 1 100` | 掷色子1-100,范围可自行调节 |
| `/login 账户 密码` | 私聊bot进行登录riot账户的操作(获取token) |
| `/logout` | 退出riot账户登录 |
| `/shop` | 获取每日商店的4个皮肤 |
| `/point` | 获取用户剩余的vp和r点 |

关于商店查询的初步功能已经添加,但是其`稳定性/是否封号`未知,建议谨慎使用。

| 其他命令 | 功能 |
| ----------------- | ------------------------------------------------------------ |
| `/hello` | 回复 world! |
| `/Ahri` | 回复使用帮助(因`/help`和其他机器人冲突,故用阿狸的英文名`Ahri`替代) |
| `/hello` | 打个招呼 (一般用来测试bot在不在线) |
| `/roll 1 100` | 掷色子1-100,范围可自行调节 |
| `/countdown 秒数` | 倒计时,默认60秒 |
| `/TL 内容` | 翻译内容。其他语言翻译为中文,中文默认翻译成en |
| `/TLON` | 在本文字频道打开实时翻译功能 |
| `/TLOFF` | 在本文字频道关闭实时翻译功能 |
| `/we 城市` | 查询城市未来3天的天气情况 |
| `/hs` | 历史上的今天 |
| `/TLON` | 在本文字频道`打开`实时翻译功能 |
| `/TLOFF` | 在本文字频道`关闭`实时翻译功能 |
| `/we 城市` | 查询`城市`未来3天的天气情况 |
| `/hs` | 历史上的今天(因为kook审核原因被删除) |
| `` | 自动给新用户上对应角色(可自主修改) |
| `` | 当有人助力服务器的时候,在通知频道发送感谢信息 |

Expand All @@ -54,9 +66,7 @@
保证你的Linux中`Python`版本高于`3.8`,执行下面的安装库命令

~~~
pip install khl.py
pip install valorant
pip install requests
pip install -r requirements.txt
~~~

> Q:为何`khl.py`只需要3.6.8以上版本,而本仓库需要3.8+?
Expand All @@ -69,7 +79,7 @@ pip install requests

----

## TODO
## To Do

下面是一些未来的计划

Expand All @@ -78,22 +88,27 @@ pip install requests
- [ ] 学习python
- [x] 学习接入官方的`valorant api`
- [ ] 实现查询游戏战绩(需要roit授权)
- [ ] ~~实现玩家商店刷枪的查询~~
- [ ] ~~实现当商店刷新某一把枪的时候提醒玩家~~
- [ ] ~~查看玩家的夜市~~
- [x] 实现玩家商店刷枪的查询
- [ ] 实现当商店刷新某一把枪的时候提醒玩家
- [ ] 查看玩家的夜市

由于很多人在使用类似商店查询软件后被ban,我决定正式停止相关功能的开发
>咳咳,虽然初步的商店查询功能已经上线,但是其是否`封号`依旧未知!建议使用小号测试,或者不要用相关功能
<img src="https://s1.ax1x.com/2022/07/07/jwNGMF.png" width="510px" height="360px"/>

---
----

## 依赖

由于本人压根没有学过python,所以本仓库的很多代码都是根据他人教程修改后使用的
* 基本代码参考[khl.py](https://github.com/TWT233/khl.py)提供的api库以及使用教程
* Valorant游戏部分代码基于@frissyn大佬提供的[valorant.py](https://github.com/frissyn/valorant.py/)
* 早期使用了`https://replit.com/``https://uptimerobot.com/`提供的服务,无需使用**云服务器**也可部署机器人。
这两个网站的使用教程见[B站视频](https://www.bilibili.com/video/BV12U4y1g7JY?spm_id_from=333.1007.top_right_bar_window_history.content.click),代码可以查看`code/EarlyTest`里面的内容(注意,部署到云服务器的方式和这两个网站是不一样的,具体可查看本仓库wiki)
由于本人压根没有系统的学过Python,所以本仓库的很多代码都是根据他人教程修改后使用的
* 基本代码参考[khl.py](https://github.com/TWT233/khl.py)提供的KOOK-api库以及使用教程
* Valorant游戏部分代码基于[frissyn/valorant.py](https://github.com/frissyn/valorant.py/)项目
* Valorant游戏主要代码基于[ValorantClientAPI](https://github.com/HeyM1ke/ValorantClientAPI)项目

### 特别鸣谢🎁
* [@DeeChael](https://github.com/DeeChael) for helping me debug
* [@Edint386](https://github.com/Edint386) for adding PIL_code for `/shop`
* [@staciax](https://github.com/staciax) for [Valorant-DiscordBot/issues/74](https://github.com/staciax/Valorant-DiscordBot/issues/74)


49 changes: 36 additions & 13 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<h1 align="center">Valorant-kaiheila-bot</h1>
<h1 align="center">
Kook-Valorant-Bot</h1>


<h4 align="center">this is a Valorant bot for KOOK platform</h4>
Expand All @@ -19,31 +20,45 @@ KOOK(once called kaiheila) is a Chinese voice communication software.
This robot is still at an extremely early stage, and many of the functions I want have not yet been realized.

For safety reason, the development of `/store`and`/nightmarket` has been canceled
~~For safety reason, the development of /store and /nightmarket has been canceled~~

---
I just develop basic `/login` and `/shop` to fetch daily shop, hoping it's save for using

----

## Command

Here is the Command List for bot:


| command | function |
| Help | Function |
| --------------- | ------------------------------------------------------------ |
| `/hello` | reply "world!" |
| `/Ahri` | help command(Because `/help`conflicts with other bots, `/Ahri`is used instead,who is an hero in League of Legends) |
| `/vhelp` | help command for Valorant serch fuction |

| Valorant | Function |
| --------------- | ------------------------------------------------------------ |
| `/val err_code` | help with the err_code of valorant |
| `/saveid` | save or change user's game ID |
| `/myid` | show user's game ID |
| `/skin name` | search for skins |
| `/lead 30 20` | show leaderboard of `ap`.the top 30 gamers more than 20 wins |
| `/login account passwd` | login your riot_account to fetch auth_token |
| `/logout` | logout your riot_account |
| `/shop` | fetch skin at daily shop |
| `/point` | fetch remaining `Vp` and `Rp` |

Recommended to use after the Valorant_Function is stable.

| Other | Function |
| --------------- | ------------------------------------------------------------ |
| `/hello` | reply "world!" |
| `/roll 1 100` | return a number in `1~100` |
| `/countdown 30` | set a countdown for 30s,which default is 60s |
| `/TL context` | traslate context. from `zh to en ` & `other languages to zh` |
| `/TLON` | turn on real time translation at current channel |
| `/TLOFF` | turn off real time translation |
| `/we city` | weather of the `city` |
| `/hs` | history of today |
| `/TL context` | traslate context. from `ZH to EN` & `Other languages to ZH` |
| `/TLON` | turn on real-time translation at current channel |
| `/TLOFF` | turn off real-time translation |
| `/we city` | weather of the `city` in 3 days |
| `/hs` | history of today (now deleted) |
| - | Automatically grant roles to users |
| - | When someone sponsor the server, send a thanks message on the notification channel |

Expand All @@ -55,8 +70,16 @@ for more guild and information,check out [wiki pages](https://github.com/Aewait/
## About
Since I have not studied python, many codes in this repo are modified and used according to others' tutorials
* KOOK_api base on [khl.py](https://github.com/TWT233/khl.py)
* ValorantGameApi base on @frissyn [valorant.py](https://github.com/frissyn/valorant.py/)
* ValorantGameApi base on [frissyn/valorant.py](https://github.com/frissyn/valorant.py/)
* Main fetch_code base on [ValorantClientAPI](https://github.com/HeyM1ke/ValorantClientAPI)



### Thanks🎁
* [@DeeChael](https://github.com/DeeChael) for helping me debug
* [@Edint386](https://github.com/Edint386) for adding PIL_code for `/shop`
* [@staciax](https://github.com/staciax) for [Valorant-DiscordBot/issues/74](https://github.com/staciax/Valorant-DiscordBot/issues/74)

If you like this project,please hit a star!

If you like this project,please hit a star!✨
> sorry for my poor English

0 comments on commit eb95c26

Please sign in to comment.