diff --git a/bot.py b/bot.py index 8e5e4cb..04f68be 100644 --- a/bot.py +++ b/bot.py @@ -1,75 +1,86 @@ -import discord -from discord.ext import commands -from discord.ext.commands import MemberConverter -import string -import secrets -import requests -import json -import bs4 as bs -import time -import threading -from time import sleep import asyncio -from selenium import webdriver +import json import os -import random +import secrets import shutil -import cleverbotfreeapi -from PyDictionary import PyDictionary -import gender_guesser.detector as gender -from google_images_search import GoogleImagesSearch -import subprocess -from PIL import Image, ImageDraw, ImageFont -from translate import Translator -import tracemoepy -from urllib.parse import urlparse import sqlite3 +import string from datetime import datetime -import uuid -from saucenao_api import SauceNao -import html2text -import re +from time import sleep +from urllib.parse import urlparse +import bs4 as bs +import discord +import html2text +import requests +from PIL import Image, ImageDraw, ImageFont +from PyDictionary import PyDictionary +from discord.ext import commands +from google_images_search import GoogleImagesSearch +from translate import Translator + +# Configuration TOKEN = ('????????????????????????????????????????????????') -bot = commands.Bot(command_prefix='%', description='''For detailed help, See https://gitlab.com/SosoM1k0r31z31/funny-cat/-/wikis/commands''') +bot = commands.Bot(command_prefix='%', + description='''For detailed help, See https://gitlab.com/SosoM1k0r31z31/funny-cat/-/wikis/commands''') +# Sqlite Databases connection = sqlite3.connect("dbs/tagbot.sqlite") connection2 = sqlite3.connect("dbs/msgarchive.sqlite") +# The default header that will be used when downloading files +defaultheader = "User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0" @bot.event async def on_ready(): print("ready ass") - + + bot.remove_command('help') @bot.command() async def help(ctx): - msg = (f"{ctx.author.mention} https://bitbucket.org/SosoM1k0r31z31/funny-cat/wiki/commands\n\nNo JS?\nhttps://sosom1k0r31z31.bitbucket.io/") + msg = ( + f"{ctx.author.mention} https://bitbucket.org/SosoM1k0r31z31/funny-cat/wiki/commands\n\nNo JS?\nhttps://sosom1k0r31z31.bitbucket.io/") await ctx.send(msg) +# Use random.org to accurately generate a true random number def randomnumbergen(range1, range2): a = int(range1) b = int(range2) - r = requests.get(f"https://www.random.org/integers/?num=1&min={a}&max={b}&col=1&base=10&format=plain&rnd=new") randnumber = (r.text) y = randnumber.strip() z = int(y) return z - + + +def download(url, filename): + try: + r = requests.get(url, headers=headers, stream=True) + with open(filename, 'wb') as out_file: + shutil.copyfileobj(r.raw, out_file) + del r + return True + except Exception as x: + return x + @bot.command() async def accountage(ctx, avamember: discord.Member = None): if id == None: - msg = (f"{ctx.author.name} Info:\nJoin date: {ctx.author.joined_at}\nAccount creation date: {ctx.author.created_at}\nAvatar URL: {ctx.author.avatar_url}") + msg = ( + f"{ctx.author.name} Info:\nJoin date: {ctx.author.joined_at}\nAccount creation date: {ctx.author.created_at}\nAvatar URL: {ctx.author.avatar_url}") await ctx.channel.send(msg) else: - msg = (f"{avamember.name} Info:\nJoin date: {avamember.joined_at}\nAccount creation date: {avamember.created_at}\nAvatar URL: {avamember.avatar_url}") + msg = ( + f"{avamember.name} Info:\nJoin date: {avamember.joined_at}\nAccount creation date: {avamember.created_at}\nAvatar URL: {avamember.avatar_url}") await ctx.channel.send(msg) + @bot.command() async def randnum(ctx, ran1, ran2, num): - r = requests.get(f"https://www.random.org/integers/?num={num}&min={ran1}&max={ran2}&col=1&base=10&format=plain&rnd=new") + r = requests.get( + f"https://www.random.org/integers/?num={num}&min={ran1}&max={ran2}&col=1&base=10&format=plain&rnd=new") randnumber = (r.text) msg = (f"```{randnumber}```") await ctx.send(msg) @@ -79,7 +90,7 @@ async def randnum(ctx, ran1, ran2, num): async def passgen(ctx, leng): if float(leng) > 1960: await ctx.send("too high, limit is `1950`") - + length = int(leng) alphabet = string.ascii_letters + string.digits @@ -94,17 +105,23 @@ async def passgen(ctx, leng): await ctx.send("Hit character limit.") await ctx.channel.send(msg) + @bot.command() async def lying(ctx, iss, pronoun): if pronoun == "she": - zerotwo = ("<@{0}> has me lying on my back. She's holding my legs in the air, and she's used an entire bottle of lube on her 8 inch cock. She slides her dino dick inside my winking, inviting asshole and starts thrusting into me. My moans of pleasure turn to shouts as she thrusts harder and harder inside me, slamming against my prostate. We look into each others' eyes, and she grabs my throbbing, erect penis and starts jacking me off while continuously thrusting her dinogirl penis deeper into my anal cavity. I can't take anymore and blast a gigantic load that hits my face, my eyes, my mouth, and my hair. Her thrusts get even faster and I feel my asshole start to overfill with her cum as she blasts a load into my anal cavity. She pulls her girlcock out of me and a river of dino semen starts to flow out of my asshole. She looks at my cum covered face and shoves her tongue down my throat and starts licking up the cum from my face.").format(iss) + zerotwo = ( + "<@{0}> has me lying on my back. She's holding my legs in the air, and she's used an entire bottle of lube on her 8 inch cock. She slides her dino dick inside my winking, inviting asshole and starts thrusting into me. My moans of pleasure turn to shouts as she thrusts harder and harder inside me, slamming against my prostate. We look into each others' eyes, and she grabs my throbbing, erect penis and starts jacking me off while continuously thrusting her dinogirl penis deeper into my anal cavity. I can't take anymore and blast a gigantic load that hits my face, my eyes, my mouth, and my hair. Her thrusts get even faster and I feel my asshole start to overfill with her cum as she blasts a load into my anal cavity. She pulls her girlcock out of me and a river of dino semen starts to flow out of my asshole. She looks at my cum covered face and shoves her tongue down my throat and starts licking up the cum from my face.").format( + iss) elif pronoun == "he": - zerotwo = ("<@{0}> has me lying on my back. He's holding my legs in the air, and he's used an entire bottle of lube on his 8 inch cock. He slides his dino dick inside my winking, inviting asshole and starts thrusting into me. My moans of pleasure turn to shouts as he thrusts harder and harder inside me, slamming against my prostate. We look into each others' eyes, and he grabs my throbbing, erect penis and starts jacking me off while continuously thrusting his dinogirl penis deeper into my anal cavity. I can't take anymore and blast a gigantic load that hits my face, my eyes, my mouth, and my hair. His thrusts get even faster and I feel my asshole start to overfill with his cum as he blasts a load into my anal cavity. He pulls his cock out of me and a river of dino semen starts to flow out of my asshole. He looks at my cum covered face and shoves his tongue down my throat and starts licking up the cum from my face.").format(iss) + zerotwo = ( + "<@{0}> has me lying on my back. He's holding my legs in the air, and he's used an entire bottle of lube on his 8 inch cock. He slides his dino dick inside my winking, inviting asshole and starts thrusting into me. My moans of pleasure turn to shouts as he thrusts harder and harder inside me, slamming against my prostate. We look into each others' eyes, and he grabs my throbbing, erect penis and starts jacking me off while continuously thrusting his dinogirl penis deeper into my anal cavity. I can't take anymore and blast a gigantic load that hits my face, my eyes, my mouth, and my hair. His thrusts get even faster and I feel my asshole start to overfill with his cum as he blasts a load into my anal cavity. He pulls his cock out of me and a river of dino semen starts to flow out of my asshole. He looks at my cum covered face and shoves his tongue down my throat and starts licking up the cum from my face.").format( + iss) else: await ctx.send("Invalid pronoun") print(iss) await ctx.send(zerotwo) + @bot.command() async def randomwaifu(ctx): base_url = 'http://randomwaifu.altervista.org/' @@ -120,6 +137,7 @@ async def randomwaifu(ctx): embed1.set_image(url=f"{link}") await ctx.send("btw this command sucks ass use %randomwaifu2 for better randomization", embed=embed1) + @bot.command() async def aiwaifu(ctx): randnum = randomnumbergen(1, 100000) @@ -128,16 +146,19 @@ async def aiwaifu(ctx): embed1.set_image(url=f"{link}") await ctx.send(embed=embed1) + @bot.command() async def rate(ctx, *, inp): if inp == "konata" or inp == "KONATA" or inp == "Konata": - await ctx.send(f"I rate `{inp}` a 55483095890483098549839058409386850497809590583290845983209580943860984509685490689053860984309584093859032850983209584309860943850698439064938056984309/100") + await ctx.send( + f"I rate `{inp}` a 55483095890483098549839058409386850497809590583290845983209580943860984509685490689053860984309584093859032850983209584309860943850698439064938056984309/100") elif inp.lower() == "mako" or inp.lower() == "jose": await ctx.send(f"I rate `{inp}` a ∞/100") else: rating = secrets.randbelow(100) await ctx.channel.send(f"I rate `{inp}` a {rating}/100") + @bot.command() async def randomwaifu2(ctx): url = "https://www.random.org/integers/?num=1&min=1&max=104900&col=1&base=10&format=plain&rnd=new" @@ -146,25 +167,27 @@ async def randomwaifu2(ctx): randnumber = int(randnumbe) headers = { - 'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0' + 'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0' } url = (f"http://www.animecharactersdatabase.com/api_series_characters.php?character_id={randnumber}") r = requests.get(url, headers=headers) json_data = r.json() - charactername = (json_data["name"]) + charactername = (json_data["name"]) charactergender = (json_data["gender"]) characteranime = (json_data["origin"]) characterimage = (json_data["character_image"]) characterid = (json_data["id"]) - - embed1=discord.Embed(title="Random waifu", color=0xc290c6) + + embed1 = discord.Embed(title="Random waifu", color=0xc290c6) embed1.add_field(name="Name:", value=f"{charactername}", inline=False) embed1.add_field(name="Anime", value=f"{characteranime}", inline=False) embed1.add_field(name="Gender:", value=f"{charactergender}", inline=False) embed1.set_footer(text=f"Character ID: {characterid}") embed1.set_image(url=f"{characterimage}") await ctx.send(embed=embed1) + + """ @bot.command() async def screenshot(ctx, address, mode : str = None): @@ -183,7 +206,7 @@ async def screenshot(ctx, address, mode : str = None): driver = webdriver.Firefox(options=options) driver.get(address) S = lambda X: driver.execute_script('return document.body.parentNode.scroll'+X) - driver.set_window_size(S('Width'),S('Height')) # May need manual adjustment + driver.set_window_size(S('Width'),S('Height')) # May need manual adjustment driver.find_element_by_tag_name('body').screenshot(attachmentname) driver.quit() @@ -206,8 +229,10 @@ async def screenshot(ctx, address, mode : str = None): await ctx.channel.send(exc) driver.quit() """ + + async def approach(message): - await message.add_reaction("") + await message.add_reaction("") @bot.command() @@ -215,11 +240,12 @@ async def react(ctx, idd): msg = await ctx.channel.fetch_message(idd) await approach(msg) + def webhook(message, username, avatar, url): embed = { - "content": message, - "username": username, - "avatar_url": avatar + "content": message, + "username": username, + "avatar_url": avatar } result = requests.post(url, data=json.dumps(embed), headers={"Content-Type": "application/json"}) @@ -239,19 +265,23 @@ async def frame(ctx, id, *, message): avatar = (f'{avamember.avatar_url}') msg = (f'"{message}"') webhook(message, name, avatar, url) - print(f"INFO: Frame command ran: [{ctx.author.name}#{ctx.author.discriminator} Framed {avamember.name}#{avamember.discriminator} to say '']") + print( + f"INFO: Frame command ran: [{ctx.author.name}#{ctx.author.discriminator} Framed {avamember.name}#{avamember.discriminator} to say '']") + @bot.command() async def webhooktransmit(ctx, link, username, avatar, *, content): await ctx.message.delete() embed = { - "content": content, - "username": username, - "avatar_url": avatar + "content": content, + "username": username, + "avatar_url": avatar } result = requests.post(link, data=json.dumps(embed), headers={"Content-Type": "application/json"}) a = result.raise_for_status() await ctx.send(a) + + @bot.command() async def rename(ctx, *, name): if ctx.author.id in {133218314469113857}: @@ -259,11 +289,12 @@ async def rename(ctx, *, name): else: await ctx.send("bot owner only :////") + @bot.command() async def changeavatar(ctx): if ctx.author.id in {133218314469113857}: try: - + await ctx.send("ok") print("ok") urlll = (""'{}'"").format(ctx.message.attachments[0].url) @@ -271,7 +302,7 @@ async def changeavatar(ctx): print(urlll) print(urlllname) headers = { - 'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0' + 'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0' } r = requests.get(urlll, headers=headers, stream=True) @@ -289,7 +320,8 @@ async def changeavatar(ctx): except Exception as x: await ctx.channel.send(f"error...\n`{x}`") else: - await ctx.send("bot owner only :////") + await ctx.send("bot owner only :////") + @bot.command() async def activity(ctx, *, act): @@ -299,12 +331,14 @@ async def activity(ctx, *, act): else: await ctx.send("bot owner only :////") + @bot.command() async def yomama(ctx): lines = open("dbs/yomama.txt").read().splitlines() joke = secrets.choice(lines) await ctx.send(f"{ctx.author.mention} {joke}") + @bot.command() async def ask(ctx, *, question): a = secrets.randbelow(2) @@ -314,24 +348,27 @@ async def ask(ctx, *, question): msg = (f"> {question}\n{ctx.author.mention} No") await ctx.send(msg) + @bot.command() -async def opinion(ctx, avamember : discord.User=None): +async def opinion(ctx, avamember: discord.User = None): a = secrets.randbelow(2) if a == 1: - await ctx.send(f"{avamember.mention} https://tenor.com/view/ihate-you-anime-mad-ihate-you-so-fucking-much-gif-17124653") + await ctx.send( + f"{avamember.mention} https://tenor.com/view/ihate-you-anime-mad-ihate-you-so-fucking-much-gif-17124653") else: await ctx.send(f"{avamember.mention} https://media.tenor.com/images/32ee226a0b4bd839f444fddbde231310/tenor.gif") + @bot.command() -async def randompasta(ctx, pastaid : str = None): +async def randompasta(ctx, pastaid: str = None): if pastaid == None: with connection: - data = connection.execute("SELECT * FROM PASTAS ORDER BY RANDOM() LIMIT 1;") - for row in data: - a = (row[1]) - b = (row[0]) - await ctx.send(a) - await ctx.send(f"`{b}`") + data = connection.execute("SELECT * FROM PASTAS ORDER BY RANDOM() LIMIT 1;") + for row in data: + a = (row[1]) + b = (row[0]) + await ctx.send(a) + await ctx.send(f"`{b}`") else: with connection: data = connection.execute(f"SELECT * FROM PASTAS WHERE id LIKE '{pastaid}'") @@ -341,6 +378,7 @@ async def randompasta(ctx, pastaid : str = None): await ctx.send(a) await ctx.send(b) + @bot.command() async def appendpasta(ctx, *, pasta): try: @@ -361,13 +399,16 @@ async def appendpasta(ctx, *, pasta): await ctx.send(f"Successfully added your copypasta to the database with id `{authorid}`") except Exception as x: await ctx.send(f"Error: `{x}`") - + + @bot.command() async def pastastats(ctx): with connection: data = connection.execute("SELECT COUNT(*) FROM PASTAS") for count in data: await ctx.send(f"Number of copypastas on file: `{count}`") + + @bot.command() async def deletepasta(ctx, pastaid): try: @@ -379,92 +420,126 @@ async def deletepasta(ctx, pastaid): await ctx.send("bot owner only!") except Exception as x: await ctx.send(f"Error: ```{x}```") - + @bot.command() -async def femboyrate(ctx, avamember : discord.User=None): +async def femboyrate(ctx, avamember: discord.User = None): a = randomnumbergen(0, 100) msg = (f"{avamember.mention} is {a}% femboy") await ctx.channel.send(msg) + @bot.command() -async def ship(ctx, avamember : discord.User=None, avamember2 : discord.User=None): +async def ship(ctx, avamember: discord.User = None, avamember2: discord.User = None): a = randomnumbergen(0, 100) print(a) print("ok") if a <= 10: - kokoro = ("[ :blue_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :blue_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 20: - kokoro = ("[ :blue_heart: :blue_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :blue_heart: :blue_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 30: - kokoro = ("[ :blue_heart: :blue_heart: :blue_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :blue_heart: :blue_heart: :blue_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 40: - kokoro = ("[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 50: - kokoro = ("[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 60: - kokoro = ("[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 70: - kokoro = ("[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 80: - kokoro = ("[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :black_heart: :black_heart: ]") elif a <= 90: - kokoro = ("[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :black_heart: ]") + kokoro = ( + "[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :black_heart: ]") elif a <= 100: - kokoro = ("[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: ]") + kokoro = ( + "[ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: ]") if avamember.id in {133218314469113857} and avamember2.id in {397928612906532865}: - msg = (f"Person 1: {avamember.mention}\nPerson 2: {avamember2.mention}\nRating: [ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: ] (59864561561561564651561890565914685534653412343542345374534534254534545324153%)") + msg = ( + f"Person 1: {avamember.mention}\nPerson 2: {avamember2.mention}\nRating: [ :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: :blue_heart: ] (59864561561561564651561890565914685534653412343542345374534534254534545324153%)") else: msg = (f"Person 1: {avamember.mention}\nPerson 2: {avamember2.mention}\nRating: {kokoro} ({a}%)") await ctx.send(msg) -@bot.command() -async def threesomeship(ctx, avamember : discord.User=None, avamember2 : discord.User=None, avamember3 : discord.User=None): - a = randomnumbergen(0, 100) - print(a) - print("ok") - if a <= 10: - kokoro = ("[ :green_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") - elif a <= 20: - kokoro = ("[ :green_heart: :green_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") - elif a <= 30: - kokoro = ("[ :green_heart: :green_heart: :green_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") - elif a <= 40: - kokoro = ("[ :green_heart: :green_heart: :green_heart: :green_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") - elif a <= 50: - kokoro = ("[ :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") - elif a <= 60: - kokoro = ("[ :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") - elif a <= 70: - kokoro = ("[ :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :black_heart: :black_heart: :black_heart: ]") - elif a <= 80: - kokoro = ("[ :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :black_heart: :black_heart: ]") - elif a <= 90: - kokoro = ("[ :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :black_heart: ]") - elif a <= 100: - kokoro = ("[ :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: ]") - msg = (f"Person 1: {avamember.mention}\nPerson 2: {avamember2.mention}\nPerson 3: {avamember3.mention}\nRating: {kokoro} ({a}%)") - await ctx.send(msg) @bot.command() -async def orgyship(ctx, avamember : discord.User=None, avamember2 : discord.User=None, avamember3 : discord.User=None, avamember4 : discord.User=None, avamember5 : discord.User=None): +async def threesomeship(ctx, avamember: discord.User = None, avamember2: discord.User = None, + avamember3: discord.User = None): a = randomnumbergen(0, 100) print(a) print("ok") if a <= 10: - kokoro = ("[ :heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :green_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 20: - kokoro = ("[ :heart: :heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :green_heart: :green_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 30: - kokoro = ("[ :heart: :heart: :heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :green_heart: :green_heart: :green_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 40: - kokoro = ("[ :heart: :heart: :heart: :heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :green_heart: :green_heart: :green_heart: :green_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 50: - kokoro = ("[ :heart: :heart: :heart: :heart: :heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 60: - kokoro = ("[ :heart: :heart: :heart: :heart: :heart: :heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 70: - kokoro = ("[ :heart: :heart: :heart: :heart: :heart: :heart: :heart: :black_heart: :black_heart: :black_heart: ]") + kokoro = ( + "[ :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :black_heart: :black_heart: :black_heart: ]") + elif a <= 80: + kokoro = ( + "[ :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :black_heart: :black_heart: ]") + elif a <= 90: + kokoro = ( + "[ :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :black_heart: ]") + elif a <= 100: + kokoro = ( + "[ :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: :green_heart: ]") + msg = ( + f"Person 1: {avamember.mention}\nPerson 2: {avamember2.mention}\nPerson 3: {avamember3.mention}\nRating: {kokoro} ({a}%)") + await ctx.send(msg) + + +@bot.command() +async def orgyship(ctx, avamember: discord.User = None, avamember2: discord.User = None, + avamember3: discord.User = None, avamember4: discord.User = None, avamember5: discord.User = None): + a = randomnumbergen(0, 100) + print(a) + print("ok") + if a <= 10: + kokoro = ( + "[ :heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + elif a <= 20: + kokoro = ( + "[ :heart: :heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + elif a <= 30: + kokoro = ( + "[ :heart: :heart: :heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + elif a <= 40: + kokoro = ( + "[ :heart: :heart: :heart: :heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + elif a <= 50: + kokoro = ( + "[ :heart: :heart: :heart: :heart: :heart: :black_heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + elif a <= 60: + kokoro = ( + "[ :heart: :heart: :heart: :heart: :heart: :heart: :black_heart: :black_heart: :black_heart: :black_heart: ]") + elif a <= 70: + kokoro = ( + "[ :heart: :heart: :heart: :heart: :heart: :heart: :heart: :black_heart: :black_heart: :black_heart: ]") elif a <= 80: kokoro = ("[ :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :black_heart: :black_heart: ]") elif a <= 90: @@ -472,13 +547,16 @@ async def orgyship(ctx, avamember : discord.User=None, avamember2 : discord.User elif a <= 100: kokoro = ("[ :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: ]") kokorofunny = ("[ :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: ]") - if avamember.id in {338474093743439872} and avamember2.id in {397928612906532865} and avamember3.id in {658342427546877994} and avamember4.id in {133218314469113857} and avamember5.id in {389850804607254528}: - msg = (f"Person 1: {avamember.mention}\nPerson 2: {avamember2.mention}\nPerson 3: {avamember3.mention}\nPerson 4: {avamember4.mention}\nPerson 5: {avamember5.mention}\nRating: {kokorofunny} (100%)") + if avamember.id in {338474093743439872} and avamember2.id in {397928612906532865} and avamember3.id in { + 658342427546877994} and avamember4.id in {133218314469113857} and avamember5.id in {389850804607254528}: + msg = ( + f"Person 1: {avamember.mention}\nPerson 2: {avamember2.mention}\nPerson 3: {avamember3.mention}\nPerson 4: {avamember4.mention}\nPerson 5: {avamember5.mention}\nRating: {kokorofunny} (100%)") else: - msg = (f"Person 1: {avamember.mention}\nPerson 2: {avamember2.mention}\nPerson 3: {avamember3.mention}\nPerson 4: {avamember4.mention}\nPerson 5: {avamember5.mention}\nRating: {kokoro} ({a}%)") + msg = ( + f"Person 1: {avamember.mention}\nPerson 2: {avamember2.mention}\nPerson 3: {avamember3.mention}\nPerson 4: {avamember4.mention}\nPerson 5: {avamember5.mention}\nRating: {kokoro} ({a}%)") await ctx.send(msg) - + @bot.command() async def convert(ctx, num, type, type2): if type == "days": @@ -488,10 +566,9 @@ async def convert(ctx, num, type, type2): if type2 == "seconds": a = int(num) * 3600 + @bot.command() async def bmi(ctx, kg, cm): - - try: height = float(cm) weight = float(kg) @@ -515,15 +592,15 @@ async def bmi(ctx, kg, cm): elif (bmi >= 30 and bmi < 50): a = ("severely overweight :warning:") - + elif (bmi >= 50): a = ("fatass lol") - - + await ctx.send(f"Your BMI is `{bmi}` and you are\n{a}") except Exception as x: await ctx.send(f"an error occured\n```{x}```") + @bot.command() async def say(ctx, *, what): if "@everyone" in ctx.message.content or "@here" in ctx.message.content: @@ -535,14 +612,15 @@ async def say(ctx, *, what): pass await ctx.send(what) + @bot.command() -async def avatar(ctx, avamember : discord.User=None): +async def avatar(ctx, avamember: discord.User = None): msg = (f"`{avamember.name}#{avamember.discriminator}'s avatar is` {avamember.avatar_url}") await ctx.send(msg) + @bot.command() async def dict(ctx, *, word): - try: dictionary = PyDictionary() a = (dictionary.meaning(word)) @@ -551,6 +629,7 @@ async def dict(ctx, *, word): except Exception as x: await ctx.send(f"an error occured:\n```{x}```") + @bot.command() async def wordcloud(ctx, range): await ctx.send(f"ok generating wordcloud for {range} message, please wait (this may take a while)") @@ -565,7 +644,8 @@ async def wordcloud(ctx, range): await ctx.send("successfully generated", file=discord.File("wordcloud.png")) os.remove("channel_messages.txt") os.remove("wordcloud.png") - + + @bot.command() async def iplocation(ctx, ip): try: @@ -588,7 +668,7 @@ async def iplocation(ctx, ip): organization = (s['organization']) flag = (s['country_flag']) - embed=discord.Embed(title="IPInfo", color=0x2d3dff) + embed = discord.Embed(title="IPInfo", color=0x2d3dff) embed.set_thumbnail(url=flag) embed.add_field(name="IP", value=ip, inline=True) embed.add_field(name="Continent", value=continent, inline=True) @@ -600,33 +680,37 @@ async def iplocation(ctx, ip): embed.add_field(name="Organization", value=organization, inline=True) embed.add_field(name="Is EU", value=eu, inline=True) embed.add_field(name="Calling code", value=callingcode, inline=True) - + await ctx.send(embed=embed) except Exception as x: await ctx.send(f"An error occured\n```{x}```") - + + @bot.command() async def request(ctx, address): try: headers = {'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0'} r = requests.get(address, headers=headers) s = r.json() - + await ctx.send(f"```{s}```") except Exception as x: await ctx.send(x) - + + @bot.command() -async def img(ctx, term, num : str = 1): +async def img(ctx, term, num: str = 1): # anti ewmx - + if ctx.author.id in {564989354701233675}: - await ctx.send("我真的很喜欢Genshin Impact 这是一个因喜剧效果而产生的模因。我不支持 Glorious Leader Xi Jinping 或他作为总统的举动。我现在将继续使用随机术语来使这个变得有趣。\n大块头大块头大男孩东方传说习近平 1989 Massacre 全能大主习近平主席永恒 The Xinjiang Uyghur Autonomous Region 赞美加贝·纽维尔勋爵为反击和保卫古人 Kung-Flu 成吉思汗没做错事,习近平国王绝杀了传说中的故事 The Great Leap Forward") + await ctx.send( + "我真的很喜欢Genshin Impact 这是一个因喜剧效果而产生的模因。我不支持 Glorious Leader Xi Jinping 或他作为总统的举动。我现在将继续使用随机术语来使这个变得有趣。\n大块头大块头大男孩东方传说习近平 1989 Massacre 全能大主习近平主席永恒 The Xinjiang Uyghur Autonomous Region 赞美加贝·纽维尔勋爵为反击和保卫古人 Kung-Flu 成吉思汗没做错事,习近平国王绝杀了传说中的故事 The Great Leap Forward") return blacklist = ['genshifdsfdsn', 'afddsmber', 'ifdsfdsmpact', 'pafdsfdsimon', 'fdsfdsfds', 'ambdfsfdsar'] for t in blacklist: if t in term.lower(): - await ctx.send("我真的很喜欢Genshin Impact 这是一个因喜剧效果而产生的模因。我不支持 Glorious Leader Xi Jinping 或他作为总统的举动。我现在将继续使用随机术语来使这个变得有趣。\n大块头大块头大男孩东方传说习近平 1989 Massacre 全能大主习近平主席永恒 The Xinjiang Uyghur Autonomous Region 赞美加贝·纽维尔勋爵为反击和保卫古人 Kung-Flu 成吉思汗没做错事,习近平国王绝杀了传说中的故事 The Great Leap Forward") + await ctx.send( + "我真的很喜欢Genshin Impact 这是一个因喜剧效果而产生的模因。我不支持 Glorious Leader Xi Jinping 或他作为总统的举动。我现在将继续使用随机术语来使这个变得有趣。\n大块头大块头大男孩东方传说习近平 1989 Massacre 全能大主习近平主席永恒 The Xinjiang Uyghur Autonomous Region 赞美加贝·纽维尔勋爵为反击和保卫古人 Kung-Flu 成吉思汗没做错事,习近平国王绝杀了传说中的故事 The Great Leap Forward") return # calv funny if "calv car" in term.lower(): @@ -636,31 +720,31 @@ async def img(ctx, term, num : str = 1): a = await ctx.send("Contacting API ") try: b = int(num) - + gis = GoogleImagesSearch('???????????????????????????', '???????????????????????????????????') _search_params = { - 'q': term, - 'num': b, - 'safe': 'off', + 'q': term, + 'num': b, + 'safe': 'off', } - - + gis.search(search_params=_search_params) for image in gis.results(): global url url = (image.url) - + embed1 = discord.Embed(title="Click here for full image", url=url, description=f"`{term}`", color=0x0000ff) embed1.set_image(url=f"{url}") - embed1.set_footer(icon_url=f"{ctx.author.avatar_url}", text=f"Page {b}\nRequested by {ctx.author.name}#{ctx.author.discriminator}") + embed1.set_footer(icon_url=f"{ctx.author.avatar_url}", + text=f"Page {b}\nRequested by {ctx.author.name}#{ctx.author.discriminator}") - await a.delete() - + await ctx.send(embed=embed1) except Exception as x: await ctx.send(f"`{x}`") - + + @bot.command() async def osu(ctx, action, *, inp): if action == "user": @@ -686,14 +770,15 @@ async def osu(ctx, action, *, inp): pp_country_rank = (s[0]['pp_country_rank']) playcount = (s[0]['playcount']) pp_raw = (s[0]['pp_raw']) - + lowercountry = (country.lower()) - + icon_url = f"http://s.ppy.sh/a/{user_id}" time = int(total_seconds_played) / 3600 - embed=discord.Embed(title="User search", description=username) - embed.set_author(name="Osu!", icon_url="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Osu%21Logo_%282015%29.png/600px-Osu%21Logo_%282015%29.png") + embed = discord.Embed(title="User search", description=username) + embed.set_author(name="Osu!", + icon_url="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Osu%21Logo_%282015%29.png/600px-Osu%21Logo_%282015%29.png") embed.set_thumbnail(url=icon_url) embed.add_field(name="User ID", value=user_id, inline=True) embed.add_field(name="Username", value=username, inline=True) @@ -703,7 +788,8 @@ async def osu(ctx, action, *, inp): embed.add_field(name="PP Rank", value=pp_rank, inline=True) embed.add_field(name="Accuracy", value=accuracy, inline=True) embed.add_field(name="Count rank SS", value=count_rank_ss, inline=True) - embed.add_field(name="Total seconds played", value=f"{total_seconds_played} ({round(time)} hours)", inline=True) + embed.add_field(name="Total seconds played", value=f"{total_seconds_played} ({round(time)} hours)", + inline=True) embed.add_field(name="Country", value=f"{country} :flag_{lowercountry}:", inline=True) embed.add_field(name="PP Country rank", value=pp_country_rank, inline=True) embed.add_field(name="Raw PP", value=pp_raw, inline=True) @@ -712,7 +798,7 @@ async def osu(ctx, action, *, inp): await ctx.send(embed=embed) except Exception as x: await ctx.send(f"An error occured ```{x}```") - + elif action == "beatmap" or action == "map": try: url = f"https://osu.ppy.sh/api/get_beatmaps?b={inp}&k=???????????????????????????" @@ -720,8 +806,6 @@ async def osu(ctx, action, *, inp): 'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0' } - - r = requests.get(url, headers=headers) s = r.json() @@ -750,8 +834,9 @@ async def osu(ctx, action, *, inp): cover = f"https://assets.ppy.sh/beatmaps/{beatmap_id}/covers/cover.jpg" thumb = f"https://b.ppy.sh/thumb/{beatmap_id}l.jpg" - embed=discord.Embed(title="Beatmap search", description="5456156") - embed.set_author(name="Osu!", icon_url="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Osu%21Logo_%282015%29.png/600px-Osu%21Logo_%282015%29.png") + embed = discord.Embed(title="Beatmap search", description="5456156") + embed.set_author(name="Osu!", + icon_url="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Osu%21Logo_%282015%29.png/600px-Osu%21Logo_%282015%29.png") embed.set_thumbnail(url=thumb) embed.add_field(name="Beatmap ID", value=beatmap_id, inline=True) embed.add_field(name="Approved", value=approved, inline=True) @@ -779,18 +864,20 @@ async def osu(ctx, action, *, inp): await ctx.send(embed=embed) except Exception as x: await ctx.send(f"An error occured ```{x}```") - + + @bot.command() async def tempconvert(ctx, unit, inp): if unit == "c" or unit == "celsius": a = int(inp) - converted = (a * 9/5) + 32 + converted = (a * 9 / 5) + 32 await ctx.send(f"**{inp}°C** Is equal to **{converted}°F**") elif unit == "f" or unit == "fahrenheit": a = int(inp) - converted = (a - 32) * 5/9 + converted = (a - 32) * 5 / 9 await ctx.send(f"**{inp}°F** Is equal to **{converted}°C**") - + + @bot.command() async def speedconvert(ctx, unit, number): if unit == "mph" or unit == "miles": @@ -801,7 +888,8 @@ async def speedconvert(ctx, unit, number): a = int(number) converted = a * 1.609 await ctx.send(f"**{number} Mph** is equal to approximately **{converted} Km/h**") - + + @bot.command() async def weightconvert(ctx, unit, number): if unit == "kg": @@ -812,7 +900,8 @@ async def weightconvert(ctx, unit, number): a = int(number) converted = a * 2.205 await ctx.send(f"**{number} Kg** is equal to **{converted} Pounds**") - + + @bot.command() async def delete(ctx, msgid): if ctx.author.id in {133218314469113857}: @@ -822,7 +911,8 @@ async def delete(ctx, msgid): await ctx.send(f"Deleted `{msgid}`") else: await ctx.send("bot owner only :///") - + + @bot.command() async def urban(ctx, *, word): try: @@ -841,12 +931,10 @@ async def urban(ctx, *, word): v2 = v1.replace("]", "") v3 = v2.replace('\\n', '\n').replace('\\t', '\t')[:1024] - exampleformatted = example.replace("[", "") exampleformatted2 = exampleformatted.replace("]", "") - - embed=discord.Embed(title=word) + embed = discord.Embed(title=word) embed.set_author(name="Urban Dictionary", icon_url="https://img.utdstc.com/icons/urban-dictionary-android.png") embed.set_thumbnail(url="https://img.utdstc.com/icons/urban-dictionary-android.png") embed.add_field(name="Definition", value=v3, inline=True) @@ -856,9 +944,10 @@ async def urban(ctx, *, word): await ctx.send("`Definition has been cut to comply with the message length limit`") except Exception as x: await ctx.send(f"An error occured ```{x}```") - + + @bot.command() -async def imagesearch(ctx, provider, url : str = None): +async def imagesearch(ctx, provider, url: str = None): if provider == "google": if url == None: img = ctx.message.attachments[0].url @@ -867,16 +956,17 @@ async def imagesearch(ctx, provider, url : str = None): else: msg = f"https://www.google.com/searchbyimage?&image_url={url}" await ctx.send(msg) - + + @bot.command() async def typing(ctx): await ctx.message.delete() async with ctx.typing(): sleep(25) + @bot.command() async def pocky(ctx, person, person2): - inp1spaces = person.replace("-", " ") inp2spaces = person2.replace("-", " ") try: @@ -885,30 +975,29 @@ async def pocky(ctx, person, person2): pass image = Image.open('resources/templates/pockytemplate.png') draw = ImageDraw.Draw(image) - + font = ImageFont.truetype('resources/Prototype.ttf', size=45) - + (x, y) = (50, 50) message = inp1spaces - color = 'rgb(0, 0, 0)' # black color - - draw.text((x, y), message, fill=color, font=font) + color = 'rgb(0, 0, 0)' # black color + draw.text((x, y), message, fill=color, font=font) (x, y) = (380, 97) message = inp2spaces - color = 'rgb(0, 0, 0)' # black color - + color = 'rgb(0, 0, 0)' # black color + draw.text((x, y), message, fill=color, font=font) - image.save('pocky.png') await ctx.send(file=discord.File("pocky.png")) os.remove("pocky.png") - + + @bot.command() async def translate(ctx, fro, to, *, inputt): - translator= Translator(from_lang=fro, to_lang=to) + translator = Translator(from_lang=fro, to_lang=to) translation = translator.translate(inputt) message = ("Translation from `{0}` to `{1}`\n```{2}```").format(fro, to, translation) await ctx.channel.send(message) @@ -1007,6 +1096,7 @@ async def whatanime(ctx, url : str = None): await ctx.channel.send(exc) """ + @bot.command() async def servers(ctx): a = str(len(bot.guilds)) @@ -1014,10 +1104,10 @@ async def servers(ctx): for name in bot.guilds: b += f"{name}\n" await ctx.send(f"Bot is in {a} servers.\n```{b}```") - + + @bot.command() async def hugging(ctx, person, person2): - inp1spaces = person.replace("-", " ") inp2spaces = person2.replace("-", " ") try: @@ -1026,30 +1116,28 @@ async def hugging(ctx, person, person2): pass image = Image.open('resources/templates/hugtemplate.png') draw = ImageDraw.Draw(image) - + font = ImageFont.truetype('resources/Prototype.ttf', size=45) - + (x, y) = (182, 262) message = inp1spaces - color = 'rgb(0, 0, 0)' # black color - - draw.text((x, y), message, fill=color, font=font) + color = 'rgb(0, 0, 0)' # black color + draw.text((x, y), message, fill=color, font=font) (x, y) = (433, 555) message = inp2spaces - color = 'rgb(0, 0, 0)' # black color - + color = 'rgb(0, 0, 0)' # black color + draw.text((x, y), message, fill=color, font=font) - image.save('hug.png') await ctx.send(file=discord.File("hug.png")) os.remove("hug.png") - + + @bot.command() async def kissing(ctx, person, person2): - inp1spaces = person.replace("-", " ") inp2spaces = person2.replace("-", " ") try: @@ -1058,27 +1146,25 @@ async def kissing(ctx, person, person2): pass image = Image.open('resources/templates/kisstemplate.jpg') draw = ImageDraw.Draw(image) - + font = ImageFont.truetype('resources/Prototype.ttf', size=45) - + (x, y) = (420, 288) message = inp1spaces - color = 'rgb(255, 255, 255)' # white color - - draw.text((x, y), message, fill=color, font=font) + color = 'rgb(255, 255, 255)' # white color + draw.text((x, y), message, fill=color, font=font) (x, y) = (589, 316) message = inp2spaces - color = 'rgb(255, 255, 255)' # white color - + color = 'rgb(255, 255, 255)' # white color + draw.text((x, y), message, fill=color, font=font) - image.save('kiss.png') await ctx.send(file=discord.File("kiss.png")) os.remove("kiss.png") - + @bot.command() async def drinking(ctx, person, person2): @@ -1108,8 +1194,8 @@ async def drinking(ctx, person, person2): image.save('drink.png') await ctx.send(file=discord.File("drink.png")) os.remove("drink.png") - - + + @bot.command() async def shinji(ctx, person, person2): inp1spaces = person.replace("-", " ") @@ -1138,10 +1224,10 @@ async def shinji(ctx, person, person2): image.save('shinji.png') await ctx.send(file=discord.File("shinji.png")) os.remove("shinji.png") - - + + @bot.command() -async def duckduckgo(ctx, term, num : int = 0): +async def duckduckgo(ctx, term, num: int = 0): try: url = f"https://api.duckduckgo.com/?q={term}&format=json&pretty=1" headers = {'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0'} @@ -1153,17 +1239,20 @@ async def duckduckgo(ctx, term, num : int = 0): url = (s['RelatedTopics'][num]['FirstURL']) icon = (s['RelatedTopics'][num]['Icon']['URL']) text = (s['RelatedTopics'][num]['Text']) - - embed=discord.Embed(title="Search", url=url) - embed.set_author(name="Duckduckgo", icon_url="https://upload.wikimedia.org/wikipedia/en/9/90/The_DuckDuckGo_Duck.png") + + embed = discord.Embed(title="Search", url=url) + embed.set_author(name="Duckduckgo", + icon_url="https://upload.wikimedia.org/wikipedia/en/9/90/The_DuckDuckGo_Duck.png") embed.set_thumbnail(url=icon) embed.add_field(name=term, value=text, inline=True) - embed.set_footer(icon_url=f"{ctx.author.avatar_url}", text=f"Requested by {ctx.author.name}#{ctx.author.discriminator}") - + embed.set_footer(icon_url=f"{ctx.author.avatar_url}", + text=f"Requested by {ctx.author.name}#{ctx.author.discriminator}") + await ctx.send(embed=embed) except: await ctx.send("An error occured (Empty JSON)") - + + def neko(reaction): if reaction == "kiss": lines = open("dbs/nekos/kiss.txt").read().splitlines() @@ -1175,36 +1264,40 @@ def neko(reaction): lines = open("dbs/nekos/poke.txt").read().splitlines() joke = random.choice(lines) return joke - + + @bot.command() -async def kiss(ctx, person : discord.User=None): +async def kiss(ctx, person: discord.User = None): a = neko("kiss") await ctx.send(f"{ctx.author.mention} Kissed {person.mention}\n{a}") - + + @bot.command() -async def hug(ctx, person : discord.User=None): +async def hug(ctx, person: discord.User = None): a = neko("hug") await ctx.send(f"{ctx.author.mention} Hugged {person.mention}\n{a}") - + + @bot.command() -async def poke(ctx, person : discord.User=None): +async def poke(ctx, person: discord.User = None): a = neko("poke") await ctx.send(f"{ctx.author.mention} Poked {person.mention}\n{a}") - + + @bot.command() -async def gelbooru(ctx, tags, num : int = 0): +async def gelbooru(ctx, tags, num: int = 0): url = f"https://gelbooru.com/index.php?page=dapi&s=post&q=index&tags={tags}&json=1" - + r = requests.get(url) s = r.json() - + imgid = (s[num]['id']) hashimg = (s[num]['hash']) source = (s[num]['source']) image = (s[num]['file_url']) posturl = f"https://gelbooru.com/index.php?page=post&s=view&id={imgid}" - embed1=discord.Embed(title="Gelbooru Search", color=0xc290c6) + embed1 = discord.Embed(title="Gelbooru Search", color=0xc290c6) embed1.add_field(name="ID:", value=imgid, inline=True) embed1.add_field(name="Requested tag(s):", value=tags, inline=False) embed1.set_image(url=image) @@ -1216,63 +1309,68 @@ async def gelbooru(ctx, tags, num : int = 0): await ctx.send(embed=embed1) elif "rating:safe" not in tags: await ctx.send("nsfw command") - + + @bot.command() -async def gelbooru2(ctx, tags, num : int = 0): +async def gelbooru2(ctx, tags, num: int = 0): url = f"https://gelbooru.com/index.php?page=dapi&s=post&q=index&tags={tags}&json=1" - + r = requests.get(url) s = r.json() - - imgid = (s[num]['id']) - hashimg = (s[num]['hash']) - source = (s[num]['source']) - image = (s[num]['file_url']) + + imgid = (s[num]['id']) + hashimg = (s[num]['hash']) + source = (s[num]['source']) + image = (s[num]['file_url']) posturl = f"https://gelbooru.com/index.php?page=post&s=view&id={imgid}" - embed1=discord.Embed(title="Gelbooru Search", color=0xc290c6) + embed1 = discord.Embed(title="Gelbooru Search", color=0xc290c6) embed1.add_field(name="ID:", value=imgid, inline=True) embed1.add_field(name="Requested tag(s):", value=tags, inline=False) - embed1.set_image(url=image) + embed1.set_image(url=image) embed1.set_footer(text=f"Hash: {hashimg} \nSource: {source} \nPost URL: {posturl} \nImage URl: {image}") await ctx.send(embed=embed1) + + @bot.command() async def urlcheck(ctx, url): try: line_count = 0 - + o = urlparse(url) domain = o.netloc if domain == "": await ctx.send("Invalid link") return - + await ctx.send(f"Checking `{url}`") with open("dbs/iploggers.txt") as f: for line in f: line_count += 1 if domain in line: - await ctx.send(f":octagonal_sign: The provided link is an IP Logger\nProvided link: `{url}`\nDatabase Match: `{line}`") + await ctx.send( + f":octagonal_sign: The provided link is an IP Logger\nProvided link: `{url}`\nDatabase Match: `{line}`") return await ctx.send(f"`{url}` Is safe :white_check_mark:, Scanned out of {line_count} URLs\n{domain}") except Exception as x: await ctx.send(f"Error: ```{x}```") - + + @bot.command() -async def gay(ctx, url : str = None): +async def gay(ctx, url: str = None): if url == None: url = ctx.message.attachments[0].url await ctx.send(f"https://some-random-api.ml/canvas/gay?avatar={url}") - + + @bot.command() async def lyrics(ctx, *, song): - ss = song.replace(" ", "%20") url = f"https://some-random-api.ml/lyrics?title={ss}" - + r = requests.get(url) s = r.json() - + title = (s['title']) author = (s['author']) lyrics = (s['lyrics']) @@ -1280,22 +1378,22 @@ async def lyrics(ctx, *, song): link = (s['links']['genius']) formatted_lyrics = lyrics.replace('\\n', '\n').replace('\\t', '\t')[:1024] - - embed1=discord.Embed(title="Lyrics Search", color=0xc290c6) + + embed1 = discord.Embed(title="Lyrics Search", color=0xc290c6) embed1.set_thumbnail(url=thumbnail) embed1.add_field(name="Title:", value=title, inline=True) embed1.add_field(name="Author:", value=author, inline=False) embed1.add_field(name="Lyrics:", value=formatted_lyrics, inline=False) embed1.set_footer(text=f"Link: {link}") - + await ctx.send(embed=embed1) - + if len(lyrics) > 1024: await ctx.send("Warning, lyrics were cut to fit into the message, see link for the full lyrics.") - -@bot.command() -async def tag(ctx, mode, *, insertion : str = None): + +@bot.command() +async def tag(ctx, mode, *, insertion: str = None): # some variables authorid = ctx.author.id currenttime = f"{datetime.date(datetime.now())} At {datetime.time(datetime.now())} GMT +3" @@ -1338,7 +1436,7 @@ async def tag(ctx, mode, *, insertion : str = None): await ctx.send(f"Successfully deleted tag `{firstword}`") else: await ctx.send(f"{ctx.author.mention} You do not have permission to delete the `{firstword}` tag.") - + elif mode == "owner": with connection: data = connection.execute(f"SELECT * FROM TAG WHERE name LIKE '{firstword}'") @@ -1351,13 +1449,13 @@ async def tag(ctx, mode, *, insertion : str = None): elif mode == "list": taglist = "" data = connection.execute(f"SELECT * FROM TAG WHERE id LIKE '{authorid}'") - for row in data: + for row in data: name = (row[1]) date = (row[3]) taglist += (f"`{name}` Created on `{date}`\n") await ctx.send(f"List of tags owned by `{ctx.author.name}#{ctx.author.discriminator}`:\n{taglist}") - + elif mode == "random": with connection: data = connection.execute("SELECT * FROM TAG ORDER BY RANDOM() LIMIT 1;") @@ -1372,14 +1470,16 @@ async def tag(ctx, mode, *, insertion : str = None): for row in data: a = (row[2]) await ctx.send(a) - + + @bot.command() async def invite(ctx): - await ctx.send(f"{ctx.author.mention} https://discord.com/api/oauth2/authorize?client_id=754720671518687322&permissions=125952&scope=bot") + await ctx.send( + f"{ctx.author.mention} https://discord.com/api/oauth2/authorize?client_id=754720671518687322&permissions=125952&scope=bot") + @bot.command() async def politeness(ctx, *, inputt): - formatted_input = inputt.replace(" ", "+") headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox'} data = {'text': formatted_input} @@ -1389,12 +1489,14 @@ async def politeness(ctx, *, inputt): confidence = (s['confidence']) label = (s['label']) - + await ctx.send(f"Label: {label}\nConfidence: {confidence}") - + + @bot.command() async def fraudcheck(ctx, *, ip): - url = (f"https://ipqualityscore.com/api/json/ip/???????????????????/{ip}?strictness=0&allow_public_access_points=true&fast=true&lighter_penalties=true&mobile=true") + url = ( + f"https://ipqualityscore.com/api/json/ip/???????????????????/{ip}?strictness=0&allow_public_access_points=true&fast=true&lighter_penalties=true&mobile=true") headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox'} r = requests.post(url, headers=headers) s = r.json() @@ -1411,61 +1513,66 @@ async def fraudcheck(ctx, *, ip): recent_abuse = (s['recent_abuse']) bot_status = (s['bot_status']) request_id = (s['request_id']) - + msg = f"```Fraud score: {fraud_score}\nCountry Code: {country_code}\nCity: {city}\nISP: {ISP}\nASN: {ASN}\nHost: {host}\nProxy: {proxy}\nVPN: {vpn}\nTOR: {tor}\nRecent Abuse: {recent_abuse}\nBot Status: {bot_status}\nRequest ID: {request_id}```" await ctx.send(msg) + def saucesearch(url): - url = (f"https://saucenao.com/search.php?api_key=??????????????????????&db=999&output_type=2&testmode=1&numres=16&url={url}") + url = ( + f"https://saucenao.com/search.php?api_key=??????????????????????&db=999&output_type=2&testmode=1&numres=16&url={url}") headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox'} r = requests.post(url, headers=headers) s = r.json() limit = (s['header']['long_remaining']) - + simres0 = (s['result'][0]['header']['similarity']) indexnameres0 = (s['result'][0]['header']['index_name']) urlres0 = (s['result'][0]['data']['ext_urls'[0]]) - + simres1 = (s['result'][1]['header']['similarity']) indexnameres1 = (s['result'][1]['header']['index_name']) urlres1 = (s['result'][1]['data']['ext_urls'[0]]) - + simres2 = (s['result'][2]['header']['similarity']) indexnameres2 = (s['result'][2]['header']['index_name']) urlres2 = (s['result'][2]['data']['ext_urls'[0]]) msg = f"Sauce found:\nSearches remaining for today: {limit}\n```Result 1:\nSimilarity: {simres0}\nIndex Name: {indexnameres0}\nURL: {urlres0}\n\nResult 2:\nSimilarity: {simres1}\nIndex Name: {indexnameres1}\nURL: {urlres1}\n\nResult 3:\nSimilarity: {simres2}\nIndex Name: {indexnameres2}\nURL: {urlres2}" + @bot.command() -async def sauce(ctx, link : str = None): +async def sauce(ctx, link: str = None): if not ctx.message.attachments: await ctx.channel.send("Searching...") - + else: await ctx.channel.send("Searching...") link = (""'{}'"").format(ctx.message.attachments[0].url) - - url = (f"https://saucenao.com/search.php?api_key=??????????????????????&db=999&output_type=2&testmode=1&numres=16&url={link}") + + url = ( + f"https://saucenao.com/search.php?api_key=??????????????????????&db=999&output_type=2&testmode=1&numres=16&url={link}") headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox'} r = requests.post(url, headers=headers) s = r.json() limit = (s['header']['long_remaining']) - + simres0 = (s['results'][0]['header']['similarity']) indexnameres0 = (s['results'][0]['header']['index_name']) urlres0 = (s['results'][0]['data']['ext_urls'][0]) - + simres1 = (s['results'][1]['header']['similarity']) indexnameres1 = (s['results'][1]['header']['index_name']) urlres1 = (s['results'][1]['data']['ext_urls'][0]) - + simres2 = (s['results'][2]['header']['similarity']) indexnameres2 = (s['results'][2]['header']['index_name']) urlres2 = (s['results'][2]['data']['ext_urls'][0]) - await ctx.send(f"Sauce found:\nSearches remaining for today: {limit}\n```Result 1:\nSimilarity: {simres0}\nIndex Name: {indexnameres0}\nURL: {urlres0}\n\nResult 2:\nSimilarity: {simres1}\nIndex Name: {indexnameres1}\nURL: {urlres1}\n\nResult 3:\nSimilarity: {simres2}\nIndex Name: {indexnameres2}\nURL: {urlres2}```") + await ctx.send( + f"Sauce found:\nSearches remaining for today: {limit}\n```Result 1:\nSimilarity: {simres0}\nIndex Name: {indexnameres0}\nURL: {urlres0}\n\nResult 2:\nSimilarity: {simres1}\nIndex Name: {indexnameres1}\nURL: {urlres1}\n\nResult 3:\nSimilarity: {simres2}\nIndex Name: {indexnameres2}\nURL: {urlres2}```") @bot.command() @@ -1475,45 +1582,49 @@ async def textread(ctx): attachmenturl = (""'{}'"").format(ctx.message.attachments[0].url) attachmentname = ('readable.txt') headers = { - 'User-agent': 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0' + 'User-agent': 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0' } r = requests.get(attachmenturl, headers=headers, stream=True) with open(attachmentname, 'wb') as out_file: shutil.copyfileobj(r.raw, out_file) del r - + f = open('readable.txt', 'r') line = f.read() print(line) - - if len(line) > 8000: + + if len(line) > 8000: await ctx.send("Too long") else: n = 2 - - q = [line[i:i+n] for i in range(0, len(line), n)] + + q = [line[i:i + n] for i in range(0, len(line), n)] print(q) for p in q: print(p) await ctx.send(f"```{p}```") - + + @bot.command() async def yuri(ctx): lines = open("yurilist.txt").read().splitlines() yuri = secrets.choice(lines) await ctx.send(f"{yuri}") - + + @bot.command() -async def ruined(ctx, avamember : discord.User=None): - await ctx.send(f"{avamember.mention} https://cdn.discordapp.com/attachments/769023126507356163/769630011770142740/fedora_2020_10_22__11_50_53.png") - +async def ruined(ctx, avamember: discord.User = None): + await ctx.send( + f"{avamember.mention} https://cdn.discordapp.com/attachments/769023126507356163/769630011770142740/fedora_2020_10_22__11_50_53.png") + + @bot.command() async def anchovy(ctx): lines = open("anchovy.txt").read().splitlines() anchovy = secrets.choice(lines) await ctx.send(f"{anchovy}") - - + + @bot.command() async def charactersearch(ctx, *, char): url = f"https://api.jikan.moe/v3/search/character?q={char}&page=1" @@ -1530,7 +1641,6 @@ async def charactersearch(ctx, *, char): @bot.command() async def animesearch(ctx, *, anime): - url = f"https://api.jikan.moe/v3/search/anime?q={anime}&page=1" headers = {'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0'} @@ -1546,12 +1656,12 @@ async def animesearch(ctx, *, anime): start_date = (s['results'][0]['start_date']) end_date = (s['results'][0]['end_date']) - await ctx.send(f"Search result\n\n**Title:** {title}\n\n**Synopsis:** {synopsis}\n\n**Episodes:** {episodes}\n**Score:** {score}\n**Start date:** {start_date}\n**End date:** {end_date}\n\n{image}`") - + await ctx.send( + f"Search result\n\n**Title:** {title}\n\n**Synopsis:** {synopsis}\n\n**Episodes:** {episodes}\n**Score:** {score}\n**Start date:** {start_date}\n**End date:** {end_date}\n\n{image}`") + @bot.command() async def define(ctx, *, term): - url = f"https://api.dictionaryapi.dev/api/v2/entries/en/{term}" headers = {'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0'} @@ -1563,10 +1673,10 @@ async def define(ctx, *, term): definition = (s[0]['meanings'][0]['definitions'][0]['definition']) msg = f"**Word:** `{name} {pronouncation}`\n\n**Definition:** ```{definition}```" - + await ctx.send(msg) - - + + @bot.command() async def character(ctx, char): def charlink(character): @@ -1607,23 +1717,23 @@ async def character(ctx, char): await ctx.send("An error occured, Please try again.") elif char.lower() == "list": - await ctx.send("```List of available characters\n\nmako\nanchovy\nyuri\naqua\nmio\nmiho\nhana\nsaori\nerina\nsaren\npecorine\nsatania\nmankanshoku```") + await ctx.send( + "```List of available characters\n\nmako\nanchovy\nyuri\naqua\nmio\nmiho\nhana\nsaori\nerina\nsaren\npecorine\nsatania\nmankanshoku```") else: await ctx.send("```unknown character\n\nsee %character list for a list of characters```") - - + + @bot.command() async def ping(ctx): await ctx.send(f'Pong! In {round(bot.latency * 1000)}ms') - + + @bot.command() async def aita(ctx): - rs = requests.get(f"https://www.random.org/integers/?num=1&min=0&max=25&col=1&base=10&format=plain&rnd=new") qs = (rs.text) q = int(qs) - url = "https://www.reddit.com/r/amitheasshole.json" headers = {'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0'} @@ -1638,12 +1748,12 @@ async def aita(ctx): msg = (f"{title}\n\n{formatted_content}")[:2000] await ctx.send(msg) - + @bot.command() async def maid(ctx): url = f"https://gelbooru.com/index.php?page=dapi&s=post&q=index&tags=maid+rating:safe&json=1" - + r = requests.get(url) s = r.json() num = random.randrange(100) @@ -1651,7 +1761,6 @@ async def maid(ctx): await ctx.send(image) - @bot.command() async def emailgen(ctx): url = "https://www.1secmail.com/api/v1/?action=genRandomMailbox&count=1" @@ -1662,11 +1771,12 @@ async def emailgen(ctx): address = (s[0]) - await ctx.send(f"{ctx.author.mention} You have been assigned the address `{address}`. To view your inbox, Use %emailbox ADDRESS (Make sure not to include @1secmail.org)") + await ctx.send( + f"{ctx.author.mention} You have been assigned the address `{address}`. To view your inbox, Use %emailbox ADDRESS (Make sure not to include @1secmail.org)") + @bot.command() async def emailbox(ctx, address): - inbox = "" url = f"https://www.1secmail.com/api/v1/?action=getMessages&login={address}&domain=1secmail.com" @@ -1686,15 +1796,14 @@ async def emailbox(ctx, address): except Exception as x: await ctx.send(x) return - + await ctx.send(f"```{inbox}```") - - - + + @bot.command() -async def gelboorubomb(ctx, tags, times : int = 0): +async def gelboorubomb(ctx, tags, times: int = 0): url = f"https://gelbooru.com/index.php?page=dapi&s=post&q=index&tags={tags}&json=1" - + r = requests.get(url) s = r.json() for num in range(times): @@ -1704,7 +1813,7 @@ async def gelboorubomb(ctx, tags, times : int = 0): image = (s[num]['file_url']) posturl = f"https://gelbooru.com/index.php?page=post&s=view&id={imgid}" - embed1=discord.Embed(title="Gelbooru Search", color=0xc290c6) + embed1 = discord.Embed(title="Gelbooru Search", color=0xc290c6) embed1.add_field(name="ID:", value=imgid, inline=True) embed1.add_field(name="Requested tag(s):", value=tags, inline=False) embed1.add_field(name="Image number:", value=f"{num} out of {times - 1}", inline=False) @@ -1717,11 +1826,12 @@ async def gelboorubomb(ctx, tags, times : int = 0): await ctx.send(embed=embed1) elif "rating:safe" not in tags: await ctx.send("nsfw command") - + + @bot.command() -async def gelboorubomb2(ctx, tags, times : int = 0): +async def gelboorubomb2(ctx, tags, times: int = 0): url = f"https://gelbooru.com/index.php?page=dapi&s=post&q=index&tags={tags}&json=1" - + r = requests.get(url) s = r.json() for num in range(times): @@ -1731,13 +1841,14 @@ async def gelboorubomb2(ctx, tags, times : int = 0): image = (s[num]['file_url']) posturl = f"https://gelbooru.com/index.php?page=post&s=view&id={imgid}" - embed1=discord.Embed(title="Gelbooru Search", color=0xc290c6) + embed1 = discord.Embed(title="Gelbooru Search", color=0xc290c6) embed1.add_field(name="ID:", value=imgid, inline=True) embed1.add_field(name="Requested tag(s):", value=tags, inline=False) embed1.add_field(name="Image number:", value=f"{num} out of {times - 1}", inline=False) embed1.set_image(url=image) embed1.set_footer(text=f"Hash: {hashimg} \nSource: {source} \nPost URL: {posturl} \nImage URl: {image}") + @bot.command() async def genderguesser(ctx, name): if name.lower() == "calv" or name.lower() == "calvanyan": @@ -1759,7 +1870,6 @@ async def genderguesser(ctx, name): @bot.command() async def ffmpeg(ctx, *, ext): - urlll = (""'{}'"").format(ctx.message.attachments[0].url) urlllname = (""'{}'"").format(ctx.message.attachments[0].filename) print(urlll) @@ -1779,10 +1889,10 @@ async def ffmpeg(ctx, *, ext): await ctx.channel.send(f"Rending `output{ctx.message.id}.{ext}` completed", file=discord.File(fileout)) os.system(f"rm output{ctx.message.id}.{ext}") os.remove(urlllname) - + + @bot.command() async def ffmpeg2(ctx, ext, *, args): - urlll = (""'{}'"").format(ctx.message.attachments[0].url) urlllname = (""'{}'"").format(ctx.message.attachments[0].filename) print(urlll) @@ -1802,7 +1912,8 @@ async def ffmpeg2(ctx, ext, *, args): await ctx.channel.send(f"Rending `output{ctx.message.id}.{ext}` completed", file=discord.File(fileout)) os.remove(urlllname) os.remove(fileout) - + + @bot.command() async def screenshot(ctx, url): url2 = f"https://api.apiflash.com/v1/urltoimage?access_key=84f448c81a3f4ddbacf188aca585a4f6&url={url}" @@ -1813,21 +1924,24 @@ async def screenshot(ctx, url): else: await ctx.send(url2) + @bot.command() -async def twerkradio(ctx, loop : int = 1): +async def twerkradio(ctx, loop: int = 1): if ctx.author.voice and ctx.author.voice.channel: channel = ctx.author.voice.channel vc = await channel.connect() try: if loop > 500: - await ctx.send(f"{ctx.author.mention} a limit of 500 was added because 7gb of bandwidth was used by this command in a day") + await ctx.send( + f"{ctx.author.mention} a limit of 500 was added because 7gb of bandwidth was used by this command in a day") await ctx.voice_client.disconnect() return else: for i in range(loop): vc.play(discord.FFmpegPCMAudio("twerkradio.mp3")) - await ctx.send("twerk radio yeah you're hella gay yeah you watch gay porn cause you're hella gay you get horny from black ass twerking") + await ctx.send( + "twerk radio yeah you're hella gay yeah you watch gay porn cause you're hella gay you get horny from black ass twerking") while vc.is_playing(): await asyncio.sleep(1) await ctx.voice_client.disconnect() @@ -1839,8 +1953,9 @@ async def twerkradio(ctx, loop : int = 1): await ctx.send("You are not connected to a voice channel") return + @bot.command() -async def sfx(ctx, sound, times : int = 1): +async def sfx(ctx, sound, times: int = 1): if ctx.author.voice and ctx.author.voice.channel: channel = ctx.author.voice.channel vc = await channel.connect() @@ -1858,6 +1973,7 @@ async def sfx(ctx, sound, times : int = 1): await ctx.send("You are not connected to a voice channel") return + @bot.command() async def allsfx(ctx): if ctx.author.voice and ctx.author.voice.channel: @@ -1894,10 +2010,11 @@ async def allsfx(ctx): print(x) exc = (":boom: **Error**```{0}```").format(x) await ctx.channel.send(exc) - else: + else: await ctx.send("You are not connected to a voice channel") return + @bot.command() async def ship2(ctx, person1, person2): headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0'} @@ -1911,7 +2028,7 @@ async def ship2(ctx, person1, person2): t = "" text = "\n".join([ll.rstrip() for ll in q.splitlines() if ll.strip()]) aa = text.replace("by LoveCalculator.love", "") - bb = aa.replace(" > go back home" , "") + bb = aa.replace(" > go back home", "") cc = bb.replace("Love Calculator | FAQ | About", "") dd = cc.replace("xoxo // the loove.love collection", "") ee = dd.replace("# Love Calculator", "") @@ -1920,13 +2037,15 @@ async def ship2(ctx, person1, person2): text2 = "\n".join([ll.rstrip() for ll in gg.splitlines() if ll.strip()]) await ctx.send(f"{ctx.author.mention}\n{text2}") + def tmpupload(): location = '/home/soso/bot/ytdl/ytdl-tmpvid.mp4' params = (('output', 'text'),) - files = {'files[]': (location, open(location, 'rb')),} + files = {'files[]': (location, open(location, 'rb')), } response = requests.post('https://tmp.ninja/upload.php', params=params, files=files) return response.text + @bot.command() async def youtubedl(ctx, video): os.system('rm /home/soso/bot/ytdl/ytdl-tmpvid.mkv && rm /home/soso/bot/ytdl/ytdl-tmpvid.mp4') @@ -1945,8 +2064,9 @@ async def youtubedl(ctx, video): await ctx.send(f"An error has occured.\nLog:\n```{x}```") os.system('rm /home/soso/bot/ytdl/ytdl-tmpvid.mkv') + @bot.command() -async def archive(ctx, msgid : int = None): +async def archive(ctx, msgid: int = None): try: if msgid == None: await ctx.send("You must provide a message ID!", delete_after(5)) @@ -1969,13 +2089,15 @@ async def archive(ctx, msgid : int = None): attachment_url = msg.attachments[0].url await ctx.send("Contacting Database ", delete_after=3) sql = 'INSERT INTO ARCHIVE (id, author, content, clean_content, jump_url, attachment_url, date, date_edited, hash, uuid) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' - data = [(msgid, author, content, clean_content, jump_url, attachment_url, date, date_edited, hash_msg, uuid)] + data = [ + (msgid, author, content, clean_content, jump_url, attachment_url, date, date_edited, hash_msg, uuid)] with connection2: connection2.executemany(sql, data) await ctx.send(f"Message {msgid} by `{author}` Successfully archived.") except Exception as x: await ctx.send(x) + @bot.command() async def archivelookup(ctx, msgid): try: @@ -2003,7 +2125,7 @@ async def archivelookup(ctx, msgid): avatarbot = botava.avatar_url # disord embed - embed=discord.Embed(title="Message Lookup", color=0x22ff00) + embed = discord.Embed(title="Message Lookup", color=0x22ff00) embed.set_author(name="Funny cat Archive", icon_url=(avatarbot)) embed.set_thumbnail(url=avatar) embed.add_field(name="Message ID:", value=msgid, inline=True) @@ -2019,6 +2141,31 @@ async def archivelookup(ctx, msgid): except Exception as x: await ctx.send(x) + +@bot.command() +async def filepreview(ctx, *, text): + # Download the image + url = ctx.message.attachments[0].url + filename = ctx.message.attachments[0].filename + filetype = ctx.message.attachments[0].content_type + headers = defaultheader + r = requests.get(url, headers=headers, stream=True) + with open(filename, 'wb') as out_file: + shutil.copyfileobj(r.raw, out_file) + del r + # run checks + if "image" not in filetype: + await ctx.send(f"Error: Unsupported file type `{filetype}`") + return + # send feedback + await ctx.send(f" Processing... This might take a while", delete_after(5)) + # process the image + os.system(f'convert 1.jpg -thumbnail 120x120 -bordercolor Lavender -background gray40 -gravity center -set caption "{text}" -polaroid 10 file_gen.png') + await ctx.channel.send(f"{ctx.author.mention}", file=discord.File("file_gen.png")) + + + + """ if number == None: z = int(idd)