File size: 3,127 Bytes
21bc372
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import time
import pyromod
import aiohttp
import traceback
import aiohttp

from datetime import datetime as dt
from pyrogram import Client
from pyrogram.types import *
from pyrogram.errors import *
from pyrogram.raw.all import layer
from pyromod import listen
from config import *
from akn.utils.database import db
from platform import python_version
from pyrogram import __version__ as pyrogram_version

StartTime = time.time()
START_TIME = dt.now()
CMD_HELP = {}
ids = []
bot_clone_id = []
gemini_bot_id = []
act = []

async def send_log(text_log: str):
    url = "https://private-akeno.randydev.my.id/api/v2/send_message_logs"
    params = {
        "text_log": text_log
    }
    async with aiohttp.ClientSession() as session:
        async with session.post(url, params=params) as response:
            if response.status != 200:
                return None
            data = await response.json()
            return data["message"]

__version__ = {
    "pyrogram": pyrogram_version,
    "python": python_version(),

}

app = Client(
    "inlinebotme",
    api_id=API_ID,
    api_hash=API_HASH,
    bot_token=BOT_INLINE_TOKEN,
    plugins=dict(root="akn.Akeno.bot"),
    in_memory=True
)

assistant = Client(
    "akenome",
    app_version="akeno latest",
    api_id=API_ID,
    api_hash=API_HASH,
    bot_token=BOT_TOKEN,
    workers=300,
    plugins=dict(root="akn.manage"),
    sleep_threshold=180
)

"""
class Randydev(Client):
    def __init__(self, loop=None):
        self.loop = loop or asyncio.get_event_loop()
        super().__init__(
            "akenome",
            app_version="akeno latest",
            api_id=API_ID,
            api_hash=API_HASH,
            bot_token=BOT_TOKEN,
            workers=300,
            plugins=dict(root="akn.manage"),
            sleep_threshold=180,
        )

    async def start(self):
        await super().start()
        self.me = await self.get_me()
        self.start_time = time.time()
        LOGS.info(
            "akn running with Pyrogram v%s (Layer %s) started on @%s. Hi!",
            __version__,
            layer,
            self.me.username,
        )

    async def stop(self):
        await super().stop()
        LOGS.warning("akn stopped, Bye!")
        if self.loop and not self.loop.is_closed():
            self.loop.close()
"""

GROUP_ID = -1002290885889

async def log_detailed_error(error, where="Unknown", who="Unknown"):
    exc_type, exc_value, exc_traceback = error.__class__, error, error.__traceback__
    traceback_info = traceback.format_exc()
    filename = exc_traceback.tb_frame.f_code.co_filename
    line_number = exc_traceback.tb_lineno
    text = exc_traceback.tb_frame.f_code.co_name
    formating = (
        f"\n❌ Error fuck @xtdevs\n\n"
        f" Error: {exc_type.__name__}\n"
        f"What fuck?: `{exc_value}`\n"
        f"Group: `{who}`\n"
        f"User: `{where}`\n"
        f"See file name: `{filename}`\n"
        f"Line code: `{line_number}`\n"
        f"Text code: `{text}`\n\n"
        f"Full Traceback:\n<blockquote>{traceback_info}</blockquote>\n"
    )
    await app.send_message(GROUP_ID, formating)