GithubHelp home page GithubHelp logo

malikaza / pyzunivers Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 176 KB

ZUnivers API python wrapper

Home Page: https://malikaza.github.io/pyZUnivers/

License: MIT License

Python 100.00%
api python zerator zunivers wrapper wrapper-api

pyzunivers's Introduction

Python Version GitHub last commit

pyZUnivers

ZUnivers API python wrapper

Documentation

Installation

Disclaimers:

  • It is recommended to install the module (with your project using it) in a virtual environment.
  • pyZUnivers module is not available on PyPi yet, so you can use the installation python script to add required dependencies and add the module to your python site-packages folder, making it globally available on your machine.
python installation.py

or

python3 installation.py

Example

import discord
from discord.ext import commands
import pyZUnivers as ZU

class Zunivers(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.command(name="zuchecker", help="Permets de faire un récap' de qui à besoin de faire quoi.")
    async def zuchecker(self, ctx: commands.Context):
        server = self.bot.get_guild(<your_guild_id>)
        zu_role = server.get_role(<specific_role_id_in_your_guild>)
        journa, bonus, nowel = list(), list(), list()
        msg = await ctx.send("Je vérifie qui doit faire quelque chose...")
        try:
            for i in zu_role.members:
                konar_profile = ZU.User.get_checker(i.name)
                if not konar_profile["journa"]: journa.append(i.name)
                if not konar_profile["bonus"]: bonus.append(i.name)
                if not konar_profile["advent"] and konar_profile["advent"] is not None: nowel.append(i.name)

            embed = discord.Embed(color=discord.Colour(value=0x19BC14), description=f"<#{ZU.utils.JOURNA_BONUS_TICKET_CHANNEL_ID}>")
            embed.set_author(name="ZUnivers - Checker")
            if len(journa) != 0: embed.add_field(name="📅 Journa", value="".join([f"- {x}\n" for x in journa]))
            if len(bonus) != 0: embed.add_field(name="🎁 Bonus", value="".join([f"- {x}\n" for x in bonus]))
            if len(nowel) != 0: embed.add_field(name="🎄 Advent", value="".join([f"- {x}\n" for x in nowel]))
            if len(journa) == 0 and len(bonus) == 0 and len(nowel) == 0: embed.description = "Personne a besoin de faire quoi que ce soit."

            await msg.edit(embed=embed, content="")
        except ZU.ZUniversAPIError as e:
            await msg.edit("`Erreur dans la command 'zu checker'."
                        f" {e.message}`\n`Endpoint: {e.url}`")

async def setup(bot):
    await bot.add_cog(Zunivers(bot))

pyzunivers's People

Contributors

malikaza avatar shiversvert avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

shiversvert

pyzunivers's Issues

Problème journa/bonus

Je compte pas les jours sans journa pour le bonus, pour éviter les décalages (qu'avait plot par exemple) mais du coup ça foire le journa du bonus même …
ils peuvent pas juste dire dans leur API : bonus = oui|non

Ajout du canal au pied de page de l'incorporation pour la navigation directe

Description

Actuellement, lorsqu'une incorporation est affichée dans un canal sur Zunivers, il n'y a pas de moyen direct pour les utilisateurs de naviguer vers ce canal à partir de l'incorporation. Cela nécessite souvent de quitter l'incorporation et de rechercher manuellement le canal dans l'interface utilisateur de Zunivers. Pour améliorer l'expérience utilisateur et faciliter la navigation, il serait utile d'ajouter le canal au pied de page de l'incorporation, permettant aux utilisateurs de se TP directement vers le canal depuis l'incorporation.

Proposition de solution

Ajouter un lien ou un bouton cliquable au pied de page de l'incorporation, dirigé vers le canal correspondant. Cela permettrait aux utilisateurs de passer facilement de l'incorporation à la discussion en direct dans le canal concerné, améliorant ainsi la fluidité de l'expérience utilisateur.

Avantages

  • Rendre la navigation plus intuitive et pratique pour les utilisateurs de Zunivers.
  • Améliorer l'expérience utilisateur en permettant une transition fluide entre l'incorporation et le canal correspondant.

Réference

image

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.