File tree 15 files changed +165
-0
lines changed
15 files changed +165
-0
lines changed Original file line number Diff line number Diff line change
1
+ version = 1
2
+
3
+ [[analyzers ]]
4
+ name = " python"
5
+ enabled = true
6
+ dependency_file_paths = [" requirements.txt" ]
7
+
8
+ [analyzers .meta ]
9
+ runtime_version = " 3.x.x"
10
+ max_line_length = 100
Original file line number Diff line number Diff line change @@ -127,3 +127,11 @@ dmypy.json
127
127
128
128
# Pyre type checker
129
129
.pyre /
130
+
131
+ # config files
132
+ config.ini
133
+ config.env
134
+ .vscode /
135
+ * .session
136
+ log.txt
137
+ unknown_errors.txt
Original file line number Diff line number Diff line change
1
+ # File : .pep8speaks.yml
2
+
3
+ scanner :
4
+ linter : flake8
5
+
6
+ flake8 :
7
+ max-line-length : 100
8
+
9
+ message :
10
+ opened :
11
+ header : " @{name}, Thanks for opening this PR."
12
+ updated :
13
+ header : " @{name}, Thanks for updating this PR."
Original file line number Diff line number Diff line change
1
+ worker : bash run
Original file line number Diff line number Diff line change
1
+ # Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >.
2
+ #
3
+ # This file is part of < https://github.com/UsergeTeam/Userge-Assistant > project,
4
+ # and is released under the "GNU v3.0 License Agreement".
5
+ # Please see < https://github.com/Userge-Assistant/blob/master/LICENSE >
6
+ #
7
+ # All rights reserved.
8
+
9
+ from .logger import logging #noqa
10
+ from .config import Config #noqa
11
+ from .bot import bot #noqa
Original file line number Diff line number Diff line change
1
+ # Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >.
2
+ #
3
+ # This file is part of < https://github.com/UsergeTeam/Userge-Assistant > project,
4
+ # and is released under the "GNU v3.0 License Agreement".
5
+ # Please see < https://github.com/Userge-Assistant/blob/master/LICENSE >
6
+ #
7
+ # All rights reserved.
8
+
9
+ from assistant import bot
10
+
11
+ if __name__ == "__main__" :
12
+ bot .run ()
Original file line number Diff line number Diff line change
1
+ # Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >.
2
+ #
3
+ # This file is part of < https://github.com/UsergeTeam/Userge-Assistant > project,
4
+ # and is released under the "GNU v3.0 License Agreement".
5
+ # Please see < https://github.com/Userge-Assistant/blob/master/LICENSE >
6
+ #
7
+ # All rights reserved.
8
+
9
+ from pyrogram import Client
10
+
11
+ from assistant import Config , logging
12
+
13
+ LOG = logging .getLogger (__name__ )
14
+
15
+ bot = Client (
16
+ "userge-assistant" ,
17
+ api_id = Config .APP_ID ,
18
+ api_hash = Config .API_HASH ,
19
+ bot_token = Config .BOT_TOKEN ,
20
+ plugins = {'root' : "assistant/plugins" }
21
+ )
22
+
23
+ LOG .info ("assistant-bot initialized!" )
Original file line number Diff line number Diff line change
1
+ # Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >.
2
+ #
3
+ # This file is part of < https://github.com/UsergeTeam/Userge-Assistant > project,
4
+ # and is released under the "GNU v3.0 License Agreement".
5
+ # Please see < https://github.com/Userge-Assistant/blob/master/LICENSE >
6
+ #
7
+ # All rights reserved.
8
+
9
+ import os
10
+
11
+ from pyrogram import Filters
12
+ from dotenv import load_dotenv
13
+
14
+ if os .path .isfile ("config.env" ):
15
+ load_dotenv ("config.env" )
16
+
17
+
18
+ class Config :
19
+ APP_ID = int (os .environ .get ("APP_ID" , 0 ))
20
+ API_HASH = os .environ .get ("API_HASH" )
21
+ BOT_TOKEN = os .environ .get ("BOT_TOKEN" )
22
+ AUTH_CHATS = Filters .chat (list (set (map (int , os .environ .get ("AUTH_CHATS" , "123" ).split ()))))
Original file line number Diff line number Diff line change
1
+ # Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >.
2
+ #
3
+ # This file is part of < https://github.com/UsergeTeam/Userge-Assistant > project,
4
+ # and is released under the "GNU v3.0 License Agreement".
5
+ # Please see < https://github.com/Userge-Assistant/blob/master/LICENSE >
6
+ #
7
+ # All rights reserved.
8
+
9
+ import logging
10
+
11
+ logging .basicConfig (
12
+ level = logging .INFO ,
13
+ format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
14
+ )
15
+
16
+ logging .getLogger ("pyrogram" ).setLevel (logging .WARNING )
Original file line number Diff line number Diff line change
1
+ # Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >.
2
+ #
3
+ # This file is part of < https://github.com/UsergeTeam/Userge-Assistant > project,
4
+ # and is released under the "GNU v3.0 License Agreement".
5
+ # Please see < https://github.com/Userge-Assistant/blob/master/LICENSE >
6
+ #
7
+ # All rights reserved.
Original file line number Diff line number Diff line change
1
+ # Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >.
2
+ #
3
+ # This file is part of < https://github.com/UsergeTeam/Userge-Assistant > project,
4
+ # and is released under the "GNU v3.0 License Agreement".
5
+ # Please see < https://github.com/Userge-Assistant/blob/master/LICENSE >
6
+ #
7
+ # All rights reserved.
8
+
9
+ from datetime import datetime
10
+
11
+ from pyrogram import Message , Filters
12
+
13
+ from assistant import bot , Config
14
+
15
+
16
+ @bot .on_message (Config .AUTH_CHATS & Filters .command ("ping" ))
17
+ async def _ping (_ , message : Message ):
18
+ start = datetime .now ()
19
+ replied = await message .reply ('`Pong!`' )
20
+ end = datetime .now ()
21
+ m_s = (end - start ).microseconds / 1000
22
+ await replied .edit (f"**Pong!**\n `{ m_s } ms`" )
Original file line number Diff line number Diff line change
1
+ # Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >.
2
+ #
3
+ # This file is part of < https://github.com/UsergeTeam/Userge-Assistant > project,
4
+ # and is released under the "GNU v3.0 License Agreement".
5
+ # Please see < https://github.com/Userge-Assistant/blob/master/LICENSE >
6
+ #
7
+ # All rights reserved.
Original file line number Diff line number Diff line change 1
1
git+https://github.com/pyrogram/pyrogram.git@asyncio-dev
2
2
aiofiles
3
3
aiohttp
4
+ python-dotenv
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # Copyright (C) 2020 by UsergeTeam@Github, < https://github.com/UsergeTeam >.
4
+ #
5
+ # This file is part of < https://github.com/UsergeTeam/Userge-Assistant > project,
6
+ # and is released under the "GNU v3.0 License Agreement".
7
+ # Please see < https://github.com/Userge-Assistant/blob/master/LICENSE >
8
+ #
9
+ # All rights reserved.
10
+
11
+ python3.8 -m assistant
Original file line number Diff line number Diff line change
1
+ python-3.8.5
You can’t perform that action at this time.
0 commit comments