· 5 years ago · Aug 25, 2020, 12:52 AM
1# obtain proper libraries for hypixel stats and discord.py
2import discord
3from discord.ext import commands
4import hypixel
5
6#initialize discord.py and hypixel api
7client = commands.Bot(command_prefix = ".")
8API_KEYS = ['nope']
9hypixel.setKeys(API_KEYS)
10
11#sends a message to the console when the bot is connected
12@client.event
13async def on_ready():
14 print(f"{client.user} is ready!")
15
16#basic ping command
17@client.command(brief = "Tells you the ping in ms", description = "Tells you the time to connect from idiot.exes pc to the discord server (in ms)")
18async def ping(ctx):
19 await ctx.send(f"pong! {round(client.latency * 1000, 4)} ms")
20
21#orchestra website command that mentions the sender
22@client.command(brief = "links the orchestra website", description = "links the orchestra website")
23async def website(ctx):
24 await ctx.send(f"{ctx.author.mention} https://sites.google.com/a/roundrockisd.org/round-rock-high-dragon-orchestra/")
25
26#funny meme command
27@client.command(brief = "haha brrr go brrrr", description = "brrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr")
28async def brr(ctx):
29 await ctx.send("https://i.clouds.tf/hys8/7nvo.png")
30
31#tells you if you have nitro idk why i made this
32@client.command()
33async def nitro(ctx):
34 user = ctx.author
35
36 if user.premium_since == None:
37 await ctx.send("you do not have nitro")
38 else:
39 await ctx.send("you have nitro")
40
41#links the rrdragonorchestra instagram
42@client.command()
43async def instagram(ctx):
44 await ctx.send(f"{ctx.author.mention} https://instagram.com/rrdragonorchestra")
45
46
47#links the skyleamoe page for a given user
48@client.command()
49async def sbprof(ctx,mcname):
50 await ctx.send(f"https://sky.lea.moe/stats/{mcname}")
51
52#uses hypixel.py to show the rank and network level of a user
53@client.command()
54async def hystats(ctx,mcuser):
55 Player = hypixel.Player(mcuser)
56 HYPlayerName = Player.getName()
57 HYPlayerRank = Player.getRank()
58 HYPlayerLevel = Player.getLevel()
59 infotosend = f"""
60 {HYPlayerName} has the rank of {HYPlayerRank['rank']}
61 The level of {HYPlayerName} is {round(HYPlayerLevel,0)}
62 """
63 await ctx.send(infotosend)
64
65@client.command()
66async def basement(ctx):
67 myguild = client.get_guild(733508936216477706)
68
69 basement_role = myguild.get_role(744013188911071362)
70
71 await ctx.author.add_roles(basement_role)
72
73#uses my api key to run the code and start sending it over to discord
74client.run("nope")
75