Danish Aditya Error Anonymous commited on
Commit
7316343
·
1 Parent(s): 83c6c4d

Fixes v0.0.8.1

Browse files

* Fixed YouTube
* Fixed Shutdown
* Button In asst Fixed
* Fixed paste & open
* Anime
* Minor bugs

Co-authored-by: Aditya <[email protected]>
Co-authored-by: Error <[email protected]>
Co-authored-by: Anonymous <[email protected]>

Dockerfile CHANGED
@@ -13,6 +13,7 @@ RUN git clone https://github.com/TeamUltroid/Ultroid.git /root/TeamUltroid/
13
  WORKDIR /root/TeamUltroid/
14
 
15
  RUN pip3 install --no-cache-dir -r requirements.txt
 
16
  RUN npm install -g [email protected] -g
17
  RUN npm install
18
  RUN npm run build
 
13
  WORKDIR /root/TeamUltroid/
14
 
15
  RUN pip3 install --no-cache-dir -r requirements.txt
16
+
17
  RUN npm install -g [email protected] -g
18
  RUN npm install
19
  RUN npm run build
assistant/start.py CHANGED
@@ -76,39 +76,41 @@ async def ultroid(event):
76
  )
77
  ],
78
  )
 
79
  if (
80
  not is_added(event.sender_id)
81
  and str(event.sender_id) not in owner_and_sudos()
82
  ):
83
  add_user(event.sender_id)
84
- ok = ""
85
- u = await event.client.get_entity(event.chat_id)
86
- if not udB.get("STARTMSG"):
87
- if udB.get("PMBOT") == "True":
88
- ok = "You can contact my master using this bot!!\n\nSend your Message, I will Deliver it To Master."
89
- await event.reply(
90
- f"Hey there [{get_display_name(u)}](tg://user?id={u.id}), this is Ultroid Assistant of [{ultroid_bot.me.first_name}](tg://user?id={ultroid_bot.uid})!\n\n{ok}",
91
- buttons=[Button.inline("Info.", data="ownerinfo")],
92
- )
 
 
 
 
 
 
 
 
93
  else:
94
- me = f"[{ultroid_bot.me.first_name}](tg://user?id={ultroid_bot.uid})"
95
- mention = f"[{get_display_name(u)}](tg://user?id={u.id})"
96
- await event.reply(
97
- Redis("STARTMSG").format(me=me, mention=mention),
98
- buttons=[Button.inline("Info.", data="ownerinfo")],
99
- )
100
- else:
101
- name = get_display_name(event.sender_id)
102
- if event.pattern_match.group(1) == "set":
103
- await event.reply(
104
- "Choose from the below options -",
105
- buttons=_settings,
106
- )
107
- else:
108
- await event.reply(
109
- get_string("ast_3").format(name),
110
- buttons=_start,
111
- )
112
 
113
 
114
  @callback("mainmenu")
 
76
  )
77
  ],
78
  )
79
+ else:
80
  if (
81
  not is_added(event.sender_id)
82
  and str(event.sender_id) not in owner_and_sudos()
83
  ):
84
  add_user(event.sender_id)
85
+ if str(event.sender_id) not in owner_and_sudos():
86
+ ok = ""
87
+ u = await event.client.get_entity(event.chat_id)
88
+ if not udB.get("STARTMSG"):
89
+ if udB.get("PMBOT") == "True":
90
+ ok = "You can contact my master using this bot!!\n\nSend your Message, I will Deliver it To Master."
91
+ await event.reply(
92
+ f"Hey there [{get_display_name(u)}](tg://user?id={u.id}), this is Ultroid Assistant of [{ultroid_bot.me.first_name}](tg://user?id={ultroid_bot.uid})!\n\n{ok}",
93
+ buttons=[Button.inline("Info.", data="ownerinfo")],
94
+ )
95
+ else:
96
+ me = f"[{ultroid_bot.me.first_name}](tg://user?id={ultroid_bot.uid})"
97
+ mention = f"[{get_display_name(u)}](tg://user?id={u.id})"
98
+ await event.reply(
99
+ Redis("STARTMSG").format(me=me, mention=mention),
100
+ buttons=[Button.inline("Info.", data="ownerinfo")],
101
+ )
102
  else:
103
+ name = get_display_name(event.sender_id)
104
+ if event.pattern_match.group(1) == "set":
105
+ await event.reply(
106
+ "Choose from the below options -",
107
+ buttons=_settings,
108
+ )
109
+ else:
110
+ await event.reply(
111
+ get_string("ast_3").format(name),
112
+ buttons=_start,
113
+ )
 
 
 
 
 
 
 
114
 
115
 
116
  @callback("mainmenu")
plugins/__init__.py CHANGED
@@ -30,7 +30,7 @@ except ModuleNotFoundError:
30
 
31
 
32
  start_time = time.time()
33
- ultroid_version = "v0.0.8"
34
  OWNER_NAME = ultroid_bot.me.first_name
35
  OWNER_ID = ultroid_bot.me.id
36
 
 
30
 
31
 
32
  start_time = time.time()
33
+ ultroid_version = "v0.0.8.1"
34
  OWNER_NAME = ultroid_bot.me.first_name
35
  OWNER_ID = ultroid_bot.me.id
36
 
plugins/anime.py CHANGED
@@ -39,7 +39,6 @@ async def airing_anime(event):
39
  await event.delete()
40
 
41
 
42
- """
43
  @ultroid_cmd(pattern="anime ?(.*)")
44
  async def anilist(event):
45
  name = event.pattern_match.group(1)
@@ -50,7 +49,6 @@ async def anilist(event):
50
  msg = f"**{title}**\n{year} | {episodes} Episodes.\n\n{info}"
51
  await event.reply(msg, file=banner, link_preview=True)
52
  await x.delete()
53
- """
54
 
55
 
56
  @ultroid_cmd(pattern="character ?(.*)")
 
39
  await event.delete()
40
 
41
 
 
42
  @ultroid_cmd(pattern="anime ?(.*)")
43
  async def anilist(event):
44
  name = event.pattern_match.group(1)
 
49
  msg = f"**{title}**\n{year} | {episodes} Episodes.\n\n{info}"
50
  await event.reply(msg, file=banner, link_preview=True)
51
  await x.delete()
 
52
 
53
 
54
  @ultroid_cmd(pattern="character ?(.*)")
plugins/bot.py CHANGED
@@ -122,7 +122,7 @@ async def shutdownbot(ult):
122
  await shutdown(ult)
123
 
124
 
125
- @ultroid_bot.on(events.NewMessage(pattern=f"\\{HNDLR}logs$"))
126
  async def _(event):
127
  if event.fwd_from:
128
  return
 
122
  await shutdown(ult)
123
 
124
 
125
+ @ultroid_bot.on(events.NewMessage(pattern=f"\\{HNDLR}logs ?(.*)"))
126
  async def _(event):
127
  if event.fwd_from:
128
  return
plugins/converter.py CHANGED
@@ -193,7 +193,7 @@ async def _(event):
193
  try:
194
  await xx.edit(f"```{d}```")
195
  except BaseException:
196
- what, key = get_paste(message)
197
  if "neko" in what:
198
  await xx.edit(
199
  f"**MESSAGE EXCEEDS TELEGRAM LIMITS**\n\nSo Pasted It On [NEKOBIN](https://nekobin.com/{key})"
 
193
  try:
194
  await xx.edit(f"```{d}```")
195
  except BaseException:
196
+ what, key = get_paste(d)
197
  if "neko" in what:
198
  await xx.edit(
199
  f"**MESSAGE EXCEEDS TELEGRAM LIMITS**\n\nSo Pasted It On [NEKOBIN](https://nekobin.com/{key})"
plugins/deezer.py CHANGED
@@ -11,3 +11,74 @@
11
  • `{i}deez <search query (| flac)>`
12
  Download songs from Deezer
13
  """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  • `{i}deez <search query (| flac)>`
12
  Download songs from Deezer
13
  """
14
+ import os
15
+ import time
16
+ from json.decoder import JSONDecodeError
17
+ from urllib.request import urlretrieve
18
+
19
+ import requests as r
20
+ from telethon.tl.types import DocumentAttributeAudio
21
+
22
+ from . import *
23
+
24
+
25
+ @ultroid_cmd(
26
+ pattern="deez ?(.*)",
27
+ )
28
+ async def siesace(e):
29
+ song = e.pattern_match.group(1)
30
+ if not song:
31
+ return await eod(e, "Give me Something to Search")
32
+ quality = "mp3"
33
+ if "| flac" in song:
34
+ try:
35
+ song = song.split("|")[0]
36
+ quality = "flac"
37
+ except Exception as ex:
38
+ await eod(e, f"`{str(ex)}`")
39
+ hmm = time.time()
40
+ lol = await eor(e, "`Searching on Deezer...`")
41
+ sung = song.replace(" ", "%20")
42
+ url = f"https://jostapi.herokuapp.com/deezer?query={sung}&quality={quality}&count=1"
43
+ try:
44
+ k = (r.get(url)).json()[0]
45
+ except IndexError:
46
+ return await eod(lol, "`Song Not Found.. `")
47
+ except JSONDecodeError:
48
+ return await eod(
49
+ lol, f"`Tell `[sɪᴘᴀᴋ](tg://user?id=1303895686)`to turn on API.`"
50
+ )
51
+ try:
52
+ title = k["title"]
53
+ urrl = k["raw_link"]
54
+ img = k["album"]["cover_xl"]
55
+ duration = k["duration"]
56
+ singers = k["artist"]["name"]
57
+ except Exception as ex:
58
+ return await eod(lol, f"`{str(ex)}`")
59
+ urlretrieve(urrl, title + "." + quality)
60
+ urlretrieve(img, title + ".jpg")
61
+ okk = await uploader(
62
+ title + "." + quality,
63
+ title + "." + quality,
64
+ hmm,
65
+ lol,
66
+ "Uploading " + title + "...",
67
+ )
68
+ await ultroid_bot.send_file(
69
+ e.chat_id,
70
+ okk,
71
+ caption="`" + title + "`" + "\n`From Deezer`",
72
+ attributes=[
73
+ DocumentAttributeAudio(
74
+ duration=int(duration),
75
+ title=title,
76
+ performer=singers,
77
+ )
78
+ ],
79
+ supports_streaming=True,
80
+ thumb=title + ".jpg",
81
+ )
82
+ await lol.delete()
83
+ os.remove(title + "." + quality)
84
+ os.remove(title + ".jpg")
plugins/download_upload.py CHANGED
@@ -126,6 +126,8 @@ async def download(event):
126
  hmm = " | stream"
127
  if " | stream" in hmm:
128
  metadata = extractMetadata(createParser(res.name))
 
 
129
  wi = 512
130
  hi = 512
131
  duration = 0
 
126
  hmm = " | stream"
127
  if " | stream" in hmm:
128
  metadata = extractMetadata(createParser(res.name))
129
+ if not metadata:
130
+ return await event.reply(file=res, supports_streaming=True)
131
  wi = 512
132
  hi = 512
133
  duration = 0
plugins/saavn.py CHANGED
@@ -15,7 +15,6 @@
15
 
16
  import os
17
  import time
18
- from json.decoder import JSONDecodeError
19
  from urllib.request import urlretrieve
20
 
21
  import requests as r
@@ -71,65 +70,3 @@ async def siesace(e):
71
  await lol.delete()
72
  os.remove(title + ".mp3")
73
  os.remove(title + ".jpg")
74
-
75
-
76
- @ultroid_cmd(
77
- pattern="deez ?(.*)",
78
- )
79
- async def siesace(e):
80
- song = e.pattern_match.group(1)
81
- if not song:
82
- return await eod(e, "Give me Something to Search")
83
- quality = "mp3"
84
- if "| flac" in song:
85
- try:
86
- song = song.split("|")[0]
87
- quality = "flac"
88
- except Exception as ex:
89
- await eod(e, f"`{str(ex)}`")
90
- hmm = time.time()
91
- lol = await eor(e, "`Searching on Deezer...`")
92
- sung = song.replace(" ", "%20")
93
- url = f"https://jostapi.herokuapp.com/deezer?query={sung}&quality={quality}&count=1"
94
- try:
95
- k = (r.get(url)).json()[0]
96
- except IndexError:
97
- return await eod(lol, "`Song Not Found.. `")
98
- except JSONDecodeError:
99
- return await eod(
100
- lol, f"`Tell `[sɪᴘᴀᴋ](tg://user?id=1303895686)`to turn on API.`"
101
- )
102
- try:
103
- title = k["title"]
104
- urrl = k["raw_link"]
105
- img = k["album"]["cover_xl"]
106
- duration = k["duration"]
107
- singers = k["artist"]["name"]
108
- except Exception as ex:
109
- return await eod(lol, f"`{str(ex)}`")
110
- urlretrieve(urrl, title + "." + quality)
111
- urlretrieve(img, title + ".jpg")
112
- okk = await uploader(
113
- title + "." + quality,
114
- title + "." + quality,
115
- hmm,
116
- lol,
117
- "Uploading " + title + "...",
118
- )
119
- await ultroid_bot.send_file(
120
- e.chat_id,
121
- okk,
122
- caption="`" + title + "`" + "\n`From Deezer`",
123
- attributes=[
124
- DocumentAttributeAudio(
125
- duration=int(duration),
126
- title=title,
127
- performer=singers,
128
- )
129
- ],
130
- supports_streaming=True,
131
- thumb=title + ".jpg",
132
- )
133
- await lol.delete()
134
- os.remove(title + "." + quality)
135
- os.remove(title + ".jpg")
 
15
 
16
  import os
17
  import time
 
18
  from urllib.request import urlretrieve
19
 
20
  import requests as r
 
70
  await lol.delete()
71
  os.remove(title + ".mp3")
72
  os.remove(title + ".jpg")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugins/utilities.py CHANGED
@@ -63,7 +63,6 @@ import os
63
  import time
64
  from datetime import datetime as dt
65
 
66
- import pytz
67
  import requests
68
  from telegraph import Telegraph
69
  from telegraph import upload_file as uf
@@ -75,7 +74,7 @@ from telethon.tl.functions.channels import (
75
  LeaveChannelRequest,
76
  )
77
  from telethon.tl.functions.contacts import GetBlockedRequest
78
- from telethon.tl.functions.messages import AddChatUserRequest
79
  from telethon.tl.functions.photos import GetUserPhotosRequest
80
  from telethon.tl.types import Channel, Chat, InputMediaPoll, Poll, PollAnswer, User
81
  from telethon.utils import get_input_location
@@ -202,6 +201,11 @@ async def stats(
202
  ct = (await ultroid_bot(GetBlockedRequest(1, 0))).count
203
  except AttributeError:
204
  ct = 0
 
 
 
 
 
205
  full_name = inline_mention(await ultroid_bot.get_me())
206
  response = f"🔸 **Stats for {full_name}** \n\n"
207
  response += f"**Private Chats:** {private_chats} \n"
@@ -217,7 +221,8 @@ async def stats(
217
  response += f"** •• **`Admin Rights: {admin_in_broadcast_channels - creator_in_channels}` \n"
218
  response += f"**Unread:** {unread} \n"
219
  response += f"**Unread Mentions:** {unread_mentions} \n"
220
- response += f"**Blocked Users:** {ct}\n\n"
 
221
  response += f"**__It Took:__** {stop_time:.02f}s \n"
222
  await ok.edit(response)
223
 
 
63
  import time
64
  from datetime import datetime as dt
65
 
 
66
  import requests
67
  from telegraph import Telegraph
68
  from telegraph import upload_file as uf
 
74
  LeaveChannelRequest,
75
  )
76
  from telethon.tl.functions.contacts import GetBlockedRequest
77
+ from telethon.tl.functions.messages import AddChatUserRequest, GetAllStickersRequest
78
  from telethon.tl.functions.photos import GetUserPhotosRequest
79
  from telethon.tl.types import Channel, Chat, InputMediaPoll, Poll, PollAnswer, User
80
  from telethon.utils import get_input_location
 
201
  ct = (await ultroid_bot(GetBlockedRequest(1, 0))).count
202
  except AttributeError:
203
  ct = 0
204
+ try:
205
+ sp = await ultroid_bot(GetAllStickersRequest(0))
206
+ sp_count = len(sp.sets)
207
+ except BaseException:
208
+ sp_count = 0
209
  full_name = inline_mention(await ultroid_bot.get_me())
210
  response = f"🔸 **Stats for {full_name}** \n\n"
211
  response += f"**Private Chats:** {private_chats} \n"
 
221
  response += f"** •• **`Admin Rights: {admin_in_broadcast_channels - creator_in_channels}` \n"
222
  response += f"**Unread:** {unread} \n"
223
  response += f"**Unread Mentions:** {unread_mentions} \n"
224
+ response += f"**Blocked Users:** {ct}\n"
225
+ response += f"**Total Stickers Pack Installed :** `{sp_count}`\n\n"
226
  response += f"**__It Took:__** {stop_time:.02f}s \n"
227
  await ok.edit(response)
228
 
plugins/vcplugin.py CHANGED
@@ -27,15 +27,16 @@
27
  • `{i}rmvcaccess <id/username/reply to msg>`
28
  Remove access of Voice Chat Bot.
29
 
30
- • **Voice Chat Bot Commands**
31
  `/play ytsearch : song-name`
32
  `/play youtube link`
33
  `/current`
34
  `/skip`
35
  `/exitVc`
36
-
37
  """
38
 
 
 
39
  from pyUltroid.functions.vc_sudos import add_vcsudo, del_vcsudo, get_vcsudos, is_vcsudo
40
  from telethon.tl.functions.channels import GetFullChannelRequest as getchat
41
  from telethon.tl.functions.phone import CreateGroupCallRequest as startvc
@@ -79,7 +80,15 @@ async def _(e):
79
  LOGS.info(er)
80
  LOGS.info(out)
81
  if er:
82
- await zz.edit(f"Failed {er}\n\n{out}")
 
 
 
 
 
 
 
 
83
 
84
 
85
  @ultroid_cmd(
 
27
  • `{i}rmvcaccess <id/username/reply to msg>`
28
  Remove access of Voice Chat Bot.
29
 
30
+ • **Voice Chat - Bot Commands**
31
  `/play ytsearch : song-name`
32
  `/play youtube link`
33
  `/current`
34
  `/skip`
35
  `/exitVc`
 
36
  """
37
 
38
+ from os import remove
39
+
40
  from pyUltroid.functions.vc_sudos import add_vcsudo, del_vcsudo, get_vcsudos, is_vcsudo
41
  from telethon.tl.functions.channels import GetFullChannelRequest as getchat
42
  from telethon.tl.functions.phone import CreateGroupCallRequest as startvc
 
80
  LOGS.info(er)
81
  LOGS.info(out)
82
  if er:
83
+ msg = f"Failed {er}\n\n{out}"
84
+ if len(msg) > 4096:
85
+ with open("vc-error.txt", "w") as f:
86
+ f.write(msg.replace("`", ""))
87
+ await e.reply(file="vc-error.txt")
88
+ await zz.delete()
89
+ remove("vc-error.txt")
90
+ return
91
+ await zz.edit(msg)
92
 
93
 
94
  @ultroid_cmd(
requirements.txt CHANGED
@@ -1,3 +1,3 @@
1
- py-Ultroid==2021.6.17
2
  Shazamio
3
  https://github.com/New-dev0/Telethon/archive/BETTER.zip
 
1
+ py-Ultroid==2021.6.18.1
2
  Shazamio
3
  https://github.com/New-dev0/Telethon/archive/BETTER.zip
src/handlers/playFile.ts CHANGED
@@ -58,8 +58,8 @@ export const filePlayHandler = Composer.command('playFile', async (ctx) => {
58
  parse_mode: 'HTML',
59
  ...Markup.inlineKeyboard([
60
  [
61
- Markup.button.callback('Pause', `pause:${escapeHtml(id)}`),
62
- Markup.button.callback('Skip', `skip:${escapeHtml(id)}`)
63
  ],
64
  [
65
  Markup.button.callback('Exit', `exitVc`),
 
58
  parse_mode: 'HTML',
59
  ...Markup.inlineKeyboard([
60
  [
61
+ Markup.button.callback('Pause', `pause:${id}`),
62
+ Markup.button.callback('Skip', `skip:${id}`)
63
  ],
64
  [
65
  Markup.button.callback('Exit', `exitVc`),
strings/strings/ka.yml CHANGED
@@ -1,7 +1,7 @@
1
  name: Kannada
2
  natively: ಕನ್ನಡ
3
 
4
- author:
5
  - anishgowda21
6
 
7
  #commons
 
1
  name: Kannada
2
  natively: ಕನ್ನಡ
3
 
4
+ authors:
5
  - anishgowda21
6
 
7
  #commons
vcstarter.py CHANGED
@@ -4,7 +4,7 @@ from json.decoder import JSONDecodeError
4
 
5
  from aiohttp import web
6
  from aiohttp.http_websocket import WSMsgType
7
- from pyUltroid import vcbot, udB
8
  from pyUltroid.dB.database import Var
9
  from telethon import TelegramClient
10
  from telethon.tl.functions.channels import GetFullChannelRequest
@@ -174,7 +174,7 @@ if vcbot:
174
  def main():
175
  app = web.Application()
176
  app.router.add_route("GET", "/", websocket_handler)
177
- web.run_app(app, host="localhost", port=6969)
178
 
179
  vcbot.start()
180
  main()
 
4
 
5
  from aiohttp import web
6
  from aiohttp.http_websocket import WSMsgType
7
+ from pyUltroid import udB, vcbot
8
  from pyUltroid.dB.database import Var
9
  from telethon import TelegramClient
10
  from telethon.tl.functions.channels import GetFullChannelRequest
 
174
  def main():
175
  app = web.Application()
176
  app.router.add_route("GET", "/", websocket_handler)
177
+ web.run_app(app, host="127.0.0.1", port=6969)
178
 
179
  vcbot.start()
180
  main()