示例#1
0
 def modify_account(self):
     """
     Modify function to modify an object of Account class
     """
     modify_account_list = ['1. Modify Maximum Transaction Amount']
     for i in modify_account_list:
         print('\t' + i)
     print()
     ch = input('Command: ')
     if ch == '1':
         while True:
             try:
                 self.max_transaction_amount = int(
                     input('New Maximum Transaction Amount: '))
                 break
             except ValueError:
                 print('\nInvalid Value\n')
         global_transactions.append(
             Transaction(
                 self.customer.customer_id, self.account_number,
                 get_current_date(), get_current_time(),
                 self.get_branch_code(), 0, self.balance, self.balance,
                 'Maximum Transaction Amount modified successfully!'))
         send_message(
             f'Greetings from Bank XXX!\nYour Customer ID {self.customer.customer_id}\nYour Account Number '
             f'{self.account_number}.\nYour account has been modified successfully.',
             self.customer.phone_number)
示例#2
0
 def withdraw(self, amount):
     """
     Withdraw function to withdraw money from account
     """
     if int(amount) <= 0:
         # Validation rule: Amount is negative
         print(
             'Invalid amount. Please enter positive values.\nTransaction aborted!'
         )
     elif int(amount) > self.max_transaction_amount:
         # Validation rule: Amount is more than maximum set by the customer
         print(
             'Amount entered is more than the maximum.\nTransaction aborted!'
         )
     elif int(amount) > self.balance:
         # Validation rule: Amount is more than current balance
         print('Amount entered is more than balance.\nTransaction aborted!')
     else:
         self.balance -= int(amount)
         # Add withdrawal transaction to transactions log
         global_transactions.append(
             Transaction(self.customer.customer_id, self.account_number,
                         get_current_date(), get_current_time(),
                         self.get_branch_code(), amount,
                         str(int(self.balance) + int(amount)),
                         str(self.balance),
                         f'{str(amount)} withdrawn successfully!'))
         send_message(
             f'Greetings from Bank XXX!\nYour Customer ID {self.customer.customer_id}.\nYou have withdrawn '
             f'{str(amount)} from Account #{self.account_number}\nClosing Balance: INR{self.balance}',
             self.customer.phone_number)
示例#3
0
def main(server, port):
    print "Enter your name"
    myname = raw_input()
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((server, port))
    msg = utility.message(myname, myname, ['server'])
    utility.send_message(s, msg)
    thread1 = threading.Thread(target=input_listener, args=[s, myname])
    thread2 = threading.Thread(target=server_listner, args=[s])
    thread3 = threading.Thread(target=msg_dispatcher, args=[s])
    thread1.start()
    thread2.start()
    thread3.start()
示例#4
0
 def delete_customer(self):
     """
     Delete function to delete an object of Customer class
     """
     # Add deletion of customer to transactions log
     global_transactions.append(
         Transaction(self.customer_id, 'NA', get_current_date(),
                     get_current_time(), 'NA', 'NA', 'NA', 'NA',
                     f'Customer {self.customer_id} deleted successfully!'))
     # Delete individual accounts
     for i in self.active_accounts:
         self.active_accounts[i].delete_account(False)
     self.active_accounts.clear()
     print('Customer deleted successfully!')
     send_message(
         f'Greetings from Bank XXX!\nYour Customer ID {self.customer_id} has been deleted.\nSorry to see you go!',
         self.phone_number)
示例#5
0
 def input_customer(self):
     """
     Input function to take values from the user and assign it to an object of Customer class
     """
     self.first_name = input('First Name: ')
     self.last_name = input('Last Name: ')
     self.address.input_address()
     while True:
         self.phone_number = input(
             'Phone Number (+<Country Code><Phone Number>): ')
         if validate_phone(self.phone_number):
             otp = generate_otp(self.phone_number)
             flag = False
             while not flag:
                 otp_input = input(f'OTP sent on {self.phone_number}: ')
                 if str(otp_input) == str(otp):
                     flag = True
             if flag:
                 break
         else:
             print(
                 '\nInvalid Phone Number. Phone Numbers should follow +<Country Code><Phone Number>\n'
             )
     while True:
         self.email = input('Email: ')
         if validate_email(self.email):
             break
         else:
             print('\nInvalid Email ID\n')
     self.customer_id = utility.global_customer_id
     utility.global_customer_id = str(int(utility.global_customer_id) + 1)
     utility.global_customer_id = '0' * (
         4 - len(utility.global_customer_id)) + utility.global_customer_id
     global_customer_map[self.customer_id] = self
     # Add creation of customer to transactions log
     global_transactions.append(
         Transaction(self.customer_id, 'NA', get_current_date(),
                     get_current_time(), 'NA', 'NA', 'NA', 'NA',
                     f'Customer {self.customer_id} created successfully!'))
     print(
         f'Customer created successfully! Customer ID: {self.customer_id}')
     send_message(
         f'Greetings from Bank XXX!\nWelcome {self.first_name} {self.last_name}!\nYour Customer ID '
         f'{self.customer_id}.', self.phone_number)
示例#6
0
 def delete_account(self, pop_from_list):
     """
     Delete function to delete an object of Account class
     """
     # Add deletion of account to transactions log
     global_transactions.append(
         Transaction(
             self.customer.customer_id, self.account_number,
             get_current_date(), get_current_time(), self.get_branch_code(),
             'NA', self.balance, 0,
             f'Account {self.account_number} deleted successfully!'))
     self.customer.active_accounts_number -= 1
     if pop_from_list:
         self.customer.active_accounts.pop(self.account_number)
     print(
         f'Account {str(self.account_number)} deleted successfully! Closing Balance: INR{str(self.balance)}'
     )
     send_message(
         f'Greetings from Bank XXX!\nYour Customer ID {self.customer.customer_id}\nYour Account Number '
         f'{self.account_number}.\nYour account has been deleted successfully.',
         self.customer.phone_number)
示例#7
0
def dungeonmaster(channel):
    users_by_xp = db(opt.USERS).find(sort=[('total_experience', -1)])
    while True:
        top_user = users_by_xp.next()
        tags = db(opt.TAGS).find_one_by_id(top_user['_id'])
        if not tags or not tags.get('bot'):
            break
    if top_user and top_user.get('user_level'):
        highest_experience = top_user['total_experience']
        user_level = top_user['user_level']
        number_of_top_users = db(opt.USERS).count_documents(
            {'total_experience': highest_experience})
        if number_of_top_users == 1:
            top_user = db(opt.USERS).find_one(
                {'total_experience': highest_experience})
            util.send_message(
                messages.dungeon_master(top_user['username'], str(user_level),
                                        str(highest_experience)), channel)
        else:
            util.send_message(
                messages.dungeon_masters(str(number_of_top_users),
                                         str(user_level),
                                         str(highest_experience)), channel)
    else:
        util.send_message(messages.dungeon_no_master, channel)
示例#8
0
def dungeonstats(channel):
    general = db(opt.GENERAL).find_one_by_id(0)
    try:
        dungeons = general['total_dungeons']
    except:
        dungeons = 0
    try:
        wins = general['total_wins']
    except:
        wins = 0
    try:
        losses = general['total_losses']
    except:
        losses = 0
    if dungeons == 1:
        dungeonword = ' Dungeon'
    else:
        dungeonword = ' Dungeons'
    if wins == 1:
        winword = ' Win'
    else:
        winword = ' Wins'
    if losses == 1:
        loseword = ' Loss'
    else:
        loseword = ' Losses'
    if dungeons != 0:
        util.send_message(
            messages.dungeon_general_stats(
                str(dungeons), dungeonword, str(wins), winword,
                str(losses), loseword,
                str(round((((wins) / (dungeons)) * 100), 3))), channel)
    else:
        util.send_message(
            messages.dungeon_general_stats(str(dungeons),
                                           dungeonword, str(wins), winword,
                                           str(losses), loseword, '0'),
            channel)
示例#9
0
def register(user, display_name, channel):
    registered = db(opt.USERS).find_one_by_id(user)
    if not registered or not registered.get('user_level'):
        db(opt.GENERAL).update_one(0, {'$inc': {'dungeon_level': 1}})
        db(opt.USERS).update_one(user, {'$set': schemes.USER}, upsert=True)
        dungeon = db(opt.GENERAL).find_one_by_id(0)
        util.queue_message_to_one(
            messages.user_register(display_name,
                                   str(dungeon['dungeon_level'])), channel)
    else:
        try:
            user_cmd_use_time = db(
                opt.USERS).find_one_by_id(user)['cmd_use_time']
        except:
            user_cmd_use_time = 0
        user_cooldown = db(opt.CHANNELS).find_one({'name':
                                                   channel})['user_cooldown']
        global_cmd_use_time = db(opt.CHANNELS).find_one({'name': channel
                                                         })['cmd_use_time']
        global_cooldown = db(opt.CHANNELS).find_one({'name': channel
                                                     })['global_cooldown']
        message_queued = db(opt.CHANNELS).find_one({'name':
                                                    channel})['message_queued']
        if time.time() > global_cmd_use_time + global_cooldown and time.time(
        ) > user_cmd_use_time + user_cooldown and message_queued == 0:
            db(opt.CHANNELS).update_one_by_name(
                channel, {'$set': {
                    'cmd_use_time': time.time()
                }}, upsert=True)
            db(opt.USERS).update_one(user,
                                     {'$set': {
                                         'cmd_use_time': time.time()
                                     }},
                                     upsert=True)
            util.send_message(messages.user_already_registered(display_name),
                              channel)
示例#10
0
def raidstats(channel):
    general = db(opt.GENERAL).find_one_by_id(0)
    try:
        raids = general['total_raids']
    except:
        raids = 0
    try:
        wins = general['total_raid_wins']
    except:
        wins = 0
    try:
        losses = general['total_raid_losses']
    except:
        losses = 0
    if raids == 1:
        raidword = ' Raid'
    else:
        raidword = ' Raids'
    if wins == 1:
        winword = ' Win'
    else:
        winword = ' Wins'
    if losses == 1:
        loseword = ' Loss'
    else:
        loseword = ' Losses'
    if raids != 0:
        util.send_message(
            messages.raid_general_stats(
                str(raids), raidword, str(wins), winword, str(losses),
                loseword, str(round((((wins) / (raids)) * 100), 3))), channel)
    else:
        util.send_message(
            messages.raid_general_stats(str(raids),
                                        raidword, str(wins), winword,
                                        str(losses), loseword, '0'), channel)
示例#11
0
def leaderboard(channel):
    util.send_message(messages.leaderboard, channel)
示例#12
0
def ping(channel):
    uptime = int(time.time() - bot_start)
    util.send_message(messages.ping(str(datetime.timedelta(seconds=uptime))),
                      channel)
示例#13
0
def dungeonlvl(channel):
    dungeon = db(opt.GENERAL).find_one_by_id(0)
    util.send_message(messages.dungeon_level(str(dungeon['dungeon_level'])),
                      channel)
示例#14
0
 def send_message(self, message):
     u.send_message(self.socket, message)
示例#15
0
def winrate(user, display_name, channel, message=None):
    if not message:
        tags = db(opt.TAGS).find_one_by_id(user)
        if tags and tags.get('bot') == 1:
            util.send_message(messages.user_bot_message(display_name), channel)
        else:
            user = db(opt.USERS).find_one_by_id(user)
            if user and user.get('user_level'):
                if user['dungeons'] == 0:
                    util.send_message(
                        messages.no_entered_dungeons(display_name), channel)
                else:
                    dungeons = user['dungeons']
                    wins = user['dungeon_wins']
                    losses = user['dungeon_losses']

                    if wins == 1:
                        win_word = ' Win'
                    else:
                        win_word = ' Wins'
                    if losses == 1:
                        lose_word = ' Loss'
                    else:
                        lose_word = ' Losses'
                    util.send_message(
                        messages.user_stats(
                            display_name, str(wins), win_word, str(losses),
                            lose_word,
                            str(round((((wins) / (dungeons)) * 100), 3))),
                        channel)
            else:
                util.send_message(messages.not_registered(display_name),
                                  channel)
    else:
        target = db(opt.USERS).find_one({
            'username':
            re.compile('^' + re.escape(message) + '$', re.IGNORECASE)
        })
        if target and target.get('user_level'):
            tags = db(opt.TAGS).find_one_by_id(target)
            if tags and tags.get('bot') == 1:
                util.send_message(
                    messages.user_bot_message(target['username']), channel)
            else:
                same_user = None
                if user == target['_id']:
                    same_user = True
                if target['dungeons'] == 0:
                    if same_user:
                        util.send_message(
                            messages.no_entered_dungeons(display_name),
                            channel)
                    else:
                        util.send_message(
                            messages.user_no_entered_dungeons(display_name),
                            channel)
                else:
                    dungeons = target['dungeons']
                    wins = target['dungeon_wins']
                    losses = target['dungeon_losses']
                    if wins == 1:
                        win_word = ' Win'
                    else:
                        win_word = ' Wins'
                    if losses == 1:
                        lose_word = ' Loss'
                    else:
                        lose_word = ' Losses'
                    util.send_message(
                        messages.user_stats(
                            target['username'], str(wins), win_word,
                            str(losses), lose_word,
                            str(round((((wins) / (dungeons)) * 100), 3))),
                        channel)
        else:
            util.send_message(messages.user_not_registered(display_name),
                              channel)
示例#16
0
def msg_dispatcher(socket):
    while True:
        if not message_queue.isEmpty():
            message = message_queue.pop()
            utility.send_message(socket, message)
示例#17
0
 def modify_customer(self):
     """
     Modify function to modify an object of Customer class
     """
     modify_customer_list = [
         '1. First Name', '2. Last Name', '3. Address', '4. Phone Number',
         '5. Email'
     ]
     print('\n\tWhich parameter do you want to modify?')
     for i in modify_customer_list:
         print('\t' + i)
     print()
     ch = input('Command: ')
     if ch == '1':
         self.first_name = input('New First Name: ')
         global_transactions.append(
             Transaction(self.customer_id, 'NA', get_current_date(),
                         get_current_time(), 'NA', 'NA', 'NA', 'NA',
                         'First name modified successfully!'))
         send_message(
             f'Greetings from Bank XXX!\nYour Customer ID {self.customer_id}.\nYour account has been modified '
             f'successfully.', self.phone_number)
     elif ch == '2':
         self.last_name = input('New Last Name: ')
         global_transactions.append(
             Transaction(self.customer_id, 'NA', get_current_date(),
                         get_current_time(), 'NA', 'NA', 'NA', 'NA',
                         'Last name modified successfully!'))
         send_message(
             f'Greetings from Bank XXX!\nYour Customer ID {self.customer_id}.\nYour account has been modified '
             f'successfully.', self.phone_number)
     elif ch == '3':
         self.address.modify_address()
         global_transactions.append(
             Transaction(self.customer_id, 'NA', get_current_date(),
                         get_current_time(), 'NA', 'NA', 'NA', 'NA',
                         'Address modified successfully!'))
         send_message(
             f'Greetings from Bank XXX!\nYour Customer ID {self.customer_id}.\nYour account has been modified '
             f'successfully.', self.phone_number)
     elif ch == '4':
         while True:
             self.phone_number = input(
                 'New Phone Number (+<Country Code><Phone Number>): ')
             if validate_phone(self.phone_number):
                 otp = generate_otp(self.phone_number)
                 flag = False
                 while not flag:
                     otp_input = input(f'OTP sent on {self.phone_number}: ')
                     if str(otp_input) == str(otp):
                         flag = True
                 if flag:
                     break
             else:
                 print(
                     '\nInvalid Phone Number. Phone Numbers should follow +<Country Code><Phone Number>\n'
                 )
         global_transactions.append(
             Transaction(self.customer_id, 'NA', get_current_date(),
                         get_current_time(), 'NA', 'NA', 'NA', 'NA',
                         'Phone number modified successfully!'))
         send_message(
             f'Greetings from Bank XXX!\nYour Customer ID {self.customer_id}.\nYour account has been modified '
             f'successfully.', self.phone_number)
     elif ch == '5':
         while True:
             self.email = input('Email: ')
             if validate_email(self.email):
                 break
             else:
                 print('\nInvalid Email ID\n')
         global_transactions.append(
             Transaction(self.customer_id, 'NA', get_current_date(),
                         get_current_time(), 'NA', 'NA', 'NA', 'NA',
                         'Email modified successfully!'))
         send_message(
             f'Greetings from Bank XXX!\nYour Customer ID {self.customer_id}.\nYour account has been modified '
             f'successfully.', self.phone_number)
     else:
         print('Invalid entry!')
示例#18
0
def channels(channel):
    util.send_message(messages.channels, channel)
示例#19
0
 def input_account(self):
     """
     Input function to take values from the user and assign it to an object of Account class
     """
     while True:
         ch = input('Existing customer? (Y/N): ')
         # For existing customers, adds a new account to the customer.active_accounts dictionary
         if ch.upper() == 'Y':
             existing_customer_id = input('Existing Customer ID: ')
             if existing_customer_id in global_customer_map:
                 print(
                     f'Customer found. Adding account to customer ID #{existing_customer_id}'
                 )
                 self.customer = global_customer_map[existing_customer_id]
                 self.customer.active_accounts_number += 1
                 break
             else:
                 print(
                     'Customer ID does not exist. Recheck ID or register as a new customer.'
                 )
         elif ch.upper() == 'N':
             # For new customers, creates a new customer then adds a new account to the customer.active_accounts
             # dictionary
             self.customer = Customer(
                 '', '', Address('', '', '', '', '', '', '', ''), '', '', 0,
                 '', {})
             self.customer.input_customer()
             self.customer.active_accounts_number += 1
             break
     while True:
         try:
             self.max_transaction_amount = int(
                 input('Maximum Transaction Amount: '))
             break
         except ValueError:
             print('\nInvalid Value\n')
     while True:
         try:
             self.balance = int(input('Initial Balance: '))
             break
         except ValueError:
             print('\nInvalid Value\n')
     while True:
         branch_code = input('Branch Code: ')
         if branch_code in global_branches:
             break
         else:
             print('\nInvalid Branch Code\n')
     self.account_number = str(self.customer.customer_id + branch_code +
                               str("%02d" %
                                   self.customer.active_accounts_number))
     self.customer.active_accounts[self.account_number] = self
     print(
         f'Account created successfully! Account ID: {self.account_number}')
     # Add creation of account to transactions log
     global_transactions.append(
         Transaction(
             self.customer.customer_id, self.account_number,
             get_current_date(), get_current_time(), self.get_branch_code(),
             'NA', 0, self.balance,
             f'Account {self.account_number} created successfully!'))
     send_message(
         f'Greetings from Bank XXX!\nYour Customer ID {self.customer.customer_id}\nYour Account Number '
         f'{self.account_number}.\nBalance INR{self.balance}\nYour account has been created successfully.',
         self.customer.phone_number)
示例#20
0
def lvl(user, display_name, channel, message=None):
    if not message:
        tags = db(opt.TAGS).find_one_by_id(user)
        if tags and tags.get('bot') == 1:
            util.send_message(messages.user_bot_message(display_name), channel)
        else:
            user = db(opt.USERS).find_one_by_id(user)
            if user and user.get('user_level'):
                util.send_message(
                    messages.user_level(
                        display_name, str(user['user_level']),
                        str(user['current_experience']),
                        str((((user['user_level']) + 1)**2) * 10)), channel)
            else:
                util.send_message(messages.not_registered(display_name),
                                  channel)
    else:
        target = db(opt.USERS).find_one({
            'username':
            re.compile('^' + re.escape(message) + '$', re.IGNORECASE)
        })
        if target and target.get('user_level'):
            tags = db(opt.TAGS).find_one_by_id(target['_id'])
            if tags and tags.get('bot') == 1:
                util.send_message(
                    messages.user_bot_message(target['username']), channel)
            else:
                util.send_message(
                    messages.user_level(
                        target['username'], str(target['user_level']),
                        str(target['current_experience']),
                        str((((target['user_level']) + 1)**2) * 10)), channel)
        else:
            util.send_message(messages.user_not_registered(display_name),
                              channel)
示例#21
0
def commands(channel):
    util.send_message(messages.commands, channel)
示例#22
0
def enterdungeon(user_id, display_name, channel):
    user = db(opt.USERS).find_one_by_id(user_id)
    if user and user.get('user_level'):
        enter_time = time.time()
        if int(user['next_entry'] - enter_time) <= 0:
            dungeon = db(opt.GENERAL).find_one_by_id(0)
            dungeon_level = dungeon['dungeon_level']
            user_level = user['user_level']

            if user_level > dungeon_level:
                level_run = dungeon_level
                success_rate = 65 + ((user_level - dungeon_level) * 7)
                success_rate = success_rate if success_rate <= 100 else 100
                experience_gain = int(60 * dungeon_level) * (1 - (
                    (user_level - dungeon_level)) * 0.2)
                experience_gain = experience_gain if experience_gain >= 0 else 0
                dungeon_timeout = 3600
            else:
                level_run = user_level
                success_rate = 65
                experience_gain = int(60 * user_level)
                dungeon_timeout = 3600

            if experience_gain == 0:
                util.send_message(
                    messages.dungeon_too_low_level(display_name,
                                                   str(dungeon_level)),
                    channel)
                return

            dungeon_success = random.randint(1, 101)
            db(opt.USERS).update_one(
                user['_id'], {
                    '$set': {
                        'last_entry': enter_time,
                        'next_entry': enter_time + dungeon_timeout
                    }
                })

            if dungeon_success <= success_rate:
                run_quality = random.randint(1, 101)
                if run_quality <= 10:
                    experience_gain = int(experience_gain * 0.5)
                    try:
                        message = emoji.emojize(
                            list(
                                db(opt.TEXT).get_random_documents_by_match(
                                    {'mode': 'vbr'}, 1))[0]['text'])
                    except:
                        message = 'Very Bad Run'
                    util.send_message(
                        messages.dungeon_very_bad_run(display_name, message,
                                                      str(experience_gain)),
                        channel)
                elif run_quality >= 90:
                    experience_gain = int(experience_gain * 1.5)
                    try:
                        message = emoji.emojize(
                            list(
                                db(opt.TEXT).get_random_documents_by_match(
                                    {'mode': 'vgr'}, 1))[0]['text'])
                    except:
                        message = 'Very Good Run'
                    util.send_message(
                        messages.dungeon_very_good_run(display_name, message,
                                                       str(experience_gain)),
                        channel)
                else:
                    run_quality = random.randint(75, 126)
                    experience_gain = int(experience_gain * run_quality * 0.01)
                    if run_quality < 100:
                        try:
                            message = emoji.emojize(
                                list(
                                    db(opt.TEXT).get_random_documents_by_match(
                                        {'mode': 'br'}, 1))[0]['text'])
                        except:
                            message = 'Bad Run'
                        util.send_message(
                            messages.dungeon_bad_run(display_name, message,
                                                     str(experience_gain)),
                            channel)
                    else:
                        try:
                            message = emoji.emojize(
                                list(
                                    db(opt.TEXT).get_random_documents_by_match(
                                        {'mode': 'gr'}, 1))[0]['text'])
                        except:
                            message = 'Good Run'
                        util.send_message(
                            messages.dungeon_good_run(display_name, message,
                                                      str(experience_gain)),
                            channel)
                db(opt.USERS).update_one(
                    user['_id'], {
                        '$inc': {
                            'total_experience': experience_gain,
                            'current_experience': experience_gain,
                            'dungeon_wins': 1
                        }
                    })
                db(opt.GENERAL).update_one(0, {
                    '$inc': {
                        'total_experience': experience_gain,
                        'total_wins': 1
                    }
                })
                user_experience = user['current_experience'] + experience_gain
                if (((user_level + 1)**2) * 10) - user_experience <= 0:
                    db(opt.USERS).update_one(
                        user['_id'], {
                            '$inc': {
                                'user_level':
                                1,
                                'current_experience':
                                -(((user['user_level'] + 1)**2) * 10)
                            }
                        })
                    level_up_thread = threading.Thread(
                        target=util.queue_message_to_one,
                        args=(messages.user_level_up(
                            display_name,
                            str(user['user_level'] + 1)), channel))
                    level_up_thread.start()
            else:
                db(opt.USERS).update_one(user['_id'],
                                         {'$inc': {
                                             'dungeon_losses': 1
                                         }})
                db(opt.GENERAL).update_one(0, {'$inc': {'total_losses': 1}})
                try:
                    message = emoji.emojize(
                        list(
                            db(opt.TEXT).get_random_documents_by_match(
                                {'mode': 'fail'}, 1))[0]['text'])
                except:
                    message = 'Failed Run'
                util.send_message(
                    messages.dungeon_failed(display_name, message), channel)
            db(opt.USERS).update_one(user['_id'], {'$inc': {'dungeons': 1}})
            db(opt.GENERAL).update_one(0, {'$inc': {'total_dungeons': 1}})
        else:
            util.send_message(
                messages.dungeon_already_entered(
                    display_name,
                    str(
                        datetime.timedelta(
                            seconds=(int(user['next_entry']) -
                                     enter_time))).split('.')[0]), channel)
    else:
        util.send_message(messages.not_registered(display_name), channel)
示例#23
0
 def deliver_unsend_messages(self):
     q = pending_messages[self.name]
     while not q.isEmpty():
         message = q.pop()
         u.send_message(self.socket, message)