Guest User

Untitled

a guest
Nov 30th, 2022
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.04 KB | Software | 0 0
  1. #Discord-Related
  2.  
  3. import discord
  4. from keep_alive import keep_alive
  5. from discord import Intents
  6. from discord.ext import commands
  7. from discord import app_commands
  8.  
  9. #Command-Related/Other
  10.  
  11. from lists import name_list, title_list,spamton
  12. from urllib.request import urlopen
  13. from random import randint
  14. import logging
  15. import os
  16. intents = discord.Intents.default()
  17. intents.messages = True
  18. version ='1.4'
  19. bot = commands.Bot(
  20.     command_prefix="u!",  # Change to desired prefix
  21.     case_insensitive=True,  # Commands aren't case-sensitive
  22.   intents=intents
  23. )
  24.  
  25. bot.author_id = 928109349140824125
  26. intents = discord.Intents.default()
  27. client = discord.Client(intents=intents)
  28. tree = app_commands.CommandTree(client)
  29.  
  30. #Username Command
  31. @tree.command(name = "username8", description = "Generate a random Username", guild=discord.Object(id=1043711872723070976))
  32. async def username8(interaction):
  33.     z = randint(0,len(name_list) - 1)
  34.     za = randint(0, len(title_list) - 1)
  35.     url = "https://www.mit.edu/~ecprice/wordlist.10000"
  36.     page = urlopen(url)
  37.     html_bytes = page.read()
  38.     html = html_bytes.decode("utf-8")
  39.     wordlist = html.split('\n')
  40.     name = []
  41.     if randint(0,1) == 1:
  42.      name.append(wordlist[randint(1, len(wordlist) - 1)])
  43.      name.append(wordlist[randint(1, len(wordlist) - 1)])
  44.     else:
  45.       if randint(0,1) == 1:
  46.         name.append(str(name_list[z]))
  47.         name.append(wordlist[randint(1, len(wordlist) - 1)])
  48.       else:
  49.         if randint(0,1) == 1:
  50.           name.append(wordlist[randint(1, len(wordlist) - 1)])
  51.           name.append(str(name_list[z]))
  52.         else:
  53.           if randint(0,1) == 1:
  54.             name.append(str(name_list[z]))  
  55.             name.append(str(title_list[za]))
  56.           else:
  57.             if randint(0,1) == 1:
  58.               name.append("The_Legend_of")
  59.             else:
  60.               name.append("The_Secret_of")
  61.             name.append(str(name_list[z]))
  62.     print("Generated")
  63.     random = randint(0,5)
  64.     if random == 1:
  65.       usernamec = (name[0] + '_' + name[1] + str(randint(1, 9)))
  66.     elif (random == 2):
  67.       usernamec = (name[0] + '_' + name[1] + str(randint(10,99)))
  68.     elif (random == 3):
  69.       usernamec = (name[0] + '_' + name[1] + str(randint(100,999)))
  70.     elif (random == 4):
  71.       usernamec = (name[0] + '_' + name[1] + str(randint(1000,9999)))
  72.     elif (random == 5):
  73.       usernamec = (name[0] + '_' + name[1] + str(randint(10000,99999)))
  74.     else:
  75.       usernamec = (name[0] + '_' + name[1])
  76.     await interaction.response.send_message(usernamec)
  77.  
  78. #Logging Setup
  79. logging.basicConfig (
  80.  
  81.   filename='devlogs.txt',
  82.  
  83.   level=logging.DEBUG,
  84.  
  85.   format="%(asctime)s %(message)s\n\n"
  86.  
  87. )
  88.  
  89.  
  90. @client.event
  91. async def on_ready():
  92.     await tree.sync(guild=discord.Object(id=1043711872723070976))
  93.     print("Ready!")
  94.     logging.info(("Bot Ready as "+ str(bot.user)))
  95.  
  96.  
  97.  
  98. @bot.command()
  99. async def commands(ctx):
  100.   await ctx.reply("Commands:\nU!Username: Returns Random Username\nU!pogcheck: Are you [[POG]]? RUN THIS [[DISCORD BOT]] COMMAND TO [[FIND OUT]]\nu!ReportIssue: Reports an Issue\nu!BIGSHOT: DO YOU WANT TO BE A [[SHOT BIG?]]\nu!skillcheck do you have skill?\nu!roblox_user Get a random roblox user , or put a range of IDS (seperate with spaces)")
  101.  
  102. @bot.command()
  103. async def username(ctx):
  104.  
  105.     z = randint(0,len(name_list) - 1)
  106.     za = randint(0, len(title_list) - 1)
  107.     url = "https://www.mit.edu/~ecprice/wordlist.10000"
  108.     page = urlopen(url)
  109.     html_bytes = page.read()
  110.     html = html_bytes.decode("utf-8")
  111.     wordlist = html.split('\n')
  112.     name = []
  113.     if randint(0,1) == 1:
  114.      name.append(wordlist[randint(1, len(wordlist) - 1)])
  115.      name.append(wordlist[randint(1, len(wordlist) - 1)])
  116.     else:
  117.       if randint(0,1) == 1:
  118.         name.append(str(name_list[z]))
  119.         name.append(wordlist[randint(1, len(wordlist) - 1)])
  120.       else:
  121.         if randint(0,1) == 1:
  122.           name.append(wordlist[randint(1, len(wordlist) - 1)])
  123.           name.append(str(name_list[z]))
  124.         else:
  125.           if randint(0,1) == 1:
  126.             name.append(str(name_list[z]))  
  127.             name.append(str(title_list[za]))
  128.           else:
  129.             if randint(0,1) == 1:
  130.               name.append("The_Legend_of")
  131.             else:
  132.               name.append("The_Secret_of")
  133.             name.append(str(name_list[z]))
  134.     print("Generated")
  135.     random = randint(0,5)
  136.     if random == 1:
  137.       usernamec = (name[0] + '_' + name[1] + str(randint(1, 9)))
  138.     elif (random == 2):
  139.       usernamec = (name[0] + '_' + name[1] + str(randint(10,99)))
  140.     elif (random == 3):
  141.       usernamec = (name[0] + '_' + name[1] + str(randint(100,999)))
  142.     elif (random == 4):
  143.       usernamec = (name[0] + '_' + name[1] + str(randint(1000,9999)))
  144.     elif (random == 5):
  145.       usernamec = (name[0] + '_' + name[1] + str(randint(10000,99999)))
  146.     else:
  147.       usernamec = (name[0] + '_' + name[1])
  148.     await ctx.reply('Username: ' +usernamec , mention_author=True)
  149.  
  150.  
  151.    
  152.  
  153. @bot.command()
  154. async def pogcheck(ctx):
  155.   await ctx.reply('Pog level: '+ str(randint(0,100))+'%')
  156. try:
  157.   @bot.command()
  158.   async def reportIssue(ctx,Issue:str = None):
  159.     if Issue == None:
  160.       await ctx.reply("Nope. Atleast Write the Issue.")
  161.     else:
  162.       author = str(ctx.message.author)
  163.       report_file = open('reports.txt','a')
  164.       report_file.writelines(author+' in verison: '+version+' Sent Issue:\n'+Issue +'\n\n\n')
  165.       await ctx.reply('Issue Logged!')
  166. except:
  167.   logging.debug('Error Encountered during reportIssue')
  168.  
  169. @bot.command()
  170. async def BIGSHOT(ctx):
  171.   await ctx.reply(spamton[randint(0,len(spamton)-1)])
  172.  
  173. @bot.command()
  174. async def Skillcheck(ctx):
  175.   await ctx.reply('You  have '+randint(1,100)+ '% Skill')
  176.  
  177. extensions = [
  178.     'cogs.devcommands'  # Same name as it would be if you were importing ites
  179. ]
  180. @bot.command()
  181. async def Roblox_User(ctx,min:str = '0',max:str='4050000000'):
  182.   loop = 0
  183.   try:
  184.     min = int(min)
  185.     max = int(max)
  186.     userID = randint(int(min), int(max))
  187.     weblink = "https://web.roblox.com/users/" + str(userID) + "/profile"
  188.     url = weblink
  189.     while loop < 100:
  190.       try:
  191.         page = urlopen(url)
  192.         html_bytes = page.read()
  193.         html = html_bytes.decode("utf-8")
  194.         unformatted = html.split('username":"')[1]
  195.         formatted = unformatted.split('"')[0]
  196.         loop = 100
  197.       except:
  198.         loop += 1
  199.         if loop == 100:
  200.           formatted = ("N/A")
  201.  
  202.       finally:
  203.         await ctx.reply('User: '+formatted+'\nID: ' + str(userID))
  204.   except:
  205.     await ctx.reply("Nope. Please put a valid number")
  206. @tree.command(name = "commandname", description = "My first application Command", guild=discord.Object(id=1043711872723070976))
  207. async def first_command(interaction):
  208.     await interaction.response.send_message("Hello!")
  209.  
  210. if __name__ == '__main__':  # Ensures this is the file being ran
  211.   for extension in extensions:
  212.     bot.load_extension(extension)  
  213. keep_alive()  # Starts a webserver to be pinged.
  214. token = os.environ.get("token")
  215. bot.run(token)  # Starts the bot
  216.  
Advertisement
Add Comment
Please, Sign In to add comment