Git Product home page Git Product logo

xmdb / hypixel-guild-chat-bot Goto Github PK

View Code? Open in Web Editor NEW
31.0 1.0 11.0 722 KB

A simple yet modern Discord bot that allows you to bridge between Hypixel guild chat and Discord chat.

License: GNU General Public License v3.0

JavaScript 99.23% Shell 0.77%
hypixel hypixel-api mineflayer mineflayer-bot discord self-hosted discord-js bot nodejs hypixel-discord-bot hypixel-discord discord-bot hypixel-bridge hypixel-guild hypixel-guild-bot haktoberfest

hypixel-guild-chat-bot's Introduction


Hypixel Guild Chat Bot

Hypixel Guild Chat Bot

A Discord bot used to bridge between Hypixel guild chat to Discord and vice versa.
Open source, with love from xMdb 🤍

License Lines of Code Stars

Report a bug · Request a feature · Get in touch

⚠️ This application will login to Hypixel using Mineflayer which is not a normal Minecraft client, this could result in your Minecraft account getting banned from Hypixel, so use this application at your own risk. I am not liable for any damages and no warranty is provided as outlined in GPL-3.0 License.

❌ Deprecation Notice!

Please note that this application will not receive any more updates. This is because of my current real life commitments. I have no time to develop anything. A suitable fork that is available for use is MiscGuild/Jejebecarte's bridge bot here: https://github.com/MiscGuild/bridge

MiscGuild's version is a rewrite of this bot in TypeScript. As a result, it is far superior. Please use it.

About Hychat: it was abandonded because of the reasons above. Its replacement is also MiscGuild.

:)

Features

Hypixel Guild Chat Bot Discord Example
  • Bridges a Discord channel to Hypixel guild chat.
  • Sends all guild related messages to the Discord channel (when I mean all, I mean all).
  • Logs guild joins and leaves through a webhook (/g leave, /g join).
  • Automatic restart and reconnections, making for zero down-time.
  • Contains commands that can be used to control the bot's state, such as powering on and off, and sending chat messages through Discord (bot owner only).
  • Slowmode and "say" commands (send messages as the Discord bot) for trusted users.
  • Log slowmode and "say" command usage through an additional logging webhook.

How Does It Work?

The bot is a self-hosted application that runs both a Discord bot and a Minecraft bot, which interconnect with each other. This is done using Discord.js and Mineflayer, two awesome Node.js libraries.

Who's it for?

This application is for people who are into self-hosting their own applications on server infrastructures or on their own PC. If you don't know how to, don't worry! In the new version, you will be able to host your own fully-featured guild chat bot in just a couple of clicks! Updates will be provided on the Hychat Twitter.

Installation

Prerequisites

  • Git.
  • NodeJS.
  • A full access premium Minecraft account that you can use to connect to Hypixel.

Initial Setup

  1. ⭐ Star this repo!
  2. Clone the repo into your own directory.
$ git clone https://github.com/xMdb/hypixel-guild-chat-bot.git
  1. Enter the new directory and install the NPM packages.
$ cd hypixel-guild-chat-bot
$ npm install
  1. Make a new Discord bot account on the Discord Developer Portal and get the bot token.
  2. Grant the Message Intent for the bot.
  3. Generate an OAuth2 URL by going to OAuth2 on the left side of the application dashboard and clicking the URL generator. Add the bot and application.commands scopes and open the link to invite it.
  4. Re-name the .env.example file to .env and edit the values as instructed.
  5. Edit the config.js file to your liking. Ensure you have valid IDs and such otherwise the bot will not work.
  6. Test the bot.
$ node app.js

If the bot logs into Hypixel, and you can send and receive messages through Discord, proceed to the next steps!

Running in the Background

  1. Install PM2 using npm.
$ npm install -g pm2
  1. Use the npm start script to start with PM2.
$ npm start
  1. Verify that everything works as expected.

Refer to the PM2 documentation for more information about PM2.

Acknowledgements

Parts of this project are forked from:

mew/discord-hypixel-bridge under GPL-3.0 License.

Myzumi/Guild-Bot under Apache-2.0 License.

License

Hypixel Guild Chat Bot is open-sourced software licensed under the GPL-3.0 License.

hypixel-guild-chat-bot's People

Contributors

dependabot[bot] avatar evernotemc avatar imrodry avatar jejebecarte avatar miqhtiedev avatar xmdb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

hypixel-guild-chat-bot's Issues

Fail to send to Limbo

This is a big problem as the other way to get in limbo efficiently is to spam. To avoid mutes you can make it spam a command that does not exist (ex /limbospam)

To solve this, go to the guild chat bot folder and go to events/minecraft/handler/login.js and add some spam like this:
image

Add slash commands

The bot currently does not support slash commands

Message commands will be deprecated in 2022

Add interactions

The bot currently does not use any button or message interactions

feature request: improved help command

Improved Help Command

I propose that the help command lists all the commands by category when it is ran as well as allows you to view usage and description of any command by doing ${prefix}help <command>

Implementation Method

  • First assign each command a category when it gets registered
const commandFolders = fs.readdirSync('./commands');
for (const folder of commandFolders) {
  const commandFiles = fs.readdirSync(`./commands/${folder}`).filter(file => file.endsWith('.js'));
  for (const file of commandFiles) {
    const command = require(`./commands/${folder}/${file}`);
    bot.commands.set(command.name, {
      aliases: command.aliases,
      description: command.description,
      usage: command.usage,
      slowmode: command.slowmode,
      cooldown: commnad.cooldown,
      execute: command.execute, 
      category: folder // <---------
    });
  }
}
  • In the help command you can loop through all the commands and generate a list of every unique category.
  • Loop through the list of each category and add a new field to the embed named after that category and add all commands to that field formatted command, command, etc
  • If the command has a first argument check if that argument is the name of a command and if so display info such as usage description aliases etc
  • If there is no command found say no command found named args[0] do ${prefix}help to see all commands

Reasons for implementation

  • No need to manually enter each new command in when you make it
  • No need to have to separate commands for info about commands (commands & help)
  • Improved experience for users
  • Put categories to use

I am offering to PR this myself, please tell me if you want me to

Broken guild quest regex

image
image

&f    &r&6The guild has completed Tier 1 of this week's Guild Quest!&r&f                         &r&2+50000 Guild Experience&r
&f&l                 GUILD QUEST TIER 1 COMPLETED!&r

Add static or dynamic status

Static - changes between set values randomly (current)
Dynamic - display members online in guild and on Hypixel

question

what are the emojis? can you link a zip file with the emoji images? thanks

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.