Git Product home page Git Product logo

hypixelbot's Introduction

HypixelBot

A Hypixel Discord Bot made purely for displaying Hypixel statistics.

To run this bot, change <TOKEN> in config.ini to your Discord Bot Token, which can be retrieved from your Discord Developer Portal. <API KEY> will also need to be changed to your Hypixel API Key, which can be created by connecting to the Minecraft server mc.hypixel.net and running the /api new command.

If you wish, you may also change <LOG CHANNEL ID> in config.ini to a Discord channel ID. Bot events, errors, etc will be sent to the specified channel.

This bot retrieves statistics from the official public Hypixel API. Documentation for the API can be found here.

Thanks to @DimBis for helping me with this project.

License

plun1331/HypixelBot is licensed under the MIT License. This license can be viewed here.

Disclaimer

This bot is in no way affiliated with or endorsed by Hypixel, Inc. All logos, brands, trademarks, and registered trademarks are property of their respective owners.

Support Server

If you require help with the bot, or anything related to coding really, you can join our support server, Smudge Studios

Requirements

Commands

You may find a list of public commands here.

Restricted Commands

  • h!load <extension> - Load an extension.

  • h!unload <extension> - Unload an extension.

  • h!reload <extension> - Reload an extension.

  • h!stop - Stop the bot.

  • h!logs - Uploads the logs to mystbin and DMs them to you.

  • h!eval <code> - Evaluates Python code. This can be used with code blocks as well.

Invite

To add this bot to your server, click here.

Widgets

TOP.GG

Discord Bot List

Discord Boats

hypixelbot's People

Contributors

plun1331 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

hypixelbot's Issues

Consider using a single loop to load all extensions

Hey, I saw your thread on the Hypixel forums and thought I'd drop some feedback.

HypixelBot/main.py

Lines 24 to 46 in f70cb70

def load_extension(extension):
try:
bot.load_extension(extension)
con.log(f"{extension} loaded.")
except Exception as e:
con.log(f"Couldn't load {extension}: {e}")
for file in os.listdir("commands"):
if file.endswith(".py"):
load_extension(f"commands.{file}".replace('.py', ''))
for file in os.listdir("commands/owner"):
if file.endswith(".py"):
load_extension(f"commands.owner.{file}".replace('.py', ''))
for file in os.listdir("events"):
if file.endswith(".py"):
load_extension(f"events.{file}".replace('.py', ''))
for file in os.listdir("tasks"):
if file.endswith(".py"):
load_extension(f"tasks.{file}".replace('.py', ''))

Instead of going loop -> if ends with py -> load extensions, you could move this logic inside the load_extension function, or have a predefined list of directories to load from. For example (not tested):

for dir_name in ["...", "...", "..."]:
  for file in os.listdir(dir_name):
    if file.endswith(".py"):
      load_extension(f"{dir_name}.{file}".replace('.py', ''))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.