Karma commited on
Commit
b5108f0
·
1 Parent(s): 247097f

Delete Infamous directory

Browse files
Files changed (2) hide show
  1. Infamous/karma.py +0 -91
  2. Infamous/temp.py +0 -122
Infamous/karma.py DELETED
@@ -1,91 +0,0 @@
1
- # https://github.com/Infamous-Hydra/YaeMiko
2
- # https://github.com/Team-ProjectCodeX
3
- # https://t.me/O_okarma
4
-
5
- # <============================================== IMPORTS =========================================================>
6
- from pyrogram.types import InlineKeyboardButton as ib
7
- from telegram import InlineKeyboardButton
8
-
9
- from Mikobot import BOT_USERNAME, OWNER_ID, SUPPORT_CHAT
10
-
11
- # <============================================== CONSTANTS =========================================================>
12
- START_IMG = [
13
- "https://telegra.ph/file/40b93b46642124605e678.jpg",
14
- "https://telegra.ph/file/01a2e0cd1b9d03808c546.jpg",
15
- "https://telegra.ph/file/ed4385c26dcf6de70543f.jpg",
16
- "https://telegra.ph/file/33a8d97739a2a4f81ddde.jpg",
17
- "https://telegra.ph/file/cce9038f6a9b88eb409b5.jpg",
18
- "https://telegra.ph/file/262c86393730a609cdade.jpg",
19
- "https://telegra.ph/file/33a8d97739a2a4f81ddde.jpg",
20
- ]
21
-
22
- HEY_IMG = "https://telegra.ph/file/33a8d97739a2a4f81ddde.jpg"
23
-
24
- ALIVE_ANIMATION = [
25
- "https://telegra.ph//file/f9e2b9cdd9324fc39970a.mp4",
26
- "https://telegra.ph//file/8d4d7d06efebe2f8becd0.mp4",
27
- "https://telegra.ph//file/c4c2759c5fc04cefd207a.mp4",
28
- "https://telegra.ph//file/b1fa6609b1c4807255927.mp4",
29
- "https://telegra.ph//file/f3c7147da6511fbe27c25.mp4",
30
- "https://telegra.ph//file/39071b73c02e3ff5945ca.mp4",
31
- "https://telegra.ph//file/8d4d7d06efebe2f8becd0.mp4",
32
- "https://telegra.ph//file/6efdd8e28756bc2f6e53e.mp4",
33
- ]
34
-
35
- FIRST_PART_TEXT = "✨ *ʜᴇʟʟᴏ* `{}` . . ."
36
-
37
- PM_START_TEXT = "✨ *ɪ ᴀᴍ ᴍɪᴋᴏ, ᴀ ɢᴇɴꜱʜɪɴ ɪᴍᴘᴀᴄᴛ ᴛʜᴇᴍᴇᴅ ʀᴏʙᴏᴛ ᴡʜɪᴄʜ ᴄᴀɴ ʜᴇʟᴘ ʏᴏᴜ ᴛᴏ ᴍᴀɴᴀɢᴇ ᴀɴᴅ ꜱᴇᴄᴜʀᴇ ʏᴏᴜʀ ɢʀᴏᴜᴘ ᴡɪᴛʜ ʜᴜɢᴇ ɢʀᴏᴜᴘ ᴍᴀɴᴀɢᴇᴍᴇɴᴛ*"
38
-
39
- START_BTN = [
40
- [
41
- InlineKeyboardButton(
42
- text="⇦ ADD ME ⇨",
43
- url=f"https://t.me/{BOT_USERNAME}?startgroup=true",
44
- ),
45
- ],
46
- [
47
- InlineKeyboardButton(text="HELP", callback_data="help_back"),
48
- ],
49
- [
50
- InlineKeyboardButton(text="DETAILS", callback_data="Miko_"),
51
- InlineKeyboardButton(text="AI", callback_data="ai_handler"),
52
- InlineKeyboardButton(text="SOURCE", callback_data="git_source"),
53
- ],
54
- [
55
- InlineKeyboardButton(text="CREATOR", url=f"tg://user?id={OWNER_ID}"),
56
- ],
57
- ]
58
-
59
- GROUP_START_BTN = [
60
- [
61
- InlineKeyboardButton(
62
- text="⇦ ADD ME ⇨",
63
- url=f"https://t.me/{BOT_USERNAME}?startgroup=true",
64
- ),
65
- ],
66
- [
67
- InlineKeyboardButton(text="SUPPORT", url=f"https://t.me/{SUPPORT_CHAT}"),
68
- InlineKeyboardButton(text="CREATOR", url=f"tg://user?id={OWNER_ID}"),
69
- ],
70
- ]
71
-
72
- ALIVE_BTN = [
73
- [
74
- ib(text="UPDATES", url="https://t.me/Hydra_Updates"),
75
- ib(text="SUPPORT", url="https://t.me/hydraXsupport"),
76
- ],
77
- [
78
- ib(
79
- text="⇦ ADD ME ⇨",
80
- url=f"https://t.me/{BOT_USERNAME}?startgroup=true",
81
- ),
82
- ],
83
- ]
84
-
85
- HELP_STRINGS = """
86
- 🫧 *Yae-Miko* 🫧
87
-
88
- ☉ *Here, you will find a list of all the available commands.*
89
-
90
- ᴀʟʟ ᴄᴏᴍᴍᴀɴᴅs ᴄᴀɴ ʙᴇ ᴜsᴇᴅ ᴡɪᴛʜ : /
91
- """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Infamous/temp.py DELETED
@@ -1,122 +0,0 @@
1
- # <============================================== IMPORTS =========================================================>
2
- import asyncio
3
- import os
4
- from logging import getLogger
5
- from typing import Union
6
-
7
- from pymongo import MongoClient
8
- from pyrogram.errors import (
9
- FloodWait,
10
- InputUserDeactivated,
11
- PeerIdInvalid,
12
- UserIsBlocked,
13
- )
14
- from pyrogram.types import Message
15
-
16
- from Mikobot import DB_NAME, MONGO_DB_URI
17
-
18
- client = MongoClient(MONGO_DB_URI)
19
- dbname = client[DB_NAME]
20
-
21
- LOGGER = getLogger(__name__)
22
- BANNED = {}
23
- # <=======================================================================================================>
24
-
25
-
26
- # <=================================================== CLASS ====================================================>
27
- # temp db for banned
28
- class temp(object):
29
- BANNED_USERS = []
30
- BANNED_CHATS = []
31
- ME = None
32
- CURRENT = int(os.environ.get("SKIP", 2))
33
- CANCEL = False
34
- MELCOW = {}
35
- U_NAME = None
36
- B_NAME = None
37
-
38
-
39
- # <=======================================================================================================>
40
-
41
-
42
- # <================================================ FUNCTION =======================================================>
43
- def broadcast_messages(user_id, message):
44
- try:
45
- message.copy(chat_id=user_id)
46
- return True, "Succes"
47
- except FloodWait as e:
48
- asyncio.sleep(e.x)
49
- return broadcast_messages(user_id, message)
50
- except InputUserDeactivated:
51
- dbname.delete_user(int(user_id))
52
- LOGGER.info(f"{user_id}-Removed from Database, since deleted account.")
53
- return False, "Deleted"
54
- except UserIsBlocked:
55
- LOGGER.info(f"{user_id} -Blocked the bot.")
56
- return False, "Blocked"
57
- except PeerIdInvalid:
58
- dbname.delete_user(int(user_id))
59
- LOGGER.info(f"{user_id} - PeerIdInvalid")
60
- return False, "Error"
61
- except Exception:
62
- return False, "Error"
63
-
64
-
65
- def get_size(size):
66
- """Get size in readable format"""
67
-
68
- units = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB"]
69
- size = float(size)
70
- i = 0
71
- while size >= 1024.0 and i < len(units):
72
- i += 1
73
- size /= 1024.0
74
- return "%.2f %s" % (size, units[i])
75
-
76
-
77
- def get_file_id(msg: Message):
78
- if msg.media:
79
- for message_type in (
80
- "photo",
81
- "animation",
82
- "audio",
83
- "document",
84
- "video",
85
- "video_note",
86
- "voice",
87
- "sticker",
88
- ):
89
- if obj := getattr(msg, message_type):
90
- setattr(obj, "message_type", message_type)
91
- return obj
92
-
93
-
94
- def extract_user(message: Message) -> Union[int, str]:
95
- """extracts the user from a message"""
96
- # https://github.com/SpEcHiDe/PyroGramBot/blob/f30e2cca12002121bad1982f68cd0ff9814ce027/pyrobot/helper_functions/extract_user.py#L7
97
- user_id = None
98
- user_first_name = None
99
- if message.reply_to_message:
100
- user_id = message.reply_to_message.from_user.id
101
- user_first_name = message.reply_to_message.from_user.first_name
102
-
103
- elif len(message.command) > 1:
104
- if len(message.entities) > 1 and message.entities[1].type == "text_mention":
105
- required_entity = message.entities[1]
106
- user_id = required_entity.user.id
107
- user_first_name = required_entity.user.first_name
108
- else:
109
- user_id = message.command[1]
110
- # don't want to make a request -_-
111
- user_first_name = user_id
112
- try:
113
- user_id = int(user_id)
114
- except ValueError:
115
- pass
116
- else:
117
- user_id = message.from_user.id
118
- user_first_name = message.from_user.first_name
119
- return (user_id, user_first_name)
120
-
121
-
122
- # <================================================ END =======================================================>