Ejemplo n.º 1
0
def main():
    load_dotenv()
    token = os.getenv('DISCORD_TOKEN')
    
    bot = commands.Bot(command_prefix='!')

    bot.add_cog(Persistence(bot))
    bot.add_cog(Clan(bot))
    bot.add_cog(Verification(bot))
    bot.add_cog(Log(bot))

    bot.run(token)
Ejemplo n.º 2
0
def cog(bot):
    cog = Verification.Verification(bot, db_manager)
    bot.add_cog(cog)
    dpytest.configure(bot)
    db_manager.db_execute_commit("DROP TABLE verified_emails")
    db_manager.db_execute_commit("DROP TABLE non_verified_emails")
    db_manager.db_execute_commit("DROP TABLE to_re_verify")
    db_manager.db_execute_commit("DROP TABLE roles")
    db_manager.db_execute_commit("CREATE TABLE verified_emails (u_id, email)")
    db_manager.db_execute_commit("CREATE TABLE non_verified_emails (u_id, email, token)")
    db_manager.db_execute_commit("CREATE TABLE to_re_verify (u_id, r_id)")
    db_manager.db_execute_commit("CREATE TABLE roles (s_id, r_id, email_suffix)")
    db_manager.insert_extension("Verify", 0, True, True)
    print("Tests starting")
    return cog
Ejemplo n.º 3
0
def setup_function():
    """ setup any state specific to the execution of the given module."""
    global cog
    bot = commands.Bot(command_prefix=KoalaBot.COMMAND_PREFIX)
    cog = Verification.Verification(bot, db_manager)
    bot.add_cog(cog)
    dpytest.configure(bot)
    db_manager.db_execute_commit("DROP TABLE verified_emails")
    db_manager.db_execute_commit("DROP TABLE non_verified_emails")
    db_manager.db_execute_commit("DROP TABLE to_re_verify")
    db_manager.db_execute_commit("DROP TABLE roles")
    db_manager.db_execute_commit("CREATE TABLE verified_emails (u_id, email)")
    db_manager.db_execute_commit("CREATE TABLE non_verified_emails (u_id, email, token)")
    db_manager.db_execute_commit("CREATE TABLE to_re_verify (u_id, r_id)")
    db_manager.db_execute_commit("CREATE TABLE roles (s_id, r_id, email_suffix)")
    db_manager.insert_extension("Verify", 0, True, True)
    print("Tests starting")