Esempio n. 1
0

if __name__ == "__main__":
    load_dotenv()
    config_log()

    intents = discord.Intents.default()
    intents.members = True

    # Importo las variables de entorno
    PREFIX = os.getenv("DISCORD_PREFIX")
    TOKEN = os.getenv("DISCORD_TOKEN")

    if TOKEN is None:
        log.info("Token not found ...")
        sys.exit(0)

    bot = commands.Bot(command_prefix=commands.when_mentioned_or(PREFIX),
                       description="Relatively simple music bot example",
                       help_command=None,
                       intents=intents)

    # Lista de módulos activa
    bot.add_cog(modules.Help(bot))
    bot.add_cog(modules.Welcome(bot))
    bot.add_cog(modules.Events(bot))
    bot.add_cog(modules.Scheduler(bot))

    log.info("Bot started ...")
    bot.run(TOKEN)
Esempio n. 2
0
File: bot.py Progetto: AAgar/Yalebot
    "quote": modules.Quote(),
    "dog": modules.Dog(),
    "funfact": modules.FunFact(),
    "funny": modules.Funny(),
    "kelbo": modules.Kelbo(),
    "boink": modules.Boink(),
    "ship": modules.Ship(),
    "hema": modules.Hema(),
    "victor": modules.Victor(),
    "truman": modules.Truman(),
    "nato": modules.NATO(),
    "tiya": modules.Tiya(),
    "crist": modules.Crist(),
}
system_responses = {
    "welcome": modules.Welcome(),
    "mourn": modules.Mourn(),
}

F_PATTERN = re.compile("can i get an? (.+) in the chat",
                       flags=re.IGNORECASE | re.MULTILINE)


@app.route("/", methods=["POST"])
def webhook():
    """
    Receive callback to URL when message is sent in the group.
    """
    # Retrieve data on that single GroupMe message.
    message = request.get_json()
    group_id = message["group_id"]