Questions tagged [disnake]

53 questions
0
votes
0 answers

UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 4711: character maps to

Soo import disnake from disnake.ext import commands import time from disnake import Intents bot = commands.Bot(command_prefix="*", intents=disnake.Intents.all()) @bot.event async def on_ready(): print(f'{bot.user.name} has connected to…
Fanky
  • 1
  • 1
0
votes
0 answers

I want to make a time selection in the timeout command, but I don’t understand how

I don’t understand how to make a choice of time, from the word in general @commands.slash_command(name='timeout', description='Замутить пользователя') async def command_timeout(self, interaction, member: disnake.Member, time: str , reason:…
user21343500
0
votes
0 answers

Disnake Commands

Is it possible to do something like this: /command option1 or option2 /command option1 /command option2 option2a or option2b According to the second part of the command, there will be a third field or no field.
0
votes
1 answer

python discord bot change_presence not working

I am writing a discord bot on the disnake library and I want to change its status, but when I want to enter additional parameters details, state or put an image for activity, only the name parameter is displayed. Also, if you set the streaming…
Qwich
  • 1
0
votes
0 answers

Python, discord bot, disnake. Modal

How do I get the bot to record what the participant enters into the variable in the modal window? Please help me :( I made a variable: name = # I don't know
0
votes
0 answers

Image submitting in a disnake modal

I would like someone to be able to upload an image into a modal, I don't even think this is possible. If it is, can someonegive me an example? I looked through the docs and I haven't seen anything, maybe I skipped it. I don't know.
0
votes
0 answers

I can't disconnect the bot from the voice chat (discord)

There is a problem with the bot that when executing the "leave" command (see below) the bot does not exit the voice chat. The first command works stably, but the second one, when executed, the bot unsubscribes that it has left the voice chat, but…
0
votes
0 answers

Discord bot: how to change the number of arguments in a slash command by code?

I'm making a discord bot that receives a link to a Google form from the user, and then reads all available text input fields. Each field in a google form must be a variable in another slash command. I use the library Disnake here is the pseudocode…
0
votes
0 answers

Successfully pulling field, unsuccessfully updating it

I got the folllowing problem: I'm successfully pulling the field with the UID "584u-4p75-WUR0-5Pwm" (the UID I'm testing it with), yet it's not updating it. The output of the prints is the following: {'Moderator': '456458873453150208', 'Reason':…
down bad
  • 21
  • 1
  • 3
0
votes
1 answer

Can I change the DB while the cycle is checking it? sqlite3

I'm interested to know if I can change the DB while the loop is running that takes data from the database every 10 seconds? The library is aiosqlite. The code of the loop: db = await aiosqlite.connect("/main.db") while True: await…
Deprool
  • 75
  • 8
0
votes
1 answer

Add different cooldown for different users for python bot

I use disnake library in python. I have list of premium users in bot and I want they to have a shorter cooldown for commands, than regular users. For example regular users have cooldown of 10 s, and premium users have cooldown of 3 s import…
Brevnoo
  • 13
  • 4
0
votes
1 answer

How to access MongoDB in-depth

I've got the following problem. I don't seem to figure out on how to access the "UID" value within the warning field. I want to iterate over every value inside the document, and access every existing UID to check if a randomly generated UID already…
down bad
  • 21
  • 1
  • 3
0
votes
1 answer

How do I create a delete command in Disnake?

I would like to create a delete command using Disnake. I want to turn delete the 100 messages on the channel where they were executed. I would love to know the code! I would like to make those, but I can't find them in my research. Thanks.
kaon8name
  • 1
  • 2
0
votes
0 answers

add commands dynamically to cog in disnake

This is my cog class MyCog(commands.Cog): def __init__(self, bot): self.bot = bot cmds = get_commands() for command in cmds: @commands.command(name=command['name'], description=command['description'],…
Amine Messaoudi
  • 2,141
  • 2
  • 20
  • 37
0
votes
0 answers

BotBase.__init__() missing 1 required keyword-only argument: 'intents'

I was trying to make a music bot for discord and I used this code: import discord import Config from discord.ext import commands from youtube_dl import YoutubeDL YDL_OPTIONS = {'format': 'worstaudio/best', 'noplaylist': 'False', 'simulate':…
mzkxdc
  • 1
  • 2