Advertisement
irokemr

BOT habbo python discord

Jul 10th, 2021 (edited)
907
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.49 KB | None | 0 0
  1. import discord, asyncio
  2. from discord.ext import commands
  3. import requests
  4. import json
  5. import discord
  6. from urllib import parse, request
  7. from requests import get
  8. import datetime
  9. import asyncio
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17. bot = commands.Bot(command_prefix="!")
  18. bot.remove_command("help")
  19.  
  20.  
  21.  
  22.  
  23.  
  24. @bot.command()
  25. async def Habbo(ctx,  *, Habboinfo):
  26.   async with ctx.typing():
  27.     await asyncio.sleep(0)
  28.  
  29.    
  30.    
  31.    
  32.  
  33.      
  34.  
  35.    
  36.     response = requests.get(f'https://www.habbo.es/api/public/users?name={Habboinfo}')
  37.     Habboinfo = response.json()['uniqueId']
  38.    
  39.    
  40.     url= f'https://www.habbo.es/api/public/users/{Habboinfo}/badges'
  41.    
  42.  
  43.    
  44.    
  45.     r= requests.get(url)
  46.     habbo = r.text
  47.     habbo = r.json()
  48.     placas = len(habbo)
  49.  
  50.     url= f'https://www.habbo.es/api/public/users/{Habboinfo}/friends'
  51.     r= requests.get(url)
  52.     habbo1 = r.text
  53.     habbo1 = r.json()
  54.     amigos = len(habbo1)
  55.  
  56.     url = f'https://www.habbo.es/extradata/public/users/{Habboinfo}/photos'
  57.     r= requests.get(url)
  58.     habbo2 = r.text
  59.     habbo2 = r.json()
  60.     fotos = len(habbo2)
  61.  
  62.     url = f'https://www.habbo.es/api/public/users/{Habboinfo}/rooms'
  63.     r= requests.get(url)
  64.     habbo3 = r.text
  65.     habbo3 = r.json()
  66.     salas = len(habbo3)
  67.  
  68.     url = f'https://www.habbo.es/api/public/users/{Habboinfo}/groups'
  69.     r= requests.get(url)
  70.     habbo4 = r.text
  71.     habbo4 = r.json()
  72.     grupos = len(habbo4)
  73.  
  74.  
  75.  
  76.     Habbokeko = response.json()['name']
  77.    
  78.  
  79.     mision = response.json()['motto']
  80.    
  81.    
  82.     #####
  83.    
  84.  
  85.    
  86.     ####
  87.  
  88.     MiembroDesde = response.json()['memberSince']
  89.     registrado = MiembroDesde
  90.     miembro = registrado.split("T")[0].split("-")
  91.     fecha = "/".join(reversed(miembro))
  92.     MiembroDesde = MiembroDesde.replace("."," ")
  93.     MiembroDesde = MiembroDesde.replace("000+0000","")
  94.    
  95.    
  96.     registradodesde = MiembroDesde
  97.     miembro1 = registradodesde.split("T")[1].split(" ")
  98.     hora = " ".join(reversed(miembro1))
  99.  
  100.    
  101.  
  102.    
  103.  
  104.  
  105.  
  106.  
  107.     NivelActual = response.json()['currentLevel']
  108.     TotalXP = response.json()['totalExperience']
  109.     GemasHabbo = response.json()['starGemCount']
  110.     siguientenivel = response.json()['currentLevelCompletePercent']
  111.     embed = discord.Embed(title="\n\n\nEstá es la info de 🡺 " + Habbokeko, description="•ID🡺 " + Habboinfo + "\n\n•Missión🡺 " + mision   + "\n\n•Miembro Desde🡺 " + " Fecha: " + fecha + " Hora: " + hora + "\n\n•Nivel actual🡺 " + (str(NivelActual) + "\n\n•Total placas🡺 " +(str(placas)) + "\n\n•Total Amigos🡺 " + (str(amigos)) + "\n\n•Fotos Totales🡺 "  +(str(fotos))+ "\n\n•Gemas Obtenidas (Estrellas)🡺 " + (str(GemasHabbo)) +"\n\n•Total XP🡺 ")  + (str(TotalXP)) + "\n\n•Siguiente nivel🡺 " +(str(siguientenivel)) + "\n\n•Salas totales🡺 " + (str(salas)) + "\n\n•Grupos totales🡺 " + (str(grupos)) + "\n\n[Visita el perfil de " + Habbokeko + "](https://habbo.es/profile/"+ Habbokeko + ")", timestamp=datetime.datetime.utcnow(), color=discord.Colour.random())
  112.     embed.set_thumbnail(url="https://www.habbo.es/habbo-imaging/avatarimage?user=" + Habbokeko + "&&headonly=1&size=b&gesture=sml&head_direction=4&action=std")
  113.     embed.set_author(name="Habbo [ES]", icon_url="https://i.imgur.com/0UDuO3n.png")
  114.     await ctx.send(embed=embed)
  115.    
  116.    
  117.  
  118.      
  119.  
  120.  
  121. @bot.event
  122. async def on_ready():
  123.       print("BOT listo!")
  124.  
  125.  
  126. bot.run("") #Deberas de crear tu propio bot e TOKEN en el siguiente enlace: https://discord.com/developers/applications
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement