Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump mikepenz/release-changelog-builder-action from 3.7.1 to 3.7.2 #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github May 4, 2023

Bumps mikepenz/release-changelog-builder-action from 3.7.1 to 3.7.2.

Release notes

Sourced from mikepenz/release-changelog-builder-action's releases.

v3.7.2

🚀 Features

  • Add number in the list of properties supported for rules | Offer configuration to mark rules also exhaustive (independent of label categorisation)

📦 Dependencies

  • Update dependencies | semver 7.5.0
Commits
  • 342972d Merge pull request #1094 from mikepenz/develop
  • 2b06a6b Merge pull request #1092 from mikepenz/feature/dependency_updates_20230503
  • cf17555 ```
  • 0c2ddea Merge branch 'zaphiro-technologies-add-pr-number-#1079' into develop
  • 9368ec2 - rename to exhaustive_rules
  • d594c56 revert linter changes
  • 1794edb add possibility to configure if rules are and/or independently from labels
  • fa8d010 add test combining number and status
  • aa0c892 fix mapping to string of number value
  • 4da4b3f add number in the list of properties supported for rules
  • See full diff in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [mikepenz/release-changelog-builder-action](https://github.com/mikepenz/release-changelog-builder-action) from 3.7.1 to 3.7.2.
- [Release notes](https://github.com/mikepenz/release-changelog-builder-action/releases)
- [Commits](mikepenz/release-changelog-builder-action@v3.7.1...v3.7.2)

---
updated-dependencies:
- dependency-name: mikepenz/release-changelog-builder-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot @github
Copy link
Author

dependabot bot commented on behalf of github May 4, 2023

The following labels could not be found: release/skip.

@pxseu pxseu force-pushed the main branch 2 times, most recently from cc95ab3 to 2eaf427 Compare October 2, 2023 23:53
@Moviy522
Copy link

package moviy ;

public interface Moviy {

}

  1. .env Fayl yaratish

BOT_TOKEN="7063700608:AAH0FY2bAe7SI1wYeWSEOkzNQSgUfsLz7FM"
CHANNEL_USERNAME="@Moviy_Angel"
ADMINS="I_want_to_learn_D, Javohir_01_01" # Adminlarning usernamesini yozing

  1. Python Kutubxonalarini O'rnatish

pip install python-telegram-bot yt-dlp python-dotenv ffmpeg-python moviepy

  1. Bot Kodingiz

import os
import subprocess
import asyncio
from telegram import Update, ChatMember, InlineKeyboardMarkup, InlineKeyboardButton
from telegram.ext import ApplicationBuilder, CommandHandler, MessageHandler, filters, ContextTypes
from dotenv import load_dotenv

.env faylini yuklash

load_dotenv()
TOKEN = os.getenv('BOT_TOKEN')
CHANNEL_USERNAME = os.getenv('CHANNEL_USERNAME')
ADMIN_USERNAMES = os.getenv('ADMINS').split(', ')

Admin ID larini olish

async def get_admin_ids(context: ContextTypes.DEFAULT_TYPE):
admin_ids = []
for username in ADMIN_USERNAMES:
try:
user = await context.bot.get_chat_member(CHANNEL_USERNAME, username)
admin_ids.append(user.user.id)
except:
print(f"{username} topilmadi.")
return admin_ids

ADMINS = []

Botga start komandasi

async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
global ADMINS
ADMINS = await get_admin_ids(context)
user_id = update.message.from_user.id
if user_id in ADMINS:
await update.message.reply_text("Salom Admin! Bot tayyor.")
else:
await update.message.reply_text("Salom! Botdan foydalanish uchun ruxsatingiz yo'q.")

Video yuklab olish funksiyasi (pechatlarni olib tashlash)

async def download_video(update: Update, context: ContextTypes.DEFAULT_TYPE):
url = update.message.text
if 'youtube.com' in url or 'youtu.be' in url or 'instagram.com' in url:
await update.message.reply_text("Videoni yuklab olyapman, biroz kuting...")
input_file = 'video.mp4'
output_file = 'clean_video.mp4'
try:
# YouTube yoki Instagram'dan yuklab olish
subprocess.run(['yt-dlp', '-o', input_file, url], check=True)

        # Pechatni olib tashlash (delogo)
        command = [
            'ffmpeg', '-i', input_file,
            '-vf', "delogo=x=10:y=10:w=100:h=50:show=0",
            '-c:a', 'copy', output_file
        ]
        subprocess.run(command, check=True)

        with open(output_file, 'rb') as f:
            await update.message.reply_document(f)

        # Fayllarni tozalash
        os.remove(input_file)
        os.remove(output_file)

    except Exception as e:
        await update.message.reply_text(f"Xatolik yuz berdi: {e}")

Haqoratli so'zlarni filtrlash

async def chat_filter(update: Update, context: ContextTypes.DEFAULT_TYPE):
bad_words = ["haqorat1", "haqorat2"]
text = update.message.text.lower()
if any(word in text for word in bad_words):
await update.message.delete()
await update.message.reply_text("Iltimos, odobli bo'ling!", quote=False)

Statistika funksiyasi

async def send_stats(update: Update, context: ContextTypes.DEFAULT_TYPE):
if update.message.from_user.id in ADMINS:
chat_members_count = await context.bot.get_chat_members_count(CHANNEL_USERNAME)
await update.message.reply_text(f"Kanal a'zolari soni: {chat_members_count}")
else:
await update.message.reply_text("Sizda ruxsat yo'q!")

Admin tayinlash

async def add_admin(update: Update, context: ContextTypes.DEFAULT_TYPE):
if update.message.from_user.id in ADMINS:
new_admin = update.message.reply_to_message.from_user
if new_admin:
ADMINS.append(new_admin.id)
await update.message.reply_text(f"{new_admin.username} admin sifatida tayinlandi.")
else:
await update.message.reply_text("Iltimos, foydalanuvchini tanlang!")
else:
await update.message.reply_text("Sizda ruxsat yo'q!")

async def main():
global ADMINS
app = ApplicationBuilder().token(TOKEN).build()

ADMINS = await get_admin_ids(app.bot)

# Buyruqlar
app.add_handler(CommandHandler('start', start))
app.add_handler(CommandHandler('stats', send_stats))
app.add_handler(CommandHandler('add_admin', add_admin))

# Xabarlar uchun handlerlar
app.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, chat_filter))
app.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, download_video))

print("Bot ishga tushdi...")
await app.run_polling()

if name == 'main':
asyncio.run(main())

  1. Botni Ishga Tushirish

Yuqoridagi kodni bot.py fayl sifatida saqlang va terminalda ishga tushiring:

python bot.py

  1. Funksiyalar

YouTube va Instagram videolarini pechatlardan tozalab yuklash.

Kanal va bot statistikasi (faqat adminlarga ko'rinadi).

Adminlarni tayinlash va tekshirish.

Haqoratli so'zlarni filtrlash.

Telegram kanallarida adminlar uchun nazorat qilish.

Yana qo'shimcha funksiyalar kerak bo'lsa, so'rang, kodni to'g'rilab yoki kengaytirib beraman!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant