Python При нажатии на кнопку PushButton (QtPy6) выполняется только одна функция

При нажатии на pushbutton получается обрабатывается только 1 функция, нужно что бы и работала вторая

from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
    QMetaObject, QObject, QPoint, QRect,
    QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
    QFont, QFontDatabase, QGradient, QIcon,
    QImage, QKeySequence, QLinearGradient, QPainter,
    QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QFrame, QLabel, QLineEdit,
    QMainWindow, QPushButton, QSizePolicy, QWidget)
import Hello_rc
import sys
from random import choice
import requests as r
import time
from design2 import Ui_MainWindow

class Discordbot(QMainWindow):
    def __init__(self):
        super(Discordbot, self).__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.pushButton_4.clicked.connect(self.bot1)
        self.ui.pushButton_4.clicked.connect(self.bot)

    def bot(self):
        s = r.Session()
        s.headers['authorization'] = str(self.ui.lineEdit.text())
        msg_set: list = open('msg.txt', 'r', encoding='utf-8').read().splitlines()
        chat_id = str(self.ui.lineEdit_2.text())
        delay = int(self.ui.lineEdit_3.text())
        total_sent = 0


        while True:
            try:
                for msg in msg_set:
                    print(f'Sending message {msg}')
                    _data = {'content': msg, 'tts': False}
                    resp = s.post(
                        f'https://discord.com/api/v9/channels/{chat_id}/messages', json=_data).json()
                    msg_id = resp['id']
                    total_sent += 1
                    print(f'Message sent (Already {total_sent} in total).')
                    print(f'Sleeping {delay} seconds')
                    time.sleep(delay)
            except Exception as e:
                print(f'Some error: {e}')
                time.sleep(20)

    def bot1(self):
        s = r.Session()
        s.headers['authorization'] = str(self.ui.lineEdit_4.text())
        msg1_set: list = open('msg1.txt', 'r', encoding='utf-8').read().splitlines()
        chat_id = str(self.ui.lineEdit_2.text())
        delay = int(self.ui.lineEdit_3.text())
        total_sent = 0


        while True:
            try:
                for msg1 in msg1_set:
                    print(f'Sending message {msg1}')
                    _data = {'content': msg1, 'tts': False}
                    resp = s.post(
                        f'https://discord.com/api/v9/channels/{chat_id}/messages', json=_data).json()
                    msg1_id = resp['id']
                    total_sent += 1
                    print(f'Message sent (Already {total_sent} in total).')
                    print(f'Sleeping {delay} seconds')
                    time.sleep(delay)
            except Exception as e:
                print(f'Some error: {e}')
                time.sleep(20)

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = Discordbot()
    window.show()
    sys.exit(app.exec())

Ответы (0 шт):