Advertisement
irokemr

BOT CODIGO CREADOR PYTHON DISCORD

Jul 7th, 2022
628
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import discord
  2. from discord.ext import commands
  3. import requests
  4. import json
  5. import os
  6. from colorama import Fore, init
  7. from os import system
  8. init()
  9.  
  10.  
  11. bot = commands.Bot(command_prefix='!', description="ayuda bot") #Comando
  12. bot.remove_command("help") # Borra el comando por defecto !help
  13.  
  14.  
  15. @bot.command()
  16. async def codigo(ctx, *, codigo):
  17.     response = requests.get(f"https://fortnite-api.com/v2/creatorcode?name={codigo}")
  18.     try:
  19.  
  20.      CodigoCreador = response.json()['data']['status']
  21.     except KeyError:
  22.         CodigoCreador="el codigo no existe"
  23.     await ctx.send(f'{CodigoCreador}'.replace("ACTIVE","el código existe"))
  24.  
  25.  
  26. #BOT CREADO POR JOSE89FCB
  27. #TWITTER.COM/JOSE89FCB
  28.  
  29.  
  30.  
  31. @bot.event
  32. async def on_ready():
  33.     print("BOT listo!")
  34.  
  35.  
  36.  
  37. bot.run('') #OBTEN UN TOKEN EN: https://discord.com/developers/applications
Advertisement
RAW Paste Data Copied
Advertisement