Answer the question
In order to leave comments, you need to log in
How to combine visual window with sending messages to Discord using a bot?
How to combine visual window with sending messages to Discord using a bot?
from PyQt5 import QtWidgets, uic
import pyautogui as pg
import time
import discord
from discord.ext import commands
from discord.ext import tasks
from discord import Embed
PREFIX = "m-"
Client = commands.Bot(command_prefix = PREFIX)
app = QtWidgets.QApplication([])
ui = uic.loadUi("main.ui")
ui.setWindowTitle("Serial Command GUI")
@Client.event
async def on_ready():
print("Load")
ui.ButEnter.clicked.connect(gg)
ui.show()
app.exec()
async def gg():
data = int(ui.ID.text())
channel = await Client.fetch_channel(data)
await channel.send(embed = discord.Embed(description=f"Hello World"))
Client.run("Token", bot = True)
Answer the question
In order to leave comments, you need to log in
Server = Client.get_guild(server_id)
Channel = Server.get_channel(channel_id)
await Channel.send(message)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question