background = Editor(Canvas((1024, 750), color = '#2F3136'))
# Avatar
profile_picture = await load_image_async(str(inter.author.avatar))
profile = Editor(profile_picture).resize((240, 240)).circle_image()
background.paste(profile, (750, 30))
# Ticket for nickname
poppins = Font.poppins(size = 60)
background.text((20, 40), text = f'Тикет от {inter.author}', font = poppins, color = '#FFFFFF')
file = disnake.File(fp = background.image_bytes, filename = 'ticket.png')
await inter.response.send_message(file = file, ephemeral = True)
row = self.collticku.find_one({'_id': guild.id})
if not row or not ('channel_id' in row):
return
else:
channel_id = guild.get_channel(row.get('channel_id'))
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Users\Egor\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "F:\IT\Discord bot\Гл. Проекты\Ticku\cogs\ticket.py", line 47, in on_ready
msg1 = await channel_id.send(embed = emb1, components = [buttons1])
AttributeError: 'NoneType' object has no attribute 'send'
row = self.collticku.find_one({'_id': guild.id})
if not row or not ('channel_id' in row):
return
else:
channel_id = guild.get_channel(row.get('channel_id'))
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Users\Egor\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "F:\IT\Discord bot\Гл. Проекты\Ticku\cogs\ticket.py", line 47, in on_ready
msg1 = await channel_id.send(embed = emb1, components = [buttons1])
AttributeError: 'NoneType' object has no attribute 'send'
import sys
from PySide6.QtWidgets import QApplication, QMainWindow
from PySide6.QtGui import QFontDatabase
from design import Ui_MainWindow
class Calculator(QMainWindow):
def __init__(self):
super(Calculator, self).__init__()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
QFontDatabase.addApplicationFont('fonts/Rubik-Regular.ttf')
self.ui.pushButton_8.clicked.connect(lambda: self.add_digit('0'))
self.ui.pushButton_5.clicked.connect(lambda: self.add_digit('1'))
self.ui.pushButton_11.clicked.connect(lambda: self.add_digit('2'))
self.ui.pushButton_12.clicked.connect(lambda: self.add_digit('3'))
self.ui.pushButton_6.clicked.connect(lambda: self.add_digit('4'))
self.ui.pushButton_13.clicked.connect(lambda: self.add_digit('5'))
self.ui.pushButton_14.clicked.connect(lambda: self.add_digit('6'))
self.ui.pushButton_2.clicked.connect(lambda: self.add_digit('7'))
self.ui.pushButton_15.clicked.connect(lambda: self.add_digit('8'))
self.ui.pushButton_16.clicked.connect(lambda: self.add_digit('9'))
def add_digit(self, btn_text: str) -> None:
if self.ui.le_entry.text() == '0':
self.ui.le_entry.setText(btn_text)
else:
self.ui.le_entry.setText(self.ui.le_entry.text() + btn_text())
if __name__ == '__main__':
app = QApplication(sys.argv)
window = Calculator()
window.show()
sys.exit(app.exec())
Traceback (most recent call last):
File "f:\IT\Python\Python lessons\Other\Easy Calculator\calc_gui.py", line 19, in <lambda>
self.ui.pushButton_13.clicked.connect(lambda: self.add_digit('5'))
File "f:\IT\Python\Python lessons\Other\Easy Calculator\calc_gui.py", line 26, in add_digit
if self.ui.le_entry.text() == '0':
AttributeError: 'Ui_MainWindow' object has no attribute 'le_entry'