Skip to content

Commit 12c68f8

Browse files
authored
Removed CHANNEL_ID variable
1 parent 39ab318 commit 12c68f8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plugins/channel_post.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@
55
from pyrogram.errors import FloodWait
66

77
from bot import Bot
8-
from config import ADMINS, CHANNEL_ID
8+
from config import ADMINS
99
from helper_func import encode
1010

1111
@Bot.on_message(filters.private & filters.user(ADMINS) & ~filters.command(['start','batch','genlink']))
1212
async def channel_post(client: Client, message: Message):
1313
reply_text = await message.reply_text("Please Wait...!", quote = True)
1414
try:
15-
post_message = await message.copy(chat_id = CHANNEL_ID, disable_notification=True)
15+
post_message = await message.copy(chat_id = client.db_channel.id, disable_notification=True)
1616
except FloodWait as e:
1717
await asyncio.sleep(e.x)
18-
post_message = await message.copy(chat_id = CHANNEL_ID, disable_notification=True)
18+
post_message = await message.copy(chat_id = client.db_channel.id, disable_notification=True)
1919
except Exception as e:
2020
print(e)
2121
await reply_text.edit_text("Something went Wrong..!")
2222
return
23-
converted_id = post_message.message_id * abs(CHANNEL_ID)
23+
converted_id = post_message.message_id * abs(client.db_channel.id)
2424
string = f"get-{converted_id}"
2525
base64_string = await encode(string)
2626
link = f"https://t.me/{client.username}?start={base64_string}"
2727
reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton("🔁 Share URL", url=f'https://telegram.me/share/url?url={link}')]])
2828
await reply_text.edit(f"<b>Here is your link</b>\n\n{link}", reply_markup=reply_markup, disable_web_page_preview = True)
2929

30-
@Bot.on_message(filters.channel & filters.incoming & filters.chat(CHANNEL_ID))
30+
@Bot.on_message(filters.channel & filters.incoming & filters.chat(client.db_channel.id))
3131
async def new_post(client: Client, message: Message):
32-
converted_id = message.message_id * abs(CHANNEL_ID)
32+
converted_id = message.message_id * abs(client.db_channel.id)
3333
string = f"get-{converted_id}"
3434
base64_string = await encode(string)
3535
link = f"https://t.me/{client.username}?start={base64_string}"

0 commit comments

Comments
 (0)