Example #1
0
async def on_ready():
    print(" ")
    print(Fore.CYAN + "===================================" + Style.RESET_ALL)
    print(Fore.CYAN + '|' + Style.RESET_ALL +
          f' Смена статуса на стандартный... ' + Fore.CYAN + '|' +
          Style.RESET_ALL)
    await client.change_presence(activity=discord.Game(name=STATUS))
    print(Fore.CYAN + '|' + Style.RESET_ALL +
          f'        Бот активирован!         ' + Fore.CYAN + '|' +
          Style.RESET_ALL)
    print(Fore.CYAN + "===================================" + Style.RESET_ALL)
    print(f'  Статус   - {STATUS}          ')
    print(f'  Имя бота - {client.user.name}')
    print(f'  ID бота  - {client.user.id}  ')
    print(Fore.CYAN + "===================================" + Style.RESET_ALL)
    print(" ")

    loop = Loop(client)
    try:
        loop.activator()
    except AssertionError:
        pass
Example #2
0
def test_index():
    l = Loop(range(9))
    for x in l(3):
        print l.index, l.count, l.isfirst(), l.islast(), l.iseven(), x
    print l.isempty()
Example #3
0
def test_empty():
    l = Loop(range(0))
    for x in l():
        pass
    eq_(l.isempty(), True)