Skip to content

Commit

Permalink
Added /cplay and fixed multiple issues
Browse files Browse the repository at this point in the history
  • Loading branch information
NotReallyShikhar committed Mar 6, 2022
1 parent 5903e54 commit 47c5fd8
Show file tree
Hide file tree
Showing 27 changed files with 160 additions and 178 deletions.
1 change: 1 addition & 0 deletions .cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"access_token": "BQB9NanGkQZvQ_bVESQJyP-gBOZEDGMmNV6tjAzIiTbj18uHKmvgSphH6r_ePe_6lQZ5kzrm0Psn4kbVBfg", "token_type": "Bearer", "expires_in": 3600, "expires_at": 1646573806}
54 changes: 27 additions & 27 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,55 +16,57 @@

Here's a brief high-level overview of the Yukki Music Bot:

This project is based on [Pyrogram](https://github.com/pyrogram) and [Py-Tgcalls](https://github.com/pytgcalls/pytgcalls) . Pyrogram is a modern, elegant and asynchronous MTProto API framework.
This project is based on [Pyrogram](https://github.com/pyrogram) and [Py-Tgcalls](https://github.com/pytgcalls/pytgcalls) . Pyrogram is a modern, elegant and asynchronous MTProto API framework.

* For database, Yukki uses the MongoDB to store data and keys. [MongoDB](https://www.mongodb.com/) is a document database with the scalability and flexibility that you want with the querying and indexing that you need.
* Project uses the bs4 web scrapping for getting many platform details. [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) is a Python library for pulling data out of HTML and XML files.
* The project uses the font [`Poppins`](../assets/font.ttf) as its main font for the thumbnails.
* The projects uses attractive images and icons which you cen get in [assets](../assets/) directory.
* The projects uses attractive images and icons which you can get in [assets](../assets/) directory.

For more information on the technologies that power the Yukki Music Bot, check out the [Docs](https://notreallyshikhar.gitbook.io/yukkimusicbot/).



# ⚡️ Getting Started


### Before deploying Yukki Music Bot , please have a look towards [all available config vars](../config/README.md) , also please check [all available commands](../strings/command.yml) of the project.

> If you want to start working with Yukki Music Bot you can either fork or import repo .
> The official [documentation site](https://notreallyshikhar.gitbook.io/yukkimusicbot/) contains a lot of information. The best place to start is from the deployment section.
> If you'd like to talk to us, join us on our [Telegram Group](https://t.me/YukkiSupport)

## 🖇 Prerequisites

> In order to avoid conflicts in your project, you must have/installed
- [Python3.9](https://www.python.org/downloads/release/python-390/)
- [Telegram API Key](https://docs.pyrogram.org/intro/setup#api-keys)
- [Telegram Bot Token](https://t.me/botfather)
- [MongoDB URI](https://telegra.ph/How-To-get-Mongodb-URI-04-06)
- [Pyrogram String Session](https://notreallyshikhar.gitbook.io/yukkimusicbot/deployment/string-session)


## 🖇 Generating Pyrogram String Session

- Generate a Pyrogram String Session via [Replit](https://replit.com/@NotReallyShikhar/Yukki-Music-String-Gen)

- Generate a Pyrogram String Session via [Telegram String Generation Bot](https://t.me/YukkiStringBot)


## 🖇 Heroku Deployment

<h4>Click the button below to deploy Yukki on Heroku!</h4>
<a href="https://yukki.tech/deploy/"><img src="https://img.shields.io/badge/Deploy%20To%20Heroku-blueviolet?style=for-the-badge&logo=heroku" width="200""/></a>

> Click on buttons below to expand and detailed explanation process. !

<details>
<summary><b> Detailed Heroku Depoyment Process » </b></summary>

<img src="https://telegra.ph/file/672efa7b8160ed39c6e86.jpg" align="right" width="350" height="700"/>

### 🚀 Deploy Process
- Click on the deploy button above and login to your [heroku account](https://heroku.com/login) .
- Fill your values there.
Expand All @@ -73,44 +75,44 @@ For more information on the technologies that power the Yukki Music Bot, check o
- Click on **Deploy** button.
- Please wait till the app gets deployed on heroku. Deploying can take upto **2-3 mins**..
- When your app is successfully deployed, click on **Manage App** button.


### 🚀 Booting Process
- Search for **Resources** Tab inside your app. ( Check Image for more details)
- Search for **Resources** Tab inside your app. ( Check Image for more details)
- Click on the **Pencil Icon** under resources section.
- Turn **on** the **switch** present there near pencil icon.
- Congrats your Music Bot is now **Booting**.


### 🚀 Checking Logs
- After Turning on your booting .
- Click on the **More Button** present at top right corner .
- Click on the **View Logs** button from the drop down menu.
- You check your logs there!
- You check your logs there!
- Click on save button there at bottom to save your logs and forward it to us on [@YukkiSupport](https://t.me/YukkiSupport) if you face any problem

</details>

## 🖇 VPS Deployment

> Checkout [Docs](https://notreallyshikhar.gitbook.io/yukkimusicbot/deployment/local-hosting-or-vps) for Detailed Explanation on VPS Deploy

```console
shikhar@MacBook~ $ git clone https://github.com/notreallyshikhar/YukkiMusicBot
shikhar@MacBook~ $ cd YukkiMusicBot
shikhar@MacBook~ $ sudo bash setup
```
> Setup will install each and every requirement, nodejs and pip packages automatically. After successfull installation of requirements , setup will ask you to input your vars.
> Setup will install each and every requirement, nodejs and pip packages automatically. After successfull installation of requirements , setup will ask you to input your vars.
> Please input your vars correctly.
```console
shikhar@MacBook~ $ bash start
```

> Not Getting VPS Method? [Watch Tutorial](https://t.me/TheYukki/2275)

<img src="https://telegra.ph/file/6b75b57da50ef1183fcdc.jpg" align="center">


Expand All @@ -130,7 +132,7 @@ If you want to say **thank you** or/and support active development of YukkiMusic
- Fork the Repo :)
- Write interesting articles about the project on [Dev.to](https://dev.to/), [Medium](https://medium.com/) or your personal blog.

PS: You can buy me a coffee too :)
PS: You can buy me a coffee too :)
<p><a href="https://www.buymeacoffee.com/notreallysy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 35px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a></p>

Together, we can make YukkiMusicBot **better**!
Expand Down Expand Up @@ -175,5 +177,3 @@ Special thanks to these amazing projects/people which/who help power Yukki Music


Reminder that you are great, you are enough, and your presence is valued. If you are struggling with your mental health, please reach out to someone you love and consult a professional.


20 changes: 13 additions & 7 deletions YukkiMusic/core/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ async def join_assistant(self, original_chat_id, chat_id):
language = await get_lang(original_chat_id)
_ = get_string(language)
userbot = await get_assistant(chat_id)
try:
botstatus = await app.get_chat_member(chat_id, app.id)
except UserNotParticipant:
raise AssistantErr(_["call_11"].format(app.username, chat_id))
except ChatAdminRequired:
raise AssistantErr(_["call_1"])
if botstatus.status == "administrator":
if botstatus.can_restrict_members:
raise AssistantErr(_["call_7"])
if botstatus.can_promote_members:
raise AssistantErr(_["call_8"])
try:
try:
get = await app.get_chat_member(chat_id, userbot.id)
Expand Down Expand Up @@ -200,12 +211,7 @@ async def join_assistant(self, original_chat_id, chat_id):
pass
except Exception as e:
raise AssistantErr(_["call_3"].format(e))
botstatus = await app.get_chat_member(chat_id, app.id)
if botstatus.status == "administrator":
if botstatus.can_restrict_members:
raise AssistantErr(_["call_7"])
if botstatus.can_promote_members:
raise AssistantErr(_["call_8"])


async def join_call(
self,
Expand Down Expand Up @@ -260,7 +266,7 @@ async def change_stream(self, client, chat_id):
loop = loop - 1
await set_loop(chat_id, loop)
if popped:
if config.AUTO_DOWNLOADS_CLEAR:
if config.AUTO_DOWNLOADS_CLEAR == str(True):
await auto_clean(popped)
if not check:
await _clear_(chat_id)
Expand Down
14 changes: 7 additions & 7 deletions YukkiMusic/plugins/admins/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
filters.command(LOOP_COMMAND) & filters.group & ~BANNED_USERS
)
@AdminRightsCheck
async def admins(cli, message: Message, _, mystic, chat_id):
async def admins(cli, message: Message, _, chat_id):
usage = _["admin_24"]
if len(message.command) != 2:
return await mystic.edit_text(usage)
return await message.reply_text(usage)
state = message.text.split(None, 1)[1].strip()
if state.isnumeric():
state = int(state)
Expand All @@ -39,20 +39,20 @@ async def admins(cli, message: Message, _, mystic, chat_id):
if int(state) > 10:
state = 10
await set_loop(chat_id, state)
return await mystic.edit_text(
return await message.reply_text(
_["admin_25"].format(
message.from_user.first_name, state
)
)
else:
return await mystic.edit_text(_["admin_26"])
return await message.reply_text(_["admin_26"])
elif state.lower() == "enable":
await set_loop(chat_id, 10)
return await mystic.edit_text(
return await message.reply_text(
_["admin_25"].format(message.from_user.first_name, state)
)
elif state.lower() == "disable":
await set_loop(chat_id, 0)
return await mystic.edit_text(_["admin_27"])
return await message.reply_text(_["admin_27"])
else:
return await mystic.edit_text(usage)
return await message.reply_text(usage)
8 changes: 4 additions & 4 deletions YukkiMusic/plugins/admins/mute.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
filters.command(MUTE_COMMAND) & filters.group & ~BANNED_USERS
)
@AdminRightsCheck
async def mute_admin(cli, message: Message, _, mystic, chat_id):
async def mute_admin(cli, message: Message, _, chat_id):
if not len(message.command) == 1:
return await mystic.edit_text(_["general_2"])
return await message.reply_text(_["general_2"])
if await is_muted(chat_id):
return await mystic.edit_text(_["admin_5"])
return await message.reply_text(_["admin_5"])
await mute_on(chat_id)
await Yukki.mute_stream(chat_id)
await mystic.edit_text(
await message.reply_text(
_["admin_6"].format(message.from_user.mention)
)
8 changes: 4 additions & 4 deletions YukkiMusic/plugins/admins/pause.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
filters.command(PAUSE_COMMAND) & filters.group & ~BANNED_USERS
)
@AdminRightsCheck
async def pause_admin(cli, message: Message, _, mystic, chat_id):
async def pause_admin(cli, message: Message, _, chat_id):
if not len(message.command) == 1:
return await mystic.edit_text(_["general_2"])
return await message.reply_text(_["general_2"])
if not await is_music_playing(chat_id):
return await mystic.edit_text(_["admin_1"])
return await message.reply_text(_["admin_1"])
await music_off(chat_id)
await Yukki.pause_stream(chat_id)
await mystic.edit_text(
await message.reply_text(
_["admin_2"].format(message.from_user.mention)
)
8 changes: 4 additions & 4 deletions YukkiMusic/plugins/admins/resume.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
filters.command(RESUME_COMMAND) & filters.group & ~BANNED_USERS
)
@AdminRightsCheck
async def resume_com(cli, message: Message, _, mystic, chat_id):
async def resume_com(cli, message: Message, _, chat_id):
if not len(message.command) == 1:
return await mystic.edit_text(_["general_2"])
return await message.reply_text(_["general_2"])
if await is_music_playing(chat_id):
return await mystic.edit_text(_["admin_3"])
return await message.reply_text(_["admin_3"])
await music_on(chat_id)
await Yukki.resume_stream(chat_id)
await mystic.edit_text(
await message.reply_text(
_["admin_4"].format(message.from_user.mention)
)
13 changes: 6 additions & 7 deletions YukkiMusic/plugins/admins/shuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,22 @@
filters.command(SHUFFLE_COMMAND) & filters.group & ~BANNED_USERS
)
@AdminRightsCheck
async def admins(Client, message: Message, _, mystic, chat_id):
async def admins(Client, message: Message, _, chat_id):
if not len(message.command) == 1:
return await mystic.edit_text(_["general_2"])
return await message.reply_text(_["general_2"])
check = db.get(chat_id)
if not check:
return await mystic.edit_text(_["admin_21"])
print(len(check))
return await message.reply_text(_["admin_21"])
try:
popped = check.pop(0)
except:
return await mystic.edit_text(_["admin_22"])
return await message.reply_text(_["admin_22"])
check = db.get(chat_id)
if not check:
check.insert(0, popped)
return await mystic.edit_text(_["admin_22"])
return await message.reply_text(_["admin_22"])
random.shuffle(check)
check.insert(0, popped)
await mystic.edit_text(
await message.reply_text(
_["admin_23"].format(message.from_user.first_name)
)
Loading

0 comments on commit 47c5fd8

Please sign in to comment.