{Sed}",
65 | parse_mode="HTML",
66 | )
67 |
68 |
69 |
--------------------------------------------------------------------------------
/DaisyX/modules/pins.py:
--------------------------------------------------------------------------------
1 | # This file is part of Daisy (Telegram Bot)
2 |
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU Affero General Public License as
5 | # published by the Free Software Foundation, either version 3 of the
6 | # License, or (at your option) any later version.
7 |
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU Affero General Public License for more details.
12 |
13 | # You should have received a copy of the GNU Affero General Public License
14 | # along with this program. If not, see {name}\n\nAddress:-{address}\n\nIP ADDRESS:-{ip}\n\ncredit card:-{cc}\n\nEmail Id:-{email}\n\nJob:-{job}\n\nandroid user agent:-{android}\n\nPc user agent:-{pc}",
42 | parse_mode="HTML",
43 | )
44 |
45 |
46 |
47 |
48 | @tbot.on(events.NewMessage(pattern="/picgen$"))
49 | async def _(event):
50 | if event.fwd_from:
51 | return
52 | if await is_admin(event, event.message.sender_id):
53 | url = "https://thispersondoesnotexist.com/image"
54 | response = requests.get(url)
55 | if response.status_code == 200:
56 | with open("FRIDAYOT.jpg", "wb") as f:
57 | f.write(response.content)
58 |
59 | captin = f"Fake Image powered by @DaisySupport_Official."
60 | fole = "FRIDAYOT.jpg"
61 | await tbot.send_file(event.chat_id, fole, caption=captin)
62 | await event.delete()
63 | os.system("rm ./FRIDAYOT.jpg ")
64 |
65 |
--------------------------------------------------------------------------------
/DaisyX/modules/utils/android.py:
--------------------------------------------------------------------------------
1 | # This file is part of Daisy (Telegram Bot)
2 |
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU Affero General Public License as
5 | # published by the Free Software Foundation, either version 3 of the
6 | # License, or (at your option) any later version.
7 |
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU Affero General Public License for more details.
12 |
13 | # You should have received a copy of the GNU Affero General Public License
14 | # along with this program. If not, see /del" command message.
81 | """
82 |
--------------------------------------------------------------------------------
/DaisyX/Addons/tempmail/tempmail.py:
--------------------------------------------------------------------------------
1 | # MissJuliaRobot (A Telegram Bot Project)
2 | # Copyright (C) 2019-2021 Julia (https://t.me/MissJulia_Robot)
3 |
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU Affero General Public License as published by
6 | # the Free Software Foundation, in version 3 of the License.
7 |
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU Affero General Public License for more details.
12 |
13 | # You should have received a copy of the GNU Affero General Public License
14 | # along with this program. If not, see < https://www.gnu.org/licenses/agpl-3.0.en.html/ >.
15 |
16 |
17 | import string
18 | import random
19 | from hashlib import md5
20 | import requests
21 |
22 |
23 | class TempMail(object):
24 | def __init__(
25 | self, login=None, domain=None, api_domain="privatix-temp-mail-v1.p.rapidapi.com"
26 | ):
27 | self.login = login
28 | self.domain = domain
29 | self.api_domain = api_domain
30 |
31 | def __repr__(self):
32 | return u"{old_ver} to {new_ver}"
30 | )
31 |
32 |
33 | # TODO: Logs channel
34 |
35 |
36 | log.debug("Checking on database structure update...")
37 |
38 | if not (data := mongodb.db_structure.find_one({'db_ver': {"$exists": True}})):
39 | log.info("Your database is empty! Creating database structure key...")
40 | mongodb.db_structure.insert_one({'db_ver': DB_STRUCTURE_VER})
41 | log.info("Database structure version is: " + str(DB_STRUCTURE_VER))
42 | else:
43 | curr_ver = data['db_ver']
44 | log.info("Your database structure version is: " + str(curr_ver))
45 | if DB_STRUCTURE_VER > curr_ver:
46 | log.error("Your database is old! Waiting 20 seconds till update...")
47 | log.info("Press CTRL + C to cancel!")
48 | time.sleep(20)
49 | log.debug("Trying to update database structure...")
50 | log.info("--------------------------------")
51 | log.info("Your current database structure version: " + str(curr_ver))
52 | log.info("New database structure version: " + str(DB_STRUCTURE_VER))
53 | log.info("--------------------------------")
54 | old_ver = curr_ver
55 | while curr_ver < DB_STRUCTURE_VER:
56 | new_ver = curr_ver + 1
57 | log.info(f"Trying update to {str(new_ver)}...")
58 |
59 | log.debug("Importing: DaisyX.db." + str(new_ver))
60 | import_module("DaisyX.db." + str(new_ver))
61 |
62 | curr_ver += 1
63 | mongodb.db_structure.update_one({'db_ver': curr_ver - 1}, {"$set": {'db_ver': curr_ver}})
64 |
65 | log.warn(f"Database update done to {str(curr_ver)} successfully!")
66 | log.debug("Let's notify the bot owner")
67 | loop = asyncio.get_event_loop()
68 | bot_info = loop.run_until_complete(notify_bot_owner(old_ver, curr_ver))
69 | log.info("Rescue normal bot startup...")
70 | else:
71 | log.debug("No database structure updates found, skipping!")
72 |
--------------------------------------------------------------------------------
/fortune.py:
--------------------------------------------------------------------------------
1 | import random
2 | import sys
3 | import codecs
4 | import re
5 |
6 | from optparse import OptionParser
7 |
8 | # ---------------------------------------------------------------------------
9 | # Exports
10 | # ---------------------------------------------------------------------------
11 |
12 | __all__ = ["main", "get_random_fortune"]
13 |
14 | # Info about the module
15 | __version__ = "1.1.0"
16 | __author__ = "Brian M. Clapper"
17 | __email__ = "bmc@clapper.org"
18 | __url__ = "http://software.clapper.org/fortune/"
19 | __copyright__ = "2008-2019 Brian M. Clapper"
20 | __license__ = "BSD-style license"
21 |
22 | # ---------------------------------------------------------------------------
23 | # Functions
24 | # ---------------------------------------------------------------------------
25 |
26 |
27 | def _random_int(start, end):
28 | try:
29 | # Use SystemRandom, if it's available, since it's likely to have
30 | # more entropy.
31 | r = random.SystemRandom()
32 | except BaseException:
33 | r = random
34 |
35 | return r.randint(start, end)
36 |
37 |
38 | def _read_fortunes(fortune_file):
39 | with codecs.open(fortune_file, mode="r", encoding="utf-8") as f:
40 | contents = f.read()
41 |
42 | lines = [line.rstrip() for line in contents.split("\n")]
43 |
44 | delim = re.compile(r"^%$")
45 |
46 | fortunes = []
47 | cur = []
48 |
49 | def save_if_nonempty(buf):
50 | fortune = "\n".join(buf)
51 | if fortune.strip():
52 | fortunes.append(fortune)
53 |
54 | for line in lines:
55 | if delim.match(line):
56 | save_if_nonempty(cur)
57 | cur = []
58 | continue
59 |
60 | cur.append(line)
61 |
62 | if cur:
63 | save_if_nonempty(cur)
64 |
65 | return fortunes
66 |
67 |
68 | def get_random_fortune(fortune_file):
69 | fortunes = list(_read_fortunes(fortune_file))
70 | randomRecord = _random_int(0, len(fortunes) - 1)
71 | return fortunes[randomRecord]
72 |
73 |
74 | def main():
75 | usage = "Usage: %prog [OPTIONS] [fortune_file]"
76 | arg_parser = OptionParser(usage=usage)
77 | arg_parser.add_option(
78 | "-V",
79 | "--version",
80 | action="store_true",
81 | dest="show_version",
82 | help="Show version and exit.",
83 | )
84 | arg_parser.epilog = (
85 | "If fortune_file is omitted, fortune looks at the "
86 | "FORTUNE_FILE environment variable for the path."
87 | )
88 |
89 | options, args = arg_parser.parse_args(sys.argv)
90 | if len(args) == 2:
91 | fortune_file = args[1]
92 |
93 | else:
94 | try:
95 | fortune_file = "notes.txt"
96 | except KeyError:
97 | print("Missing fortune file.", file=sys.stderr)
98 | print(usage, file=sys.stderr)
99 | sys.exit(1)
100 |
101 | try:
102 | if options.show_version:
103 | print("fortune, version {}".format(__version__))
104 | else:
105 | print(get_random_fortune(fortune_file))
106 | except ValueError as msg:
107 | print(msg, file=sys.stderr)
108 | sys.exit(1)
109 |
110 |
111 | if __name__ == "__main__":
112 | main()
113 |
--------------------------------------------------------------------------------
/DaisyX/modules/userinfo.py:
--------------------------------------------------------------------------------
1 | from datetime import datetime
2 |
3 | from pyrogram import filters
4 | from pyrogram.errors import PeerIdInvalid
5 | from pyrogram.types import Message, User
6 |
7 | from DaisyX.services.pyrogram import pbot
8 | import aiohttp
9 | from asyncio import sleep
10 | from DaisyX.services.pyrogram import pbot as kp
11 |
12 |
13 | def ReplyCheck(message: Message):
14 | reply_id = None
15 |
16 | if message.reply_to_message:
17 | reply_id = message.reply_to_message.message_id
18 |
19 | elif not message.from_user.is_self:
20 | reply_id = message.message_id
21 |
22 | return reply_id
23 |
24 |
25 | infotext = (
26 | "**[{full_name}](tg://user?id={user_id})**\n"
27 | " * UserID: `{user_id}`\n"
28 | " * First Name: `{first_name}`\n"
29 | " * Last Name: `{last_name}`\n"
30 | " * Username: `{username}`\n"
31 | " * Last Online: `{last_online}`\n"
32 | " * Bio: {bio}"
33 | )
34 |
35 |
36 | def LastOnline(user: User):
37 | if user.is_bot:
38 | return ""
39 | elif user.status == "recently":
40 | return "Recently"
41 | elif user.status == "within_week":
42 | return "Within the last week"
43 | elif user.status == "within_month":
44 | return "Within the last month"
45 | elif user.status == "long_time_ago":
46 | return "A long time ago :("
47 | elif user.status == "online":
48 | return "Currently Online"
49 | elif user.status == "offline":
50 | return datetime.fromtimestamp(user.status.date).strftime(
51 | "%a, %d %b %Y, %H:%M:%S"
52 | )
53 |
54 |
55 | def FullName(user: User):
56 | return user.first_name + " " + user.last_name if user.last_name else user.first_name
57 |
58 |
59 | @pbot.on_message(filters.command("whois") & ~filters.edited & ~filters.bot)
60 | async def whois(client, message):
61 | cmd = message.command
62 | if not message.reply_to_message and len(cmd) == 1:
63 | get_user = message.from_user.id
64 | elif len(cmd) == 1:
65 | get_user = message.reply_to_message.from_user.id
66 | elif len(cmd) > 1:
67 | get_user = cmd[1]
68 | try:
69 | get_user = int(cmd[1])
70 | except ValueError:
71 | pass
72 | try:
73 | user = await client.get_users(get_user)
74 | except PeerIdInvalid:
75 | await message.reply("I don't know that User.")
76 | return
77 | desc = await client.get_chat(get_user)
78 | desc = desc.description
79 | await message.reply_text(
80 | infotext.format(
81 | full_name=FullName(user),
82 | user_id=user.id,
83 | user_dc=user.dc_id,
84 | first_name=user.first_name,
85 | last_name=user.last_name if user.last_name else "",
86 | username=user.username if user.username else "",
87 | last_online=LastOnline(user),
88 | bio=desc if desc else "`No bio set up.`",
89 | ),
90 | disable_web_page_preview=True,
91 | )
92 |
93 |
94 |
95 |
96 |
97 | __mod_name__ = "User Info"
98 | __help__ = """
99 | Spam Info
100 | - /spwinfo : Check user's spam info from intellivoid's Spamprotection service
101 | Whois
102 | - /whois : Gives user's info like pyrogram
103 | """
104 |
--------------------------------------------------------------------------------
/DaisyX/modules/direct_link.py:
--------------------------------------------------------------------------------
1 | # This file is part of Daisy (Telegram Bot)
2 |
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU Affero General Public License as
5 | # published by the Free Software Foundation, either version 3 of the
6 | # License, or (at your option) any later version.
7 |
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU Affero General Public License for more details.
12 |
13 | # You should have received a copy of the GNU Affero General Public License
14 | # along with this program. If not, see /direct (url)"
33 | await message.reply(m)
34 | return
35 |
36 | if text:
37 | links = re.findall(r"\bhttps?://.*\.\S+", text)
38 | else:
39 | return
40 |
41 | reply = []
42 | if not links:
43 | await message.reply("No links found!")
44 | return
45 |
46 | for link in links:
47 | if "sourceforge.net" in link:
48 | reply.append(sourceforge(link))
49 | else:
50 | reply.append(
51 | re.findall(r"\bhttps?://(.*?[^/]+)", link)[0] + " is not supported"
52 | )
53 |
54 | await message.reply("\n".join(reply))
55 |
56 |
57 | def sourceforge(url: str) -> str:
58 | try:
59 | link = re.findall(r"\bhttps?://.*sourceforge\.net\S+", url)[0]
60 | except IndexError:
61 | reply = "No SourceForge links found\n"
62 | return reply
63 |
64 | file_path = re.findall(r"/files(.*)/download", link)
65 | if not file_path:
66 | file_path = re.findall(r"/files(.*)", link)
67 | file_path = file_path[0]
68 | reply = f"Mirrors for {file_path.split('/')[-1]}\n"
69 | project = re.findall(r"projects?/(.*?)/files", link)[0]
70 | mirrors = (
71 | f"https://sourceforge.net/settings/mirror_choices?"
72 | f"projectname={project}&filename={file_path}"
73 | )
74 | page = BeautifulSoup(requests.get(mirrors).content, "lxml")
75 | info = page.find("ul", {"id": "mirrorList"}).findAll("li")
76 |
77 | for mirror in info[1:]:
78 | name = re.findall(r"\((.*)\)", mirror.text.strip())[0]
79 | dl_url = (
80 | f'https://{mirror["id"]}.dl.sourceforge.net/project/{project}/{file_path}'
81 | )
82 | reply += f'{name} '
83 | return reply
84 |
85 |
86 | def useragent():
87 | useragents = BeautifulSoup(
88 | requests.get(
89 | "https://developers.whatismybrowser.com/"
90 | "useragents/explore/operating_system_name/android/"
91 | ).content,
92 | "lxml",
93 | ).findAll("td", {"class": "useragent"})
94 | user_agent = choice(useragents)
95 | return user_agent.text
96 |
--------------------------------------------------------------------------------
/DaisyX/modules/reports.py:
--------------------------------------------------------------------------------
1 | # This file is part of Daisy (Telegram Bot)
2 |
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU Affero General Public License as
5 | # published by the Free Software Foundation, either version 3 of the
6 | # License, or (at your option) any later version.
7 |
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU Affero General Public License for more details.
12 |
13 | # You should have received a copy of the GNU Affero General Public License
14 | # along with this program. If not, see
9 |
10 |
11 |
12 |
13 |
14 |
15 |
24 |
25 | ## Credits
26 |
27 | - [Hitsuki](https://github.com/HitsukiNetwork/Hitsukix)
28 | - [Utah](https://github.com/minatouzuki/utah)
29 | - [FridayUserbot](https://github.com/DevsExpo/FridayUserbot)
30 | - [MissJuliaRobot](https://github.com/MissJuliaRobot/MissJuliaRobot)
31 | - [DaisyX](https://github.com/teamdaisyx/daisy-x)
32 | - [Masha](https://github.com/Mr-Dark-Prince/MashaRoBot/)
33 |
34 |
35 | The bot is based on the original work done by [SophieBot](https://gitlab.com/SophieBot/sophie)
36 | This repo was just revamped to suit an Anime-centric & comedy loving community. All original credits go to SophieBot and their dedication, Without his efforts, this fork would not have been possible!
37 |
38 | All other credits mentioned on top of scripts
39 |
40 | Anything missing kindly let us know at [Jarvis support](http://t.me/jarvisupport) or simply submit a pull request on the readme.
41 | jarvisjarvispp
42 |
43 |
44 |
45 |
46 | ## Special Credits
47 | - [@Kaviya-Admin](https://github.com/kaviya-admin) - A Developer of Project
48 | - [@Anjana_Ma](https://github.com/Anjana_Ma) - A Developer of Project
49 | - [Dark Prince](https://github.com/Mr-Dark-Prince) - A Co-Developer of Project
50 | - [Official_Bawwa](https://github.com/OfficialBawwa) - A Developer of Project
51 | - [Inuka Asith](https://github.com/inukaasith) - A Developer of the project
52 | - [annihilatorrrr](https://github.com/annihilatorrrr) - A Co-Developer of Project
53 | - [@sithum batrow](https://github.com/sbatrow) - A Developer of Project
54 |
55 | - @charindith - Helper
56 | - @mubashirrehman - Helper
57 | - For you..
58 |
59 | And as always thanks to AioGram devs, Dan for pyrogram, lonami for telethon and Durov for telegram
60 | Special thanks to you for using bot.
61 |
--------------------------------------------------------------------------------
/DaisyX/modules/bassboost.py:
--------------------------------------------------------------------------------
1 | # Developer like bassboosting so made this
2 | # Not for others.. Sed
3 |
4 | import asyncio
5 | import io
6 | import math
7 | import os
8 |
9 | import numpy as np
10 | from pydub import AudioSegment
11 | from telethon import types
12 | from telethon import events
13 | from DaisyX.services.telethon import tbot
14 | from DaisyX.function.telethonbasics import is_admin
15 | from DaisyX import BOT_ID,OWNER_ID
16 | TMP_DOWNLOAD_DIRECTORY = "./"
17 |
18 | @tbot.on(events.NewMessage(pattern="/bassboost (.*)"))
19 | async def __(event):
20 | if not event.is_group:
21 |
22 | return
23 | if not await is_admin(event, BOT_ID):
24 |
25 | return
26 | if await event.message.sender_id == OWNER_ID:
27 | v = False
28 | accentuate_db = 40
29 | reply = await event.get_reply_message()
30 | if not reply:
31 | await event.reply("Can You Reply To A MSG :?")
32 | return
33 | if event.pattern_match.group(1):
34 | ar = event.pattern_match.group(1)
35 | try:
36 | int(ar)
37 | if int(ar) >= 2 and int(ar) <= 100:
38 | accentuate_db = int(ar)
39 | else:
40 | await event.reply("`BassBost Level Should Be From 2 to 100 Only.`")
41 | return
42 | except Exception as exx:
43 | await event.reply("`SomeThing Went Wrong..` \n**Error:** " + str(exx))
44 | return
45 | else:
46 | accentuate_db = 2
47 | lel=await event.reply("`Downloading This File...`")
48 | #fname = await tbot.download_media(message=reply.media)
49 | r_message = message=reply.media
50 | fname = await tbot.download_media(
51 | r_message, TMP_DOWNLOAD_DIRECTORY
52 | )
53 | await lel.edit("`BassBoosting In Progress..`")
54 | if fname.endswith(".oga") or fname.endswith(".ogg"):
55 | v = True
56 | audio = AudioSegment.from_file(fname)
57 | elif fname.endswith(".mp3") or fname.endswith(".m4a") or fname.endswith(".wav"):
58 | audio = AudioSegment.from_file(fname)
59 | else:
60 | await lel.edit(
61 | "`This Format is Not Supported Yet` \n**Currently Supported :** `mp3, m4a and wav.`"
62 | )
63 | os.remove(fname)
64 | return
65 | sample_track = list(audio.get_array_of_samples())
66 | await asyncio.sleep(0.3)
67 | est_mean = np.mean(sample_track)
68 | await asyncio.sleep(0.3)
69 | est_std = 3 * np.std(sample_track) / (math.sqrt(2))
70 | await asyncio.sleep(0.3)
71 | bass_factor = int(round((est_std - est_mean) * 0.005))
72 | await asyncio.sleep(5)
73 | attenuate_db = 0
74 | filtered = audio.low_pass_filter(bass_factor)
75 | await asyncio.sleep(5)
76 | out = (audio - attenuate_db).overlay(filtered + accentuate_db)
77 | await asyncio.sleep(6)
78 | m = io.BytesIO()
79 | if v:
80 | m.name = "voice.ogg"
81 | out.split_to_mono()
82 | await lel.edit("`Now Exporting...`")
83 | await asyncio.sleep(0.3)
84 | out.export(m, format="ogg", bitrate="64k", codec="libopus")
85 | await lel.edit("`Process Completed. Uploading Now Here..`")
86 | await tbot.send_file(
87 | event.chat_id,
88 | m,
89 | voice_note=True,
90 | caption="Bass Boosted, \nDone By @harvisupport",
91 | )
92 |
93 | os.remove(m)
94 | else:
95 | m.name = "BassBoosted.mp3"
96 | await lel.edit("`Now Exporting...`")
97 | await asyncio.sleep(0.3)
98 | out.export(m, format="mp3")
99 | await lel.edit("`Process Completed. Uploading Now Here..`")
100 | await tbot.send_file(
101 | event.chat_id,
102 | m,
103 | caption="Bass Boosted, \nDone By @jarvisupport",
104 | )
105 |
106 | os.remove(m)
107 | await event.delete()
108 |
109 | os.remove(fname)
110 |
111 | else:
112 | return
113 |
114 |
--------------------------------------------------------------------------------
/DaisyX/modules/text_filters.py:
--------------------------------------------------------------------------------
1 | # This filte is ported from WilliamButcherBot
2 | # Credits goes to TheHamkerCat
3 |
4 | # Don't edit these lines
5 |
6 | from DaisyX.services.pyrogram import pbot as app
7 | from DaisyX.services.mongo2 import db
8 | from DaisyX.function.pluginhelpers import member_permissions
9 | from DaisyX.db.mongo_helpers.filterdb import (
10 | _get_filters, save_filter,
11 | get_filters_names, get_filter,
12 | delete_filter
13 | )
14 | from pyrogram import filters
15 |
16 | @app.on_message(filters.command("add") & ~filters.edited & ~filters.private)
17 | async def save_filters(_, message):
18 | if len(message.command) < 2 or not message.reply_to_message:
19 | await message.reply_text("Usage:\nReply to a text or sticker with /filter '
56 | end = ''
57 |
58 |
59 | class Pre(StyleFormationCore):
60 | start = '' 61 | end = '' 62 | 63 | 64 | class Strikethrough(StyleFormationCore): 65 | start = '