예제 #1
0
 def options(self, rec, mic, text):
     '''
     Funció d'anàlisis i filtratge.
     '''
     if "hora" in text:
         Timeop().currentTime()
     elif "buenos días" in text:
         Calendarop().goodm()
     elif ("día" in text) and ("mañana" in text):
         Timeop().tomorrowDate()
     elif "día" in text:
         Timeop().currentDate()
     elif "alarma" in text:
         Timeop().alarm(text)
     elif "apuntar" in text:
         Calendarop().takeNote(text)
     elif "edad" in text:
         Fun().age()
     elif ("cero entre cero" or "cero dividido por cero") in text:
         Fun().cero()
     else:
         Ttos().error()
예제 #2
0
import discord
import asyncio
import os

#app_id = '519995591359594538'
TOKEN = os.environ["DISCORD_TOKEN"]
BOT_PREFIX = (".", "dad ")

client = Bot(command_prefix=BOT_PREFIX)

client.add_cog(Hashing(client))
client.add_cog(Encoding(client))
client.add_cog(Ciphers(client))
client.add_cog(Utilities(client))
client.add_cog(CTFs(client))
client.add_cog(Fun(client))


@client.event
async def on_ready():
    print("--------Logged in as " + client.user.name + "-----------")


@client.event
async def on_message(message):
    # print("Command received: " + str(message.content))
    await client.process_commands(message)


async def list_servers():
    await client.wait_until_ready()
pause()
print("OK, keep goin', guys! Back to business!")
j = input("\n>>> under_performer = weekly_project.find_last_one(): ")
if j == "10":
    pass
else:
    under_performer = weekly_project.find_last_one()

pause()
k = input("\n>>> bestperformer = weekly_project.find_most_clever(): ")
if k == "11":
    pass
else:
    best_performer = weekly_project.find_most_clever()

pause()
l = input("\n>>> foosball_tournament = Fun(codecool_bp.students): ")
print("\n")
if l == "12":
    pass
else:
    foosball_tournament = Fun(codecool_bp.students)
    team = foosball_tournament.select_teams()
    foosball_tournament.game(team)

pause()
m = input("And this is the end of the story...To be continued: ")
pause()
exit()
예제 #4
0
pause()
print("OK, keep goin', guys! Back to business!")
j = input("\n>>> under_performer = weekly_project.find_last_one(): ")
if j == "10":
    pass
else:
    under_performer = weekly_project.find_last_one()

pause()
k = input("\n>>> bestperformer = weekly_project.find_most_clever(): ")
if k == "11":
    pass
else:
    best_performer = weekly_project.find_most_clever()

pause()
l = input("\n>>> foosball_tournament = Fun(codecool_bp.students): ")
print("\n")
if l == "12":
    pass
else:
    foosball_tournament = Fun(codecool_bp.students)
    team = foosball_tournament.select_teams()
    foosball_tournament.game(team)

pause()
m = input("And this is the end of the story...To be continued: ")
pause()
exit()
"""
A simple 'bubble tea store locations' flask app.
"""
import flask
from flask.views import MethodView
from index import Index
from add import Add
from show import Show
from fun import Fun

app = flask.Flask(__name__)  # our Flask app
app.config['SECRET_KEY'] = '64322'

app.add_url_rule('/', view_func=Index.as_view('index'), methods=["GET"])

app.add_url_rule('/add/',
                 view_func=Add.as_view('add'),
                 methods=['GET', 'POST'])

app.add_url_rule('/show/', view_func=Show.as_view('show'), methods=["GET"])

app.add_url_rule('/fun/',
                 view_func=Fun.as_view('fun'),
                 methods=['GET', 'POST'])

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8000, debug=True)
예제 #6
0
from fun import Fun
from multiprocessing import Process, Queue
from flask import Flask, render_template, g, request
app = Flask(__name__)
q = Queue()
f = Fun()
p = Process(target=f._run, args=(q, ))
p.start()


@app.route('/')
def index():
    def prettify(string):
        str_arr = list(string)
        need_cap = True
        for index, letter in enumerate(str_arr[:]):
            if letter == "_":
                str_arr[index] = " "
                need_cap = True
            elif need_cap:
                str_arr[index] = letter.upper()
                need_cap = False
        return ''.join(str_arr)

    patterns = [prettify(func) for func in dir(f) if not func.startswith('_')]
    patterns.sort()
    patterns.remove('Off')
    patterns.remove('Client')
    patterns.append('Off')
    g.buttons = patterns
    return render_template('index.html')
예제 #7
0
from fun import Fun

print(Fun().fun_1())

예제 #8
0
bot = commands.Bot(command_prefix=commands.when_mentioned_or("n!"),
                   description="Ohaiyooooo! Need my help? (๑˃ᴗ˂)ﻭ")


@bot.event
async def on_ready():
    print('Logged in as {0} ({0.id})'.format(bot.user))
    print('------')


# Add Cog for bot's commands here
bot.add_cog(Music(bot))
bot.add_cog(RNG(bot))
bot.add_cog(Meme(bot))
bot.add_cog(Wolfram(bot))
bot.add_cog(Fun(bot))
bot.add_cog(Steam(bot))


# Helper function for logging
async def update_stats():
    globals.initialize()
    await bot.wait_until_ready()

    while not bot.is_closed():
        try:
            if globals.err:
                with open("log/stats.txt", "a") as f:
                    f.write(
                        f"Time: {int(time.time())}, Command: {globals.last_cmd}, Error message: {globals.err_msg}\n"
                    )