Giter Club home page Giter Club logo

huggy-discord-bot's Introduction

huggy-discord-bot

version last commit

A discord bot for giving out hugs.

This bot remembers hugs on a guild-by-guild basis, so if you have the bot connected to multiple servers (guilds), then it will tell you how many hugs you have in ther server where you called the command (Say, in server A you have 10 hugs and in server B you have 7 hugs. If you get a hug in server A it doesn't affect the hugs in server B and vice-versa. The data is guild-aware and you won't get crossover).

Setup

Installation

Install from this GitHub page, either through cloning the repository or downloading the latest release on the right. Then, setup the virtual environment (I used venv as an example folder, use whatever you want) and run it:

python -m venv venv && ./venv/Scripts/activate

Then, install the requirements:

pip install -r requirements.txt

Connection to Discord

Next, set up your environment variables in a .env file. The program looks for DISCORD_TOKEN to retrieve the token for your bot. (Here are instructions on how to get a token for your bot):

# .env file

DISCORD_TOKEN={insert-token-here}

See the roadmap for potential future environment variables.

You will need to connect your bot to guilds (servers), which you can do with OAuth2, where you will select Bot and fill out the permissions. For this bot, you only need the following permissions:

  • Read Messages/View Channels
  • Send Messages
  • Slash Commands

You will also need to make sure the following are selected underneath your bot permission gateway intents:

image

Running

Now you can run the discord bot with the command:

python huggy.py

This will connect to your server. You must have a text channel called #bot-commands. The bot listens for commands in this channel and responds to them here.

Roadmap

  • Add support for multiple channels in .env under the CHANNELS variable.
  • Add support for guilds in .env under the GUILDS variable.
    • This would be used to limit the bot to specific guilds.
  • Add support for /restart and /update admin commands.
    • Useful when pushing updates to the server and forcing it to update; or, restart if it is not working correctly.
    • /update would only work for the owner of the bot.
  • Add better style/add embedding for returned commands.
    • Embed the hugboard to look better, at a minimum.
  • Add API to call and create bot externally in other applications.
  • Get .gifs instead of .mp4 files to use for the hug visuals.
  • Move from SQLite3 to another database solution (Postgres, potentially).

Contributing

If you would like to contribute to this project, please fork the repository and make a pull request.

License

This project is subject to the most restrictive license of any dependency used within it. In cases where dependency licenses allow, the project will be licensed under GPLv3.

huggy-discord-bot's People

Contributors

aulasw avatar

Watchers

 avatar

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.