This file contains 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
@bot.group(invoke_without_command=True) | |
async def help(ctx): | |
invite_btn = Button(label="Invite Me", url="https://sprucebot.ml/invite") | |
vote_btn = Button(label="Vote Me", url="https://discord.ly/spruce/upvote") | |
btns = [invite_btn, vote_btn] | |
view = View() | |
for btn in btns: | |
view.add_item(btn) | |
emb = emd(title="Help Command", color=0xff0000, description=helpdsk) |
This file contains 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 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 ctypes | |
@bot.command() | |
async def uptime(ctx): | |
lib = ctypes.windll.kernel32 | |
t = lib.GetTickCount64() | |
t = int(str(t)[:-3]) | |
mins, sec = divmod(t, 60) | |
hour, mins = divmod(mins, 60) | |
days, hour = divmod(hour, 24) | |
return await ctx.reply(f"\🟢 Online For `{days:02}D {hour:02}H {mins:02}M`") |
This file contains 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 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 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 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 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 flask import Flask | |
from threading import Thread | |
app = Flask('') | |
@app.route('/') | |
def home(): | |
return "Hello. I am alive!" | |
def run(): |
This file contains 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 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
async def reply(message, check=None): | |
ctx = await bot.get_context(message) | |
check = check or (lambda m: m.channel == ctx.channel and m.author == ctx.author) | |
try: | |
msg = await ctx.bot.wait_for("message", check=check) | |
except asyncio.TimeoutError: | |
return await ctx.send("Time Out! Try Again") | |
OlderNewer