Skip to content

How to fix discord music bot attribute

Error: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: ‘VoiceState’ object has no attribute ‘voice_channel’ Code: Answer Try using voice.channel instead of voice.voice_channel. Also client.join_voice_channel will not work. Use something like…

How to use QSortFilterProxyModel to do data aggregation

I used QSortFilterProxyModel to filter the model data and display it in a tableView. Then I want to aggregate the filtered data, so I created a new tableView2 to display the filtered data aggregation. I created a new QSortFilterProxyModel to aggregate the data, but I don’t know how to get the source data, and…

How do I decompress a MSZIP block?

I have a compressed file that is a CAB that I wish to extract a file from in Linux. Since there aren’t any native CAB extractors on Linux, I figured I’d try my hand at getting one done. While I’ve seen the MSZIP documentation[0] as well as [1] and [2], I’m having difficulties in decomp…

how to pass variables to method

I want to pass variables to the method. which of the following is better? (x and y are constants) or: Answer I’d argue the second one is better with regards to function purity, though this is a principle of Functional Programming rather than Object Oriented Programming. The only thing I’d wonder t…

Python pickle module usage

I saved my list with the pickle module. After restarting the program, if I query the list contents without adding new data, I can see the records, but if I add new data, I cannot see the old records. Why i can’t see old records ? Answer It’s because you are starting the program with an empty list.…