Skip to main content

Posts

Using pycord and tkinter together returning error

RuntimeWarning: coroutine 'send' was never awaited self.tk.mainloop(n) RuntimeWarning: Enable tracemalloc to get the object allocation traceback I keep getting the above error on my pycord code. I can't figure out why and have looked at multiple discussions. Here is the code. root = Tk() frm = ttk.Frame(root, padding=10) frm.grid() server = StringVar() channel = StringVar() text = StringVar() e1 = Entry(frm, textvariable=server) e1.grid(column=0, row=0) e1.insert(0, 'Server') e2 = Entry(frm, textvariable=channel) e2.grid(column=0, row=1) e2.insert(0, 'Channel') e3 = Entry(frm, textvariable=text) e3.grid(column=0, row=2) e3.insert(0, 'Text') async def send(): for guild in bot.guilds: if guild.name == server.get(): for channel1 in guild.channels: if channel1.name == channel.get(): await channel1.send(text) ttk.Button(frm, text="Send", command=send).grid(column=0, row=4) def run

Are timing requirements in webRtc between calling setRemoteDescription and addIceCandidate?

I have implemented webrtc in 2 browsers that physically work on one local machine (one browser I will call as "local", another - "remote"). The browser - Firefox 112.0.1, TURN, STUN servers are not used. All strings (offer, answer, ice candidates) are transferred from one to another browser manually (slow transfer - via copy and paste). "Remote" gets an offer from the "local" and processes it by rtc2_RegisterRemoteOffer (see code below). This function creates answer of the "remote". Then: (1) the negotiationneeded event fired on the "remote", (2) because of (1) "remote" creates offer and generates it's own ice candidates (up to here neither "local" nor "remote" ice candidates I didn't transfer to each other). (3) Then after few seconds on the "remote" iceconnectionstate fired with the status failed . The questions are: What may be a reason of iceconnectionstate gets faile

Form is returning null without any reason [closed]

thanks to give me your time. I actually coding a login page but i can't write form.addEventListener() When i console.log(form) it return null and i don't know why For the js side : const form = document.getElementById("form"); console.log(form) form.addEventListener('submit', (event) => { event.preventDefault console.log(event) console.log(form) }) For the html side : [...] <form id="form"> <label for="email"> Entrez votre Email : </label> <input id="email" type="email" name="email" placeholder="Email ..." required> <label for="mdp"> Entrez votre Mot de Passe : </label> <input type="password" name="password" id="mdp" placeholder="Mot De Passe ..." required> <input type="submit" name="envoyer" id=&quo

React Native npx create-react-app Problem

My PowerShell(Terminal) Warn, i don't used npm install or any one just tried npx create-react-app NKE command: PS C:\Users\berk.BERK-PC\React Native> npx create-react-app NKE npm WARN using --force Recommended protections disabled. npm WARN using --force Recommended protections disabled. npm ERR! code ENOENT npm ERR! syscall lstat npm ERR! path C:\Users\berk.BERK-PC\React Native\'~ npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\berk.BERK-PC\React Native\'~' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: C:\Users\berk.BERK-PC\AppData\Local\npm-cache\_logs\2023-12-28T21_08_04_536Z-debug-0.log PS C:\Users\berk.BERK-PC\React Native> The Loc File: 0 verbose cli C:\Program Files\nodejs\node.e

Queenbee evaluation function for Hex

I created an alpha-beta cutoff search agent for Hex that uses the Queen Bee evaluation function, but I cannot get the function to work properly and need help. The evaluation function is described in section 3.2 of this paper. The function is simple and the explanation is quick to read through. I have provided my implementation below and have a couple questions: The function seems to work fine for smaller board sizes, but it cannot be completed quickly for larger boards. What can I do to speed up this calculation? There is definitely a simple fix for this, but this function is difficult for me to debug and test because there are many recursive calls that I need to walk through. Is there a way to skip all the recursive calls and jump back to the original caller in VS Code? def qb_distance(state, qb): def qb_distance_left(pos, d, v, qb_list): r, c = pos[0], pos[1] if c == 0: #if the current position is on the left edge of the board, return d return

How do I access Vite configuration from code?

Inside vite.config.ts , I have: export default defineConfig({ base: '', plugins: [react()], server: { open: true, port: 3000, }, }); Is it possible to access these values, especially the port number, from code? Or perhaps it's better to set these through easily accessible environment variables instead? Via Active questions tagged javascript - Stack Overflow https://ift.tt/DV5wcv7

DiscordJS DiscordAPIError[50013]

I want to send a message to a channel here is my index.js const json = require('./jsonEdit.js'); const discordBot = require('./discordBot.js') const youtubeAPI = require('./youtubeAPI.js') const server = require('./httpServer.js') let intervalId = 0 let link = '' const main = async () => { var config = json.readJsonFile('./config.json'); try { result = await json.updateData('./config.json', await youtubeAPI.getChannelIDByUrl(config.YOUTUBE_CHANNEL_LINK)); config = result.config } catch (error) { console.error('Error updating config:', error); config = null } if(config == null) { return } await discordBot.start(json) await server.start(json) intervalId = setInterval(() => aprilFool(json), 1000); // Check every second, adjust as needed process(json) setInterval(() => process(json), config.INTERVAL); } main() async function process(json) { let res = await youtubeA