This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Note: You can use database to store values | |
| # Only Custom emoji Supported | |
| @bot.command() | |
| async def rr_add(ctx, channel : discord.TextChannel, role :discord.Role, message_id : int, emoji:discord.Emoji): | |
| message = await channel.fetch_message(message_id) | |
| await message.add_reaction(emoji) | |
| if emch.is_emoji(emoji): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pip install quart | |
| #pip install Quart-Discord | |
| #pip install discord-ext-ipc | |
| from quart import Quart, render_template, url_for, redirect | |
| import quart_discord | |
| from quart_discord import DiscordOAuth2Session , requires_authorization, Unauthorized | |
| from discord.ext import ipc | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #author: hunter87ff | |
| #author_url: https://github.com/hunter87ff | |
| import request as rq | |
| def extract(url: str, type:str): #example - .mp3, .jpg, .mp4, .png etc. | |
| val = str(rq.get(url).content).split() | |
| for i in val: | |
| if type in i: | |
| return i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random as rn | |
| #pip install random | |
| def code_gen(): | |
| CL = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L','1', '2', '3', '4', '5', '6', '7', '8', '9', '0','M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] | |
| code = rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) + rn.choice(CL) | |
| return code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from bs4 import BeautifulSoup as bfs | |
| def fetch_title(url: str): | |
| if "https://youtu.be/" not in url: | |
| return print("Please Enter A Valid Link") | |
| reqs = requests.get(url) | |
| soup = bfs(reqs.text, 'html.parser') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from selenium import webdriver | |
| from webdriver_manager.chrome import ChromeDriverManager | |
| tokens = [] | |
| driver = webdriver.Chrome(executable_path='C:/Users/abc/Desktop/bot setup/server_mod/chromedriver.exe') | |
| def tokenLogin(): | |
| print('STATUS : [LOGIN WITH TOKEN]') | |
| opts = webdriver.ChromeOptions() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from bs4 import BeautifulSoup | |
| def fetch_audio(url): | |
| data = requests.get(url).content | |
| soup = BeautifulSoup(data,'html') | |
| images = soup.findAll('source') | |
| for image in images: | |
| img_url = image.get('src') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image | |
| import os | |
| from pathlib import Path | |
| from PyPDF2 import PdfFileMerger | |
| def convert_images_to_pdf(folder_path, output_file): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import moviepy.editor | |
| from pathlib import Path | |
| video_file = Path('video.mp4') | |
| video = moviepy.editor.VideoFileClip(f'{video_file}') | |
| audio = video.audio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from translate import Translator | |
| translator = Translator(to_lang="bn") | |
| text = "welcome" | |
| translated_text = translator.translate(text) | |
| print(translated_text) |
OlderNewer