Skip to content

Commit

Permalink
Updating 75 files
Browse files Browse the repository at this point in the history
  • Loading branch information
SantiiRepair committed Aug 7, 2023
1 parent e751bd1 commit c57e84c
Show file tree
Hide file tree
Showing 38 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ lint:

# command to run bot in normal mode
run_bot:
python3 -m tlg_bot
python3 -m bot

# command to run bot in virtual enviroment
run_bot_virtual_env:
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tlg_bot/__init__.py → bot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import logging
from termcolor import colored
from tlg_bot.config import Config
from bot.config import Config
from telethon.sync import TelegramClient
from pytgcalls import GroupCallFactory

Expand Down
6 changes: 3 additions & 3 deletions tlg_bot/__main__.py → bot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
import telethon
import glob
from pathlib import Path
from tlg_bot.utils import load_plugins
from bot.utils import load_plugins
import logging
from termcolor import colored
from tlg_bot import kreacher
from bot import kreacher


logging.basicConfig(
format="[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s",
level=logging.INFO,
)

path = "tlg_bot/plugins/*.py"
path = "bot/plugins/*.py"
files = glob.glob(path)
for name in files:
with open(name) as a:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tlg_bot import config, kreacher
from bot import config, kreacher
from telethon import events
from telethon.tl.functions.messages import SearchRequest
from telethon.tl.types import InputMessagesFilterVideo
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from tlg_bot.dicts.dicts import QUEUE, VOICE_CHATS
from tlg_bot.helpers.queues import (
from bot.dicts.dicts import QUEUE, VOICE_CHATS
from bot.helpers.queues import (
clear_queue,
get_queue,
pop_an_item,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tlg_bot/helpers/yt_dlp.py → bot/helpers/yt_dlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import os.path
from yt_dlp import YoutubeDL
from tlg_bot import kreacher as bot
from bot import kreacher as bot
from telethon.tl.functions.channels import GetParticipantRequest
from telethon.tl.types import (
ChannelParticipantAdmin,
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tlg_bot/plugins/actives.py → bot/plugins/actives.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from asyncio import sleep
from telethon import events
from tlg_bot import kreacher
from tlg_bot.dicts.dicts import VOICE_CHATS
from bot import kreacher
from bot.dicts.dicts import VOICE_CHATS


@kreacher.on(events.NewMessage(pattern="[!?/]actives"))
Expand Down
2 changes: 1 addition & 1 deletion tlg_bot/plugins/admins.py → bot/plugins/admins.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from telethon import events, Button
from tlg_bot import kreacher
from bot import kreacher


@kreacher.on(events.callbackquery.CallbackQuery(data="admin"))
Expand Down
6 changes: 3 additions & 3 deletions tlg_bot/plugins/callbacks.py → bot/plugins/callbacks.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from asyncio import sleep
from tlg_bot import config, kreacher
from tlg_bot.dicts.dicts import QUEUE, VOICE_CHATS
from bot import config, kreacher
from bot.dicts.dicts import QUEUE, VOICE_CHATS
from telethon import events, Button
from tlg_bot.helpers.queues_handler import next_item, skip_current
from bot.helpers.queues_handler import next_item, skip_current

thumb = "https://telegra.ph/file/3e14128ad5c9ec47801bd.jpg"

Expand Down
2 changes: 1 addition & 1 deletion tlg_bot/plugins/help.py → bot/plugins/help.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from telethon import events, Button
from tlg_bot import kreacher, config
from bot import kreacher, config


@kreacher.on(events.NewMessage(pattern="[!?/]help"))
Expand Down
4 changes: 2 additions & 2 deletions tlg_bot/plugins/leave.py → bot/plugins/leave.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from tlg_bot import kreacher
from tlg_bot.dicts.dicts import VOICE_CHATS
from bot import kreacher
from bot.dicts.dicts import VOICE_CHATS
from telethon import events


Expand Down
4 changes: 2 additions & 2 deletions tlg_bot/plugins/new.py → bot/plugins/new.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from tlg_bot import ins, kreacher
from tlg_bot.dicts.dicts import VOICE_CHATS
from bot import ins, kreacher
from bot.dicts.dicts import VOICE_CHATS
from telethon import events


Expand Down
2 changes: 1 addition & 1 deletion tlg_bot/plugins/ping.py → bot/plugins/ping.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from time import time
from datetime import datetime
from telethon import events
from tlg_bot import kreacher
from bot import kreacher


START_TIME = datetime.utcnow()
Expand Down
10 changes: 5 additions & 5 deletions tlg_bot/plugins/play_song.py → bot/plugins/play_song.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import uuid
from asyncio import sleep

# from tlg_bot.helpers.thumbnail import gen_thumb
# from bot.helpers.thumbnail import gen_thumb
from telethon import Button, events
from tlg_bot.dicts.dicts import QUEUE, VOICE_CHATS
from tlg_bot.helpers.queues import (
from bot.dicts.dicts import QUEUE, VOICE_CHATS
from bot.helpers.queues import (
add_to_queue,
clear_queue,
)
from tlg_bot.helpers.yt_dlp import bash
from tlg_bot import config, ins, kreacher
from bot.helpers.yt_dlp import bash
from bot import config, ins, kreacher
from telethon.tl import types
from telethon.utils import get_display_name
from youtubesearchpython import VideosSearch
Expand Down
6 changes: 3 additions & 3 deletions tlg_bot/plugins/play_video.py → bot/plugins/play_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import uuid
from asyncio import sleep
from youtubesearchpython import VideosSearch
from tlg_bot import client, ins, kreacher
from tlg_bot.helpers.queues import get_queue
from tlg_bot.dicts.dicts import QUEUE, VOICE_CHATS
from bot import client, ins, kreacher
from bot.helpers.queues import get_queue
from bot.dicts.dicts import QUEUE, VOICE_CHATS
from telethon import Button, events

from yt_dlp import YoutubeDL
Expand Down
2 changes: 1 addition & 1 deletion tlg_bot/plugins/speedtest.py → bot/plugins/speedtest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from telethon import events
from tlg_bot import kreacher
from bot import kreacher
import asyncio
import speedtest

Expand Down
2 changes: 1 addition & 1 deletion tlg_bot/plugins/start.py → bot/plugins/start.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tlg_bot import kreacher, config
from bot import kreacher, config
from telethon import events, Button


Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions tlg_bot/tasks/background.py → bot/tasks/background.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from tlg_bot import ins
from bot import ins
from pytgcalls.types import Update
from tlg_bot.helpers.queues_handler import skip_current
from tlg_bot.dicts.dicts import QUEUE
from tlg_bot.helpers.queues import (
from bot.helpers.queues_handler import skip_current
from bot.dicts.dicts import QUEUE
from bot.helpers.queues import (
clear_queue,
active,
)
Expand Down
6 changes: 3 additions & 3 deletions tlg_bot/utils.py → bot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@


def load_plugins(plugin_name):
path = Path(f"tlg_bot/plugins/{plugin_name}.py")
name = "tlg_bot.plugins.{}".format(plugin_name)
path = Path(f"bot/plugins/{plugin_name}.py")
name = "bot.plugins.{}".format(plugin_name)
spec = importlib.util.spec_from_file_location(name, path)
load = importlib.util.module_from_spec(spec)
load.logger = logging.getLogger(plugin_name)
spec.loader.exec_module(load)
sys.modules["tlg_bot.plugins." + plugin_name] = load
sys.modules["bot.plugins." + plugin_name] = load
print(
f'{colored("[INFO]", "blue")}: Bot has started {colored(plugin_name, "yellow")}'
)

0 comments on commit c57e84c

Please sign in to comment.