Skip to content

Commit 33c7e75

Browse files
authored
Removed CHANNEL_ID variable
1 parent 12c68f8 commit 33c7e75

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plugins/link_generator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pyrogram import Client, filters
22
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
33
from bot import Bot
4-
from config import CHANNEL_ID, ADMINS
4+
from config import ADMINS
55
from helper_func import encode
66

77
@Bot.on_message(filters.private & filters.user(ADMINS) & filters.command('batch'))
@@ -12,7 +12,7 @@ async def batch(client: Client, message: Message):
1212
except:
1313
return
1414
if first_message.forward_from_chat:
15-
if first_message.forward_from_chat.id == CHANNEL_ID:
15+
if first_message.forward_from_chat.id == client.db_channel.id:
1616
f_msg_id = first_message.forward_from_message_id
1717
break
1818
await first_message.reply_text("Forward from the Assigned Channel only...", quote = True)
@@ -23,13 +23,13 @@ async def batch(client: Client, message: Message):
2323
except:
2424
return
2525
if second_message.forward_from_chat:
26-
if second_message.forward_from_chat.id == CHANNEL_ID:
26+
if second_message.forward_from_chat.id == client.db_channel.id:
2727
s_msg_id = second_message.forward_from_message_id
2828
break
2929
await second_message.reply_text("Forward from the Assigned Channel only...", quote = True)
3030
continue
3131

32-
string = f"get-{f_msg_id * abs(CHANNEL_ID)}-{s_msg_id * abs(CHANNEL_ID)}"
32+
string = f"get-{f_msg_id * abs(client.db_channel.id)}-{s_msg_id * abs(client.db_channel.id)}"
3333
base64_string = await encode(string)
3434
link = f"https://t.me/{client.username}?start={base64_string}"
3535
reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton("🔁 Share URL", url=f'https://telegram.me/share/url?url={link}')]])
@@ -44,13 +44,13 @@ async def link_generator(client: Client, message: Message):
4444
except:
4545
return
4646
if channel_message.forward_from_chat:
47-
if channel_message.forward_from_chat.id == CHANNEL_ID:
47+
if channel_message.forward_from_chat.id == client.db_channel.id:
4848
msg_id = channel_message.forward_from_message_id
4949
break
5050
await channel_message.reply_text("Forward from the Assigned Channel only...", quote = True)
5151
continue
5252

53-
base64_string = await encode(f"get-{msg_id * abs(CHANNEL_ID)}")
53+
base64_string = await encode(f"get-{msg_id * abs(client.db_channel.id)}")
5454
link = f"https://t.me/{client.username}?start={base64_string}"
5555
reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton("🔁 Share URL", url=f'https://telegram.me/share/url?url={link}')]])
5656
await channel_message.reply_text(f"<b>Here is your link</b>\n\n{link}", quote=True, reply_markup=reply_markup)

0 commit comments

Comments
 (0)