Facebook
From asa, 1 Month ago, written in Python.
Embed
Download Paste or View Raw
Hits: 195
  1. from instaloader import Instaloader
  2. import os
  3. import wavelink
  4. import nextcord
  5. from nextcord.ext import commands, tasks
  6. import asyncio
  7. import random
  8. from pixabay import image
  9. import aiohttp
  10. import urllib
  11. import json
  12. from bs4 import BeautifulSoup
  13. import requests
  14. from datetime import datetime
  15. import aiosqlite
  16. import asyncpraw
  17. import humanfriendly
  18. import pytz
  19. from itertools import cycle
  20. import io
  21. import yt_dlp
  22. from PIL import Image, ImageDraw, ImageFont
  23.  
  24. L = Instaloader()
  25.  
  26. intents = nextcord.Intents.all()
  27.  
  28. TOKEN = "MTE3NTc3MjkxMzk4MzU2MTczOA.GmmTN6.eImIaItelRzD7t2TghLjzCV8sKQUbrA-zsAJDY"
  29. APIPIXABAY_KEY = "42789839-5784c8844b8f3adac5c09d562"
  30.  
  31. bot = commands.Bot(command_prefix='s!', intents=intents)
  32. intents.presences = True
  33.  
  34. voice_clients = {}
  35. answered_suggestions = []
  36.  
  37. current_question = None
  38. current_answer = None
  39. questionactive = False
  40.  
  41. yt_dl_opts = {'format': 'bestaudio/best'}
  42. ytdl = yt_dlp.YoutubeDL(yt_dl_opts)
  43. ffmpeg_options = {'options': "-vn"}
  44.  
  45. bot_status = cycle(["s!help", "PornHub", "sky's the best", "s!syntax", "i love djfoot", "with ur mom", "with djfoot", "inter vs psg", "with Agge", "with ur mom", "with pinch's mother"])
  46.  
  47. @tasks.loop(seconds=15)
  48. async def change_status():
  49.     await bot.change_presence(activity=nextcord.Game(next(bot_status)))
  50.  
  51. questions = [
  52.     ("What is the capital of Botswana?", "Gaborone"),
  53.     ("What is the largest planet in our solar system?", "Jupiter"),
  54.     ("Who painted the Mona Lisa?", "Leonardo da Vinci"),
  55.     ("Which country is known as the Land of the Rising Sun?", "Japan"),
  56.     ("What does KFC stand for?", "Kentucky Fried Chicken"),
  57.     ("Who made more money? Coca-Cola or Pepsi?", "Coca-Cola"),
  58.     ("What ex-planet in our solar system isn't considered a planet anymore?", "Pluto"),
  59.     ("When was Footcord made? (24 may 2023) | (17 june 2023) | (19 june 2023)", "19 june 2023"),
  60.     ("Who is known as the father of modern physics?", "Albert Einstein"),
  61.     ("What is the chemical symbol of water?", "H2O"),
  62.     ("Which planet is known as the Red Planet?", "Mars"),
  63.     ("What's the tallest mammal on Earth?", "Giraffe")
  64. ]
  65.  
  66. @bot.event
  67. async def on_ready():
  68.     print("Bot is online.")
  69.     default_file_path = "home/container/xslayder-coca-cola.gif"    
  70.     try:
  71.         if default_file_path.lower().endswith(('.gif')):
  72.             with open(default_file_path, 'rb') as avatar:
  73.                 await bot.user.edit(avatar=avatar.read())
  74.         else:
  75.             print("Please provide a valid GIF file path.")
  76.     except Exception as e:
  77.         print(f"Error: {e}")
  78.     change_status.start()
  79.     bot.db = await aiosqlite.connect("s12220_bank.db")
  80.     await asyncio.sleep(3)
  81.     async with bot.db.cursor() as cursor:
  82.         await cursor.execute("CREATE TABLE IF NOT EXISTS bank (wallet INTEGER, bank INTEGER, maxbank INTEGER, user INTEGER)")
  83.         await cursor.execute("CREATE TABLE IF NOT EXISTS suggestions (id INTEGER PRIMARY KEY AUTOINCREMENT, author_id INTEGER, suggestion_text TEXT, status TEXT DEFAULT 'pending')")
  84.     await bot.db.commit()
  85.     print("Connected to database.")
  86.     guild = bot.get_guild(1120312508184530954)
  87.     category = guild.categories[0]  
  88.  
  89.     existing_channel = next((c for c in category.voice_channels if c.name.startswith("Members: ")), None)
  90.     if existing_channel:
  91.         await update_member_count(existing_channel, guild)
  92.     #else:
  93.         #channel = await category.create_voice_channel("Members: 0", position=0)
  94.  
  95.     await guild.chunk()
  96.  
  97. API_KEY = "1b2ec024e31642568ad203730240103"
  98.  
  99. @bot.command()
  100. async def rng(ctx, min_num: int, max_num: int):
  101.     """Generates a random number"""
  102.     if min_num >= max_num:
  103.         await ctx.send("Minimum number must be less than the max number.")
  104.         return
  105.  
  106.     number = random.randint(min_num, max_num)
  107.     await ctx.send(f"The number generated is {number}.")
  108.  
  109. @bot.command()
  110. async def weather(ctx: commands.Context, *, city: str):
  111.     """Used to check the weather of a city"""
  112.     url = "https://api.weatherapi.com/v1/current.json"
  113.     params = {
  114.         "key": API_KEY,
  115.         "q": city
  116.     }
  117.  
  118.     async with aiohttp.ClientSession() as session:
  119.         async with session.get(url, params=params) as res:
  120.             data = await res.json()
  121.  
  122.             location = data["location"]["name"]
  123.             temp_c = data["current"]["temp_c"]
  124.             temp_f = data["current"]["temp_f"]
  125.             humidity = data["current"]["humidity"]
  126.             wind_kph = data["current"]["wind_kph"]
  127.             wind_mph = data["current"]["wind_mph"]
  128.             condition = data["current"]["condition"]["text"]
  129.             image_url = "http:" + data["current"]["condition"]["icon"]
  130.  
  131.             embed = nextcord.Embed(title=f"Weather for {location}", description=f"The condition in **{location}** is **{condition}**")
  132.             embed.add_field(name="Temperature", value=f"C: {temp_c} | F: {temp_f}")
  133.             embed.add_field(name="Humidity", value=f"{humidity}%")
  134.             embed.add_field(name="Wind Speeds", value=f"KPH: {wind_kph} | MPH: {wind_mph}")
  135.             embed.set_thumbnail(url=image_url)
  136.  
  137.             await ctx.send(embed=embed)
  138.  
  139. @bot.command()
  140. async def instapic(ctx, username):
  141.     """Downloads someone's instagram profile picture"""
  142.     try:
  143.         await ctx.send(f"**Downloading {username}'s Instagram profile picture. Please wait..**")
  144.         L.download_profile(username, profile_pic_only=True)
  145.         folder_path = f'/home/container/{username}'
  146.         if os.path.exists(folder_path):
  147.             for filename in os.listdir(folder_path):
  148.                 file_path = os.path.join(folder_path, filename)
  149.                 if filename.endswith(".jpg") or filename.endswith(".jpeg"):
  150.                     await ctx.send(file=nextcord.File(file_path))
  151.                     os.remove(file_path)
  152.             for file in os.listdir(folder_path):
  153.                 file_path = os.path.join(folder_path, file)
  154.                 try:
  155.                     if os.path.isfile(file_path):
  156.                         os.unlink(file_path)
  157.                 except Exception as e:
  158.                     print(f"Error: {e}")
  159.             os.rmdir(folder_path)
  160.             await ctx.send(f"{ctx.author.mention}")
  161.         else:
  162.             await ctx.send("Folder not found.")
  163.     except Exception as e:
  164.         print(f"Error: {e}")
  165.         await ctx.send(f"Error: {e}")
  166.  
  167. @bot.command()
  168. async def stealemoji(ctx, url:str, *, name):
  169.     """Steals an emoji from a different server (mods only)"""
  170.     manager_role = nextcord.utils.get(ctx.guild.roles, name="manager")
  171.     if manager_role is None or (manager_role not in ctx.author.roles and not ctx.author.guild_permissions.administrator):
  172.         await ctx.send("You do not have permission to use this command.")
  173.         return
  174.  
  175.     guild = ctx.guild
  176.     async with aiohttp.ClientSession() as ses:
  177.         async with ses.get(url) as r:
  178.             try:
  179.                 imgOrGif = io.BytesIO(await r.read())
  180.                 bValue = imgOrGif.getvalue()
  181.                 if r.status in range(200, 299):
  182.                     emoji = await guild.create_custom_emoji(image=bValue, name=name)
  183.                     await ctx.send(f"Emoji {emoji} ({name}) has been added.")
  184.                     await ses.close()
  185.                 else:
  186.                     await ctx.send(f"Couldn't add emoji. | {r.status}")
  187.             except nextcord.HTTPException:
  188.                 await ctx.send("Error occurred while adding the emoji. Either the file is too big, or you don't have the permissions to use this command.")
  189.  
  190.  
  191. @bot.event
  192. async def on_message_delete(message):
  193.    if message.author.bot:  
  194.        return
  195.    if message.attachments:  
  196.        attachment_url = message.attachments[0].url  
  197.        embed = nextcord.Embed(
  198.            title=f"{message.author.name} has deleted an image | {message.author.id}",
  199.            description=f"**Deleted image:**"
  200.        )
  201.        embed.set_image(url=attachment_url)  
  202.    else:
  203.        embed = nextcord.Embed(
  204.            title=f"{message.author.name} has deleted a message | {message.author.id}",
  205.            description=f"**Deleted message:** {message.content}"
  206.        )
  207.    channel = bot.get_channel(1213246068251426897)
  208.    await channel.send(embed=embed)
  209.  
  210. @bot.event
  211. async def on_message_edit(before, after):
  212.     if before.author.bot or after.author.bot:
  213.         return
  214.     before_embeds = before.embeds
  215.     after_embeds = after.embeds
  216.     if not before_embeds and not after_embeds:
  217.         channel = bot.get_channel(1213246068251426897)
  218.         embed = nextcord.Embed(
  219.             title=f"{before.author.name} has edited a message | {before.author.id}",
  220.             description=f"**Before message:** {before.content}n**After message:** {after.content}"
  221.         )
  222.         await channel.send(embed=embed)
  223.  
  224. @bot.command()
  225. async def mute(ctx, member: nextcord.Member, time, *, reason):
  226.     """Mutes someone (mods only)"""
  227.     manager_role = nextcord.utils.get(ctx.guild.roles, name="manager")
  228.     if manager_role is None or (manager_role not in ctx.author.roles and not ctx.author.guild_permissions.administrator):
  229.         await ctx.send("You do not have permission to use this command.")
  230.         return
  231.     time = humanfriendly.parse_timespan(time)
  232.     await member.edit(timeout=nextcord.utils.utcnow() + datetime.timedelta(seconds=time))
  233.     await ctx.send(f"{member.display_name} has been muted for {time} seconds by {ctx.author.mention}, reason: {reason}.")
  234.  
  235. @bot.command()
  236. async def unmute(ctx, member: nextcord.Member, *, reason):
  237.     """Unmutes someone (mods only)"""
  238.     manager_role = nextcord.utils.get(ctx.guild.roles, name="manager")
  239.     if manager_role is None or (manager_role not in ctx.author.roles and not ctx.author.guild_permissions.administrator):
  240.         await ctx.send("You do not have permission to use this command.")
  241.         return
  242.     await member.edit(timeout=None)
  243.     await ctx.send(f"{member.display_name} has been unmuted by {ctx.author.mention}, reason: {reason}.")
  244.  
  245.  
  246. @bot.command()
  247. async def play(ctx: commands.Context, *, search: str):
  248.     """Plays videos from YouTube in a voice channel"""
  249.     if not ctx.voice_client:
  250.         vc: wavelink.Player = await ctx.author.voice.channel.connect(cls=wavelink.Player)
  251.     elif not ctx.author.voice_client:
  252.         return await ctx.send("You first have to join a voice chat in order to use the bot!")
  253.     else:
  254.         vc: wavelink.Player = ctx.voice_client
  255.    
  256.     track = await wavelink.YouTubeTrack.from_url(search)
  257.     await vc.play(search)
  258.  
  259.  
  260. @bot.slash_command(name="repeat", description="Repeats whatever the user says")
  261. async def repeat(ctx, message: str):
  262.     await ctx.send(message)
  263.  
  264. @bot.command()
  265. async def av(ctx, member: nextcord.Member = None):
  266.     """Shows someone's avatar"""
  267.     if member is None:
  268.         member = ctx.author
  269.    
  270.     member_avatar = member.avatar.url
  271.  
  272.     avaembed = nextcord.Embed(title=f"{member.name}'s Avatar - Requested by {ctx.author.name}")
  273.     avaembed.set_image(url=member_avatar)
  274.  
  275.     await ctx.send(embed=avaembed)
  276.  
  277. ytdl = yt_dlp.YoutubeDL({'format': 'bestaudio'})
  278.  
  279. @bot.command()
  280. async def members(ctx):
  281.     """Shows the number of members"""
  282.     member_count = len(ctx.guild.members)
  283.     await ctx.send(f"This server has {member_count} members.")
  284.  
  285. @bot.listen("on_message")
  286. async def play_music(ctx):
  287.     if ctx.author.bot:
  288.         return
  289.  
  290.     if ctx.content.startswith("s!play"):
  291.         """Plays videos from YouTube in a voice channel"""
  292.         try:
  293.             voice_state = ctx.author.voice  
  294.             if voice_state and voice_state.channel:  
  295.                 voice_client = await voice_state.channel.connect()
  296.                 voice_clients[ctx.guild.id] = voice_client
  297.             else:
  298.                 await ctx.channel.send("You have to be connected to a voice channel in order to use this.")
  299.                 return  
  300.         except Exception as err:
  301.             await ctx.channel.send("Error occurred while connecting to voice channel.")
  302.             print(f"Error occurred while connecting to voice channel: {err}")
  303.             return
  304.  
  305.         try:
  306.             url = ctx.content.split()[1]
  307.  
  308.             loop = asyncio.get_event_loop()
  309.             data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=False))
  310.  
  311.             if 'entries' in data:
  312.                 data = data['entries'][0]
  313.  
  314.             song_title = data['title']  
  315.             song_url = data['url']
  316.             player = nextcord.FFmpegPCMAudio(song_url, **ffmpeg_options)
  317.             if ctx.guild.id in voice_clients:
  318.                 voice_clients[ctx.guild.id].play(player)
  319.             else:
  320.                 await ctx.channel.send("The bot is not connected to a voice channel.")
  321.                 return
  322.  
  323.             username = ctx.author.name
  324.             await ctx.channel.send(f"Now playing '{song_title}', requested by {username}.")
  325.  
  326.         except Exception as err:
  327.             print(f"Error occurred while playing the song: {err}")
  328.             await ctx.channel.send("Failed to play the song.")
  329.  
  330. @bot.command()
  331. async def pause(ctx):
  332.     """Pauses the bot from playing the video in the voice channel"""
  333.     try:
  334.         voice_state = ctx.author.voice
  335.         if not voice_state or voice_state.channel != voice_clients[ctx.guild.id].channel:
  336.             await ctx.channel.send("You are not in the same voice channel as the bot.")
  337.             return
  338.  
  339.         if ctx.guild.id in voice_clients:
  340.             voice_clients[ctx.guild.id].pause()
  341.             await ctx.channel.send(f"{ctx.author.name} has paused the video.")
  342.         else:
  343.             await ctx.channel.send("The bot is not connected to a voice channel.")
  344.     except Exception as err:
  345.         print(f"Error occurred while pausing: {err}")
  346. @bot.command()
  347. async def resume(ctx):
  348.     """Resumes playing the video in the voice channel"""
  349.     try:
  350.         voice_state = ctx.author.voice
  351.         if not voice_state or voice_state.channel != voice_clients[ctx.guild.id].channel:
  352.             await ctx.channel.send("You are not in the same voice channel as the bot.")
  353.             return
  354.  
  355.         if ctx.guild.id in voice_clients:
  356.             voice_clients[ctx.guild.id].resume()
  357.             await ctx.channel.send(f"{ctx.author.name} has resumed the video.")
  358.         else:
  359.             await ctx.channel.send("The bot is not connected to a voice channel.")
  360.     except Exception as err:
  361.         print(f"Error occurred while resuming: {err}")
  362.  
  363. @bot.command()
  364. async def stop(ctx):
  365.     """Remove the bot from the voice channel"""
  366.     try:
  367.         voice_state = ctx.author.voice
  368.         if not voice_state or voice_state.channel != voice_clients[ctx.guild.id].channel:
  369.             await ctx.channel.send("You are not in the same voice channel as the bot.")
  370.             return
  371.  
  372.         if ctx.guild.id in voice_clients:
  373.             voice_clients[ctx.guild.id].stop()
  374.             await voice_clients[ctx.guild.id].disconnect()
  375.             del voice_clients[ctx.guild.id]
  376.             await ctx.channel.send(f"{ctx.author.name} has removed the bot from the voice chat.")
  377.         else:
  378.             await ctx.channel.send("The bot is not connected to a voice channel.")
  379.     except Exception as err:
  380.         print(f"Error occurred while stopping: {err}")
  381.  
  382. @bot.command()
  383. async def banner(ctx, user: nextcord.Member = None):
  384.     """Shows someone's banner"""
  385.     if user is None:
  386.         user = ctx.author
  387.  
  388.     req = await bot.http.request(nextcord.http.Route("GET", f"/users/{user.id}"))
  389.     banner_id = req.get("banner")
  390.  
  391.     if banner_id:
  392.         if banner_id.startswith("a_"):
  393.             banner_url = f"https://cdn.discordapp.com/banners/{user.id}/{banner_id}.gif?size=1024"
  394.         else:
  395.             banner_url = f"https://cdn.discordapp.com/banners/{user.id}/{banner_id}?size=1024"
  396.            
  397.         await ctx.send(f"{user.name}'s banner requested by {ctx.author.name}.n{banner_url}")
  398.     else:
  399.         await ctx.send(f"{user.name} does not have a banner.")
  400.  
  401.  
  402. async def update_member_count(channel, guild):
  403.     await guild.chunk()
  404.  
  405.     member_count = len(guild.members)
  406.  
  407.     await channel.edit(name=f"Members: {member_count}")
  408.  
  409. @bot.event
  410. async def on_member_join(member):
  411.     welcome_embed = nextcord.Embed(
  412.         title=f"Welcome to our server, {member.name}!",
  413.         description=f"You are one of us now, {member.mention}!nPlease don't forget to:n#1: Be respectful to everyone.n#2: Make sure to read the rules.n#3: Have fun!",
  414.         color=nextcord.Color.blurple()
  415.     )
  416.     if member.avatar:
  417.         welcome_embed.set_thumbnail(url=member.avatar.url)
  418.  
  419.     await bot.get_channel(1121541613991251968).send(embed=welcome_embed)
  420.  
  421.     guild = member.guild
  422.     category = guild.categories[0]  
  423.  
  424.     channel = next((c for c in category.voice_channels if c.name.startswith("Members: ")), None)
  425.  
  426.     if channel:
  427.         await update_member_count(channel, guild)
  428.  
  429. @bot.event
  430. async def on_member_remove(member):
  431.     guild = member.guild
  432.     category = guild.categories[0]  
  433.  
  434.     channel = next((c for c in category.voice_channels if c.name.startswith("Members: ")), None)
  435.  
  436.     if channel:
  437.         await update_member_count(channel, guild)
  438.  
  439. reddit = asyncpraw.Reddit(
  440.     client_id="wz2oGjuKQxUqJpU-ED7soQ",
  441.     client_secret="J28jQ47JHTxtYFoIlNohy_6fHetPaQ",
  442.     user_agent="SopBot/1.0 by PetardaBUM1997",
  443. )
  444.  
  445. @bot.command()
  446. async def sop(ctx):
  447.     """Smash or pass command"""
  448.     subreddit = await reddit.subreddit("jerkofftoceleb")
  449.     image_urls = []
  450.     async for submission in subreddit.hot(limit=200):  
  451.         if submission.url.endswith(('jpg', 'jpeg', 'png')):  
  452.             image_urls.append(submission.url)
  453.  
  454.     if not image_urls:
  455.         return await ctx.send('No images found in the subreddit.')
  456.  
  457.     async def fetch_image(session, url):
  458.         async with session.get(url) as resp:
  459.             if resp.status != 200:
  460.                 return None
  461.             return await resp.read()
  462.  
  463.     async with ctx.typing():
  464.         async with aiohttp.ClientSession() as session:
  465.             tasks = [fetch_image(session, url) for url in image_urls]
  466.             image_data = await asyncio.gather(*tasks)
  467.  
  468.     image_data = [data for data in image_data if data]
  469.  
  470.     if not image_data:
  471.         return await ctx.send('Failed to download any images.')
  472.  
  473.     data = random.choice(image_data)
  474.  
  475.     embed = nextcord.Embed(title="Smash or Pass?", description="Picture taken from **r/jerkofftoceleb**")
  476.     embed.set_image(url="attachment://image.jpg")
  477.  
  478.     author_avatar_url = ctx.author.avatar.url if ctx.author.avatar else nextcord.Embed.Empty
  479.     embed.set_author(name=f"Requested by: {ctx.author.name}", icon_url=author_avatar_url)
  480.  
  481.     channel = nextcord.utils.get(ctx.guild.channels, name="nsfw")
  482.     if channel:
  483.         file = nextcord.File(io.BytesIO(data), filename="image.jpg")
  484.         await channel.send(embed=embed, file=file)
  485.     else:
  486.         await ctx.send("Couldn't find the channel 'nsfw'. Please create it.")
  487.  
  488. @bot.command()
  489. async def msop(ctx):
  490.     """Smash or pass command, but with men"""
  491.     subreddit = await reddit.subreddit("LadyBoners")
  492.     image_urls = []
  493.     async for submission in subreddit.hot(limit=200):  
  494.         if submission.url.endswith(('jpg', 'jpeg', 'png')):  
  495.             image_urls.append(submission.url)
  496.  
  497.     if not image_urls:
  498.         return await ctx.send('No images found in the subreddit.')
  499.  
  500.     async def fetch_image(session, url):
  501.         async with session.get(url) as resp:
  502.             if resp.status != 200:
  503.                 return None
  504.             return await resp.read()
  505.  
  506.     async with ctx.typing():
  507.         async with aiohttp.ClientSession() as session:
  508.             tasks = [fetch_image(session, url) for url in image_urls]
  509.             image_data = await asyncio.gather(*tasks)
  510.  
  511.     image_data = [data for data in image_data if data]
  512.  
  513.     if not image_data:
  514.         return await ctx.send('Failed to download any images.')
  515.  
  516.     data = random.choice(image_data)
  517.  
  518.     embed = nextcord.Embed(title="Smash or Pass?", description="Picture taken from **r/LadyBoners**")
  519.     embed.set_image(url="attachment://image.jpg")
  520.  
  521.     author_avatar_url = ctx.author.avatar.url if ctx.author.avatar else nextcord.Embed.Empty
  522.     embed.set_author(name=f"Requested by: {ctx.author.name}", icon_url=author_avatar_url)
  523.  
  524.     channel = nextcord.utils.get(ctx.guild.channels, name="nsfw")
  525.     if channel:
  526.         file = nextcord.File(io.BytesIO(data), filename="image.jpg")
  527.         await channel.send(embed=embed, file=file)
  528.     else:
  529.         await ctx.send("Couldn't find the channel 'nsfw'. Please create it.")
  530.  
  531. @bot.command()
  532. async def tsop(ctx):
  533.     """Smash or pass command, but with trans people"""
  534.     subreddit = await reddit.subreddit("GoneWildTrans")
  535.     image_urls = []
  536.     async for submission in subreddit.hot(limit=200):  
  537.         if submission.url.endswith(('jpg', 'jpeg', 'png')):  
  538.             image_urls.append(submission.url)
  539.  
  540.     if not image_urls:
  541.         return await ctx.send('No images found in the subreddit.')
  542.  
  543.     async def fetch_image(session, url):
  544.         async with session.get(url) as resp:
  545.             if resp.status != 200:
  546.                 return None
  547.             return await resp.read()
  548.  
  549.     async with ctx.typing():
  550.         async with aiohttp.ClientSession() as session:
  551.             tasks = [fetch_image(session, url) for url in image_urls]
  552.             image_data = await asyncio.gather(*tasks)
  553.  
  554.     image_data = [data for data in image_data if data]
  555.  
  556.     if not image_data:
  557.         return await ctx.send('Failed to download any images.')
  558.  
  559.     data = random.choice(image_data)
  560.  
  561.     embed = nextcord.Embed(title="Smash or Pass?", description="Picture taken from **r/GoneWildTrans**")
  562.     embed.set_image(url="attachment://image.jpg")
  563.  
  564.     author_avatar_url = ctx.author.avatar.url if ctx.author.avatar else nextcord.Embed.Empty
  565.     embed.set_author(name=f"Requested by: {ctx.author.name}", icon_url=author_avatar_url)
  566.  
  567.     channel = nextcord.utils.get(ctx.guild.channels, name="nsfw")
  568.     if channel:
  569.         file = nextcord.File(io.BytesIO(data), filename="image.jpg")
  570.         await channel.send(embed=embed, file=file)
  571.     else:
  572.         await ctx.send("Couldn't find the channel 'nsfw'. Please create it.")
  573.  
  574. @bot.command()
  575. async def porn(ctx):
  576.     """Sends porn pictures"""
  577.     subreddit = await reddit.subreddit("nsfw")
  578.     image_urls = []
  579.     async for submission in subreddit.hot(limit=200):  
  580.         if submission.url.endswith(('jpg', 'jpeg', 'png')):  
  581.             image_urls.append(submission.url)
  582.  
  583.     if not image_urls:
  584.         return await ctx.send('No images found in the subreddit.')
  585.  
  586.     async def fetch_image(session, url):
  587.         async with session.get(url) as resp:
  588.             if resp.status != 200:
  589.                 return None
  590.             return await resp.read()
  591.  
  592.     async with ctx.typing():
  593.         async with aiohttp.ClientSession() as session:
  594.             tasks = [fetch_image(session, url) for url in image_urls]
  595.             image_data = await asyncio.gather(*tasks)
  596.  
  597.     image_data = [data for data in image_data if data]
  598.  
  599.     if not image_data:
  600.         return await ctx.send('Failed to download any images.')
  601.  
  602.     data = random.choice(image_data)
  603.  
  604.     embed = nextcord.Embed(title="Porn image - taken from **r/nsfw**", description="Are you horny? Looking for that sweet sweet quality **porno?** Well my friend, you're in luck. Keep jerking off, you disgusting animal!")
  605.     embed.set_image(url="attachment://image.jpg")
  606.  
  607.     author_avatar_url = ctx.author.avatar.url if ctx.author.avatar else nextcord.Embed.Empty
  608.     embed.set_author(name=f"Requested by: {ctx.author.name}", icon_url=author_avatar_url)
  609.  
  610.     channel = nextcord.utils.get(ctx.guild.channels, name="nsfw")
  611.     if channel:
  612.         file = nextcord.File(io.BytesIO(data), filename="image.jpg")
  613.         await channel.send(embed=embed, file=file)
  614.     else:
  615.         await ctx.send("Couldn't find the channel 'nsfw'. Please create it.")
  616.  
  617. @bot.command()
  618. async def mporn(ctx):
  619.     """Sends porn pictures of men"""
  620.     subreddit = await reddit.subreddit("MenGW")
  621.     image_urls = []
  622.     async for submission in subreddit.hot(limit=200):  
  623.         if submission.url.endswith(('jpg', 'jpeg', 'png')):  
  624.             image_urls.append(submission.url)
  625.  
  626.     if not image_urls:
  627.         return await ctx.send('No images found in the subreddit.')
  628.  
  629.     async def fetch_image(session, url):
  630.         async with session.get(url) as resp:
  631.             if resp.status != 200:
  632.                 return None
  633.             return await resp.read()
  634.  
  635.     async with ctx.typing():
  636.         async with aiohttp.ClientSession() as session:
  637.             tasks = [fetch_image(session, url) for url in image_urls]
  638.             image_data = await asyncio.gather(*tasks)
  639.  
  640.     image_data = [data for data in image_data if data]
  641.  
  642.     if not image_data:
  643.         return await ctx.send('Failed to download any images.')
  644.  
  645.     data = random.choice(image_data)
  646.  
  647.     embed = nextcord.Embed(title="Porn image - taken from **r/MenGW**", description="Are you horny? Looking for that sweet sweet quality **porno?** Well my friend, you're in luck. Keep jerking off, you disgusting animal!")
  648.     embed.set_image(url="attachment://image.jpg")
  649.  
  650.     author_avatar_url = ctx.author.avatar.url if ctx.author.avatar else nextcord.Embed.Empty
  651.     embed.set_author(name=f"Requested by: {ctx.author.name}", icon_url=author_avatar_url)
  652.  
  653.     channel = nextcord.utils.get(ctx.guild.channels, name="nsfw")
  654.     if channel:
  655.         file = nextcord.File(io.BytesIO(data), filename="image.jpg")
  656.         await channel.send(embed=embed, file=file)
  657.     else:
  658.         await ctx.send("Couldn't find the channel 'nsfw'. Please create it.")
  659.  
  660.  
  661. @bot.command()
  662. async def tporn(ctx):
  663.     """Sends porn pictures of trans people"""
  664.     subreddit = await reddit.subreddit("ShemalesParadise")
  665.     image_urls = []
  666.     async for submission in subreddit.hot(limit=200):  
  667.         if submission.url.endswith(('jpg', 'jpeg', 'png')):  
  668.             image_urls.append(submission.url)
  669.  
  670.     if not image_urls:
  671.         return await ctx.send('No images found in the subreddit.')
  672.  
  673.     async def fetch_image(session, url):
  674.         async with session.get(url) as resp:
  675.             if resp.status != 200:
  676.                 return None
  677.             return await resp.read()
  678.  
  679.     async with ctx.typing():
  680.         async with aiohttp.ClientSession() as session:
  681.             tasks = [fetch_image(session, url) for url in image_urls]
  682.             image_data = await asyncio.gather(*tasks)
  683.  
  684.     image_data = [data for data in image_data if data]
  685.  
  686.     if not image_data:
  687.         return await ctx.send('Failed to download any images.')
  688.  
  689.     data = random.choice(image_data)
  690.  
  691.     embed = nextcord.Embed(title="Porn image - taken from **r/ShemalesParadise**", description="Are you horny? Looking for that sweet sweet quality **porno?** Well my friend, you're in luck. Keep jerking off, you disgusting animal!")
  692.     embed.set_image(url="attachment://image.jpg")
  693.  
  694.     author_avatar_url = ctx.author.avatar.url if ctx.author.avatar else nextcord.Embed.Empty
  695.     embed.set_author(name=f"Requested by: {ctx.author.name}", icon_url=author_avatar_url)
  696.  
  697.     channel = nextcord.utils.get(ctx.guild.channels, name="nsfw")
  698.     if channel:
  699.         file = nextcord.File(io.BytesIO(data), filename="image.jpg")
  700.         await channel.send(embed=embed, file=file)
  701.     else:
  702.         await ctx.send("Couldn't find the channel 'nsfw'. Please create it.")
  703.  
  704. @bot.command()
  705. async def meme(ctx):
  706.     """Generates a random meme"""
  707.     try:
  708.         req = urllib.request.Request('https://meme-api.com/gimme', headers={'User-Agent': 'Mozilla/5.0'})
  709.         memeApi = urllib.request.urlopen(req)
  710.         memeData = json.load(memeApi)
  711.        
  712.         memeUrl = memeData['url']
  713.         memeName = memeData['title']
  714.         memePoster = memeData['author']
  715.  
  716.         embed = nextcord.Embed(title=memeName)
  717.         embed.set_image(url=memeUrl)
  718.         embed.set_author(name=f"Meme by: {memePoster}")
  719.         await ctx.send(embed=embed)
  720.  
  721.     except Exception as e:
  722.         await ctx.send(f"An error occurred: {e}")
  723.  
  724. @bot.command()
  725. async def addtext(ctx, *, text: str):
  726.     """Adds a text of choice over an image"""
  727.     if len(ctx.message.attachments) == 0:
  728.         await ctx.send("Please attach a file to your message.")
  729.         return
  730.    
  731.     attachment = ctx.message.attachments[0]
  732.  
  733.     try:
  734.         file_bytes = await attachment.read()
  735.     except nextcord.HTTPException:
  736.         await ctx.send("Failed to download the file.")
  737.         return
  738.        
  739.     file_stream = io.BytesIO(file_bytes)
  740.    
  741.     try:
  742.         image = Image.open(file_stream)
  743.     except OSError:
  744.         await ctx.send("Failed to open the file.")
  745.         return
  746.        
  747.     draw = ImageDraw.Draw(image)
  748.    
  749.     font_size = 150
  750.     font_path = "/home/container/SteauaIntunecata/arial.ttf"
  751.     font = ImageFont.truetype(font_path, int(font_size))
  752.    
  753.     text_width = draw.textlength(text, font=font)
  754.    
  755.     num_lines = text.count('n') + 1
  756.     text_height = font_size * num_lines
  757.    
  758.     text_x = (image.width - text_width) // 2
  759.     text_y = (image.height - text_height) // 2
  760.    
  761.     outline_color = (0, 0, 0)  
  762.     outline_thickness = 2
  763.     outline_position = [(text_x - outline_thickness, text_y - outline_thickness),
  764.                        (text_x + outline_thickness, text_y - outline_thickness),
  765.                        (text_x + outline_thickness, text_y + outline_thickness),
  766.                        (text_x - outline_thickness, text_y + outline_thickness)]
  767.     draw.text((text_x - outline_thickness, text_y - outline_thickness), text, fill=outline_color, font=font)
  768.     draw.text((text_x + outline_thickness, text_y - outline_thickness), text, fill=outline_color, font=font)
  769.     draw.text((text_x - outline_thickness, text_y + outline_thickness), text, fill=outline_color, font=font)
  770.     draw.text((text_x + outline_thickness, text_y + outline_thickness), text, fill=outline_color, font=font)
  771.    
  772.     draw.text((text_x, text_y), text, fill=(255, 255, 255), font=font)
  773.    
  774.     modified_image_bytes = io.BytesIO()
  775.     image.save(modified_image_bytes, format='PNG')
  776.     modified_image_bytes.seek(0)
  777.    
  778.     await ctx.send(file=nextcord.File(modified_image_bytes, filename='modified_image.png'))
  779.  
  780.  
  781. class InviteButtons(nextcord.ui.View):
  782.     def __init__(self, inv: str):
  783.         super().__init__()
  784.         self.inv = inv
  785.         self.add_item(nextcord.ui.Button(label="Invite Link", url=self.inv))
  786.  
  787.     @nextcord.ui.button(label="Invite Btn", style=nextcord.ButtonStyle.blurple)
  788.     async def inviteBtn(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
  789.         await interaction.response.send_message(self.inv)
  790.  
  791. @bot.command()
  792. async def invite(ctx: commands.Context):
  793.     """Creates an invite link for the server"""
  794.     inv = await ctx.channel.create_invite()
  795.     await ctx.send("Click the buttons below to create an invite link!", view=InviteButtons(str(inv)))
  796.  
  797. async def create_balance(user):
  798.     async with bot.db.cursor() as cursor:
  799.         await cursor.execute("INSERT INTO bank VALUES(?, ?, ?, ?)", (0, 100, 500, user.id))
  800.     await bot.db.commit()
  801.     return
  802.  
  803. async def get_balance(user):
  804.     async with bot.db.cursor() as cursor:
  805.         await cursor.execute("SELECT wallet, bank, maxbank FROM bank WHERE user = ?", (user.id,))
  806.         data = await cursor.fetchone()
  807.         if data is None:
  808.             await create_balance(user)
  809.             return 0, 100, 500
  810.         wallet, bank, maxbank = data[0], data[1], data[2]
  811.         return wallet, bank, maxbank
  812.  
  813. async def update_wallet(user, amount: int):
  814.     async with bot.db.cursor() as cursor:
  815.         await cursor.execute("SELECT wallet FROM bank WHERE user = ?", (user.id,))
  816.         data = await cursor.fetchone()
  817.         if data is None:
  818.             await create_balance(user)
  819.             return 0
  820.         await cursor.execute("UPDATE bank SET wallet = ? WHERE user = ?", (data[0] + amount, user.id))
  821.     await bot.db.commit()
  822.  
  823. @bot.command()
  824. async def balance(ctx: commands.Context, member: nextcord.Member = None):
  825.     """Check how many drakes you have in your account"""
  826.     if not member:
  827.         member = ctx.author
  828.     wallet, bank, maxbank = await get_balance(member)
  829.     em = nextcord.Embed(title=f"{member.name}'s Balance")
  830.     em.add_field(name="Wallet", value=wallet)
  831.     em.add_field(name="Bank", value=f"{bank}/{maxbank}")
  832.     await ctx.send(embed=em)
  833.  
  834. async def update_bank(user, amount):
  835.     async with bot.db.cursor() as cursor:
  836.         await cursor.execute("SELECT wallet, bank, maxbank FROM bank WHERE user = ?", (user.id,))
  837.         data = await cursor.fetchone()
  838.         if data is None:
  839.             await create_balance(user)
  840.             return 0
  841.         capacity = int(data[2] - data[1])
  842.         if amount > capacity:
  843.             await update_wallet(user, amount)
  844.             return 1
  845.         await cursor.execute("UPDATE bank SET bank = ? WHERE user = ?", (data[1] + amount, user.id))
  846.     await bot.db.commit()
  847.  
  848. @bot.command()
  849. @commands.cooldown(1, 30, commands.BucketType.user)
  850. async def beg(ctx: commands.Context):
  851.     """Can be used to beg for drakes"""
  852.     chances = random.randint(1, 4)
  853.     if chances == 1:
  854.         await ctx.send("Unlucky, you got nothing.")
  855.     else:
  856.         amount = random.randint(5, 300)
  857.         res = await update_wallet(ctx.author, amount)
  858.         if res == 0:
  859.             await ctx.send("No account found so one has just been created for you. Please run the command again using **s!beg**!")
  860.         else:
  861.             await ctx.send(f"You got **{amount}** drakes.")
  862.  
  863. @beg.error
  864. async def beg_error(ctx, error):
  865.     if isinstance(error, commands.CommandOnCooldown):
  866.         remaining_time = error.retry_after
  867.         minutes, seconds = divmod(remaining_time, 60)
  868.         await ctx.send(f"Sorry, you need to wait **{int(seconds)}** seconds before using this command again.")
  869.  
  870. @bot.command()
  871. @commands.cooldown(1, 5, commands.BucketType.user)
  872. async def withdraw(ctx: commands.Context, amount):
  873.     """Used to withdraw your drakes"""
  874.     wallet, bank, maxbank = await get_balance(ctx.author)
  875.     try:
  876.         amount = int(amount)
  877.     except ValueError:
  878.         pass
  879.     if type(amount) == str:
  880.         if amount.lower() == "max" or amount.lower() == "all":
  881.             amount = int(wallet)
  882.     else:
  883.         amount = int(amount)
  884.    
  885.     bank_res = await update_bank(ctx.author, -amount)
  886.     wallet_res = await update_wallet(ctx.author, amount)
  887.     if bank_res == 0 or wallet_res == 0:
  888.         return await ctx.send("No account found so one has been created for you. Please run the command again using **s!withdraw**!")
  889.     elif bank_res == 1:
  890.         return await ctx.send("You don't have enough storage in your bank!")
  891.     wallet, bank, maxbank = await get_balance(ctx.author)
  892.     em = nextcord.Embed(title=f"{amount} drakes have been withdrew from the bank.")
  893.     em.add_field(name="New Wallet", value=wallet)
  894.     em.add_field(name="New Bank", value=f"{bank}/{maxbank}")
  895.     await ctx.send(embed=em)
  896.  
  897. @bot.command()
  898. @commands.cooldown(1, 5, commands.BucketType.user)
  899. async def deposit(ctx: commands.Context, amount):
  900.     """Used to deposit your drakes"""
  901.     wallet, bank, maxbank = await get_balance(ctx.author)
  902.     try:
  903.         amount = int(amount)
  904.     except ValueError:
  905.         pass
  906.     if type(amount) == str:
  907.         if amount.lower() == "max" or amount.lower() == "all":
  908.             amount = int(wallet)
  909.     else:
  910.         amount = int(amount)
  911.    
  912.     bank_res = await update_bank(ctx.author, amount)
  913.     wallet_res = await update_wallet(ctx.author, -amount)
  914.     if bank_res == 0 or wallet_res == 0:
  915.         return await ctx.send("No account found so one has been created for you. Please run the command again using **s!deposit**!")
  916.     elif bank_res == 1:
  917.         return await ctx.send("You don't have enough storage in your bank!")
  918.     wallet, bank, maxbank = await get_balance(ctx.author)
  919.     em = nextcord.Embed(title=f"{amount} drakes have been deposited into your bank account.")
  920.     em.add_field(name="New Wallet", value=wallet)
  921.     em.add_field(name="New Bank", value=f"{bank}/{maxbank}")
  922.     await ctx.send(embed=em)
  923.  
  924. @bot.command()
  925. @commands.cooldown(1, 10, commands.BucketType.user)
  926. async def give(ctx: commands.Context, member: nextcord.Member, amount):
  927.     """Used to give someone drakes"""
  928.     wallet, bank, maxbank = await get_balance(ctx.author)
  929.     try:
  930.         amount = int(amount)
  931.     except ValueError:
  932.         pass
  933.     if type(amount) == str:
  934.         if amount.lower() == "max" or amount.lower() == "all":
  935.             amount = int(wallet)
  936.     else:
  937.         amount = int(amount)
  938.    
  939.     wallet_res = await update_wallet(ctx.author, -amount)
  940.     wallet_res2 = await update_wallet(member, amount)
  941.     if wallet_res == 0 or wallet_res2 == 0:
  942.         return await ctx.send("No account found so one has been created for you. Please run the commmand again using **s!give**!")
  943.  
  944.     wallet2, bank2, maxbank2 = await get_balance(member)
  945.  
  946.     em = nextcord.Embed(title=f"Gave {amount} drakes to {member.name}!")
  947.     em.add_field(name=f"{ctx.author.name}'s Wallet", value=wallet)
  948.     em.add_field(name=f"{member.name}'s wallet", value=wallet2)
  949.     await ctx.send(embed=em)
  950.  
  951. @bot.command()
  952. async def question(ctx):
  953.     """Generate a random question for everyone to guess (mods only)"""
  954.     manager_role = nextcord.utils.get(ctx.guild.roles, name="manager")
  955.     if manager_role is None or (manager_role not in ctx.author.roles and not ctx.author.guild_permissions.administrator):
  956.         await ctx.send("You do not have permission to use this command.")
  957.         return
  958.  
  959.     global current_question, current_answer, questionactive
  960.  
  961.     if questionactive == True:
  962.         await ctx.send("There is already an active question. Please wait for it to be answered.")
  963.         return
  964.  
  965.     current_question, current_answer = random.choice(questions)
  966.     questionactive = True
  967.     general_channel = nextcord.utils.get(ctx.guild.channels, name='general')
  968.     await general_channel.send(f"**Question:** {current_question}nPlease use **s!answer <ANSWER>** to answer the question!")
  969.  
  970. @bot.command()
  971. async def answer(ctx, *, response):
  972.     """Answer a question"""
  973.     global questionactive
  974.  
  975.     if not questionactive:
  976.         await ctx.send("There isn't an active question right now. Try again later!")
  977.         return
  978.  
  979.     cleaned_response = response.strip().lower()
  980.     cleaned_correct_answer = current_answer.strip().lower()
  981.  
  982.     if cleaned_response == cleaned_correct_answer:
  983.         amount = random.randint(50, 200)
  984.         await ctx.send(f"Correct! {ctx.author.mention} gets {amount} drakes.")
  985.         questionactive = False
  986.         await update_wallet(ctx.author, amount)
  987.     else:
  988.         await ctx.send(f"Wrong answer, {ctx.author.mention}.")
  989.  
  990. @bot.command()
  991. async def time(ctx, city):
  992.     """Shows the current time of the specified city"""
  993.     try:
  994.         tz = pytz.timezone(f"Europe/{city}")
  995.         city_time = datetime.now(tz=tz)
  996.         await ctx.send(f"The current date and time in **{city}** is **{city_time.strftime('%Y-%m-%d | %H:%M:%S')}**")
  997.     except pytz.UnknownTimeZoneError:
  998.         await ctx.send("Unknown time zone. Please provide a valid city.")
  999.  
  1000. @bot.command()
  1001. async def syntax(ctx):
  1002.     """Shows the syntax of all the commands"""
  1003.     em = nextcord.Embed(title="Syntax of all the available commands")
  1004.     em.add_field(name="Commands", value="s!addtext <text> (have to send pic in order to add the text over it)ns!answer <answer>ns!av <user>ns!balancens!banner <user>ns!begns!deposit <amount>ns!give <user> <amount>ns!help (description of all the commands)ns!instapic <profile>ns!invitens!memens!mute <member> <time> <reason>ns!unmute <member> <reason>ns!play <youtube url>ns!pausens!resumens!stopns!questionns!rng <first number> <second number>ns!stealemoji <emoji link> <emoji name>ns!weather <city>ns!time <city>ns!withdraw <amount>ns!suggestion <suggestion>ns!approve <suggestion id> <reason>ns!deny <suggestion id> <reason>ns!membersns!qinfo <member>ns!sopns!pornns!mpornns!msopns!tsopns!tporn")
  1005.     em.add_field(name="Important", value="Commands without any syntax have only their name and nothing after them. Example: SYNTAX command = s!answer <answer> | NOT syntax = s!beg")
  1006.     await ctx.send(embed=em)    
  1007.  
  1008. @bot.command()
  1009. async def suggestion(ctx, *, suggestion):
  1010.     """Adds a suggestion"""
  1011.     await ctx.channel.purge(limit=1)
  1012.  
  1013.     channel = nextcord.utils.get(ctx.guild.text_channels, name='suggestions-server-planning')
  1014.     suggest = nextcord.Embed(title="New suggestion!", description=f"{ctx.author.name} has suggested: **{suggestion}**")
  1015.     sugg = await channel.send(embed=suggest)
  1016.     await channel.send(f"Suggestion ID: **{sugg.id}**")
  1017.     await sugg.add_reaction('✅')
  1018.     await sugg.add_reaction('❌')
  1019.  
  1020.     async with bot.db.cursor() as cursor:
  1021.         await cursor.execute("INSERT INTO suggestions (author_id, suggestion_text, status) VALUES (?, ?, 'pending')", (ctx.author.id, suggestion))
  1022.         await bot.db.commit()
  1023.  
  1024. @bot.command()
  1025. async def approve(ctx, id:int=None, *, reason=None):
  1026.     """Approves a suggestion (only for mods)"""
  1027.     manager_role = nextcord.utils.get(ctx.guild.roles, name="manager")
  1028.     if manager_role is None or (manager_role not in ctx.author.roles and not ctx.author.guild_permissions.administrator):
  1029.         await ctx.send("You do not have permission to use this command.")
  1030.         return
  1031.     if id is None:
  1032.         return
  1033.  
  1034.     if id in answered_suggestions:
  1035.         await ctx.send("This suggestion has already been answered.")
  1036.         return
  1037.  
  1038.     channel = nextcord.utils.get(ctx.guild.text_channels, name='suggestions-server-planning')
  1039.     if channel is None:
  1040.         return
  1041.     suggestionMsg = await channel.fetch_message(id)
  1042.     embed = nextcord.Embed(
  1043.         title="Suggestion approved!",
  1044.         description=f"The suggestion with the ID of **{suggestionMsg.id}** has been approved by **{ctx.author.name}** | Reason: **{reason}**",
  1045.         color=nextcord.Color.green()  
  1046.     )
  1047.     await channel.send(embed=embed)
  1048.  
  1049.     async with bot.db.cursor() as cursor:
  1050.         await cursor.execute("UPDATE suggestions SET status = 'approved' WHERE id = ?", (id,))
  1051.         await bot.db.commit()
  1052.  
  1053.     answered_suggestions.append(id)
  1054.  
  1055. @bot.command()
  1056. async def deny(ctx, id:int=None, *, reason=None):
  1057.     """Denies a suggestion (only for mods)"""
  1058.     manager_role = nextcord.utils.get(ctx.guild.roles, name="manager")
  1059.     if manager_role is None or (manager_role not in ctx.author.roles and not ctx.author.guild_permissions.administrator):
  1060.         await ctx.send("You do not have permission to use this command.")
  1061.         return
  1062.     if id is None:
  1063.         return
  1064.     if id in answered_suggestions:
  1065.         await ctx.send("This suggestion has already been answered.")
  1066.         return
  1067.  
  1068.     channel = nextcord.utils.get(ctx.guild.text_channels, name='general')
  1069.     if channel is None:
  1070.         return
  1071.     suggestionMsg = await channel.fetch_message(id)
  1072.     embed = nextcord.Embed(
  1073.         title="Suggestion denied!",
  1074.         description=f"The suggestion with the ID of **{suggestionMsg.id}** has been denied by **{ctx.author.name}** | Reason: **{reason}**",
  1075.         color=nextcord.Color.red()  
  1076.     )
  1077.     await channel.send(embed=embed)
  1078.  
  1079.     async with bot.db.cursor() as cursor:
  1080.         await cursor.execute("UPDATE suggestions SET status = 'denied' WHERE id = ?", (id,))
  1081.         await bot.db.commit()
  1082.  
  1083.     answered_suggestions.append(id)
  1084.  
  1085. @bot.command()
  1086. async def qinfo(ctx, member: nextcord.Member):
  1087.     """Shows informations of a member"""
  1088.     info_embed = nextcord.Embed(title=f"{member.name}'s quick account information", description="Some informations about the discord user.", color=member.color)
  1089.     info_embed.add_field(name="Name:", value=member.name, inline=False)
  1090.     info_embed.add_field(name="ID", value=member.id, inline=False)
  1091.     info_embed.add_field(name="Activity/Custom Status:", value=member.activity, inline=False)
  1092.     info_embed.add_field(name="Created at:", value=member.created_at.__format__('%A, %d %B %Y @ %H:%M:%S'))
  1093.     info_embed.set_thumbnail(url=member.avatar)
  1094.  
  1095.     await ctx.send(embed=info_embed)
  1096.  
  1097. #@bot.command()
  1098. #async def search(ctx, *, query):
  1099. #    # Pixabay API endpoint
  1100. #    url = f"https://pixabay.com/api/?key={APIPIXABAY_KEY}&q={query}&per_page=5"
  1101. #
  1102. #    # Make the API request
  1103. #    response = requests.get(url)
  1104. #
  1105. #    # Check if request was successful
  1106. #    if response.status_code == 200:
  1107. #        # Parse JSON response
  1108. #        data = response.json()
  1109. #
  1110. #        # Send the image URLs
  1111. #        for hit in data['hits']:
  1112. #            await ctx.send(hit['largeImageURL'])
  1113. #    else:
  1114. #        await ctx.send("Error: Unable to retrieve image URLs.")
  1115.  
  1116.  
  1117. #@bot.command()
  1118. #async def gpt(ctx: commands.Context, *, prompt: str):
  1119. #    async with aiohttp.ClientSession() as session:
  1120. #        payload = {
  1121. #            "model": "gpt-3.5-turbo",  # Update model name to a supported model
  1122. #            "prompt": prompt,
  1123. #            "temperature": 0.5,
  1124. #            "max_tokens": 50,
  1125. #            "presence_penalty": 0,
  1126. #            "frequency_penalty": 0,
  1127. #            "best_of": 1,
  1128. #        }
  1129. #        headers = {"Authorization": f"Bearer {CGAPI}"}
  1130. #        async with session.post("https://api.openai.com/v1/completions", json=payload, headers=headers) as resp:
  1131. #            response = await resp.json()
  1132. #            print("Response from AI:", response)  # Print the response for debugging
  1133. #            if "choices" in response and len(response["choices"]) > 0 and "text" in response["choices"][0]:
  1134. #                response_text = response["choices"][0]["text"]
  1135. #                embed = nextcord.Embed(title="Chat GPT's Response:", description=response_text)
  1136. #                await ctx.reply(embed=embed)
  1137. #            else:
  1138. #                await ctx.reply(f'Failed to get a response from OpenAI.')
  1139.  
  1140. bot.run(TOKEN)
  1141.