Git Product home page Git Product logo

matebot's Introduction

proyecto matebot en frontendcafe

La estructura que he realizado

  • [+] kamerr.py Archivo principal
  • [+] cogs | comandos
    • [-] FAQ los comandos que tiene relacion con FAQ
    • [-] Greeting un evento de bienvenida y el comando de saludar

Archivo Principal

En este archivo lo que hace son inicamente las peticiones y usando la extension discord.ext para simplicar muchas cosas.

aun que no logro saber si puedo cambiar algunas opciones de respuesta automaticas, o hacerlas desde cero.

la estructura es mucho mas limpia y ordenada

Estructura COGs

Por lo que entendido seria un command handler o una forma de estructurar y ordenar los comandos por clases y tener una mejor estructura

esta informacion se encuentra en la documentacion

Estructura

import discord # el modulo
from discord.ext import commands # La extencion

# La clase donde se menteran los comandos, como categoria
class Greetings(commands.Cog):
    def __init__(self, client):
        self.client = client

    ## este es un evento que se activa cuando un usuario ingresa al servidor
    ## Puede ser opcional
    @commands.Cog.listener()
    async def on_member_join(self, member):
        channel = member.guild.system_channel
        if channel is not None:
            await channel.send('Welcome {0.mention}.'.format(member))

    # Obviamente el comando
    @commands.command()
    async def hello(self, ctx,):
        await ctx.send("Hola")


# A qui le decimos que lo cargue
def setup(client):
    client.add_cog(Greetings(client))

matebot's People

Contributors

kamerrezz avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  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.