#discord-bots

1 messages · Page 864 of 1

sullen linden
halcyon onyx
#

ohhhhhhh how i dident think of that thanksssssssssssssss

sullen linden
#

yw

compact eagle
#

any way to change a bots status normally, not listening watch or streaming/playin

halcyon onyx
#

i think u can

#

@novel apex did it

compact eagle
sullen linden
compact eagle
sullen linden
halcyon onyx
#

i think next time i will change to nextcord do u think it's better than discord.py? @sullen linden

sullen linden
#

yes as discord.py is discontinued and nextcord took over maintaining it, just different name

halcyon onyx
#

oh nice

#

idk today i cant type normally i miss alot any fix for my fingers?

sullen linden
slate swan
#

@bot.command()
async def alex(ctx, arg):
    name, leng, amnt = arg.split(':')
  
    users = 0
    name = name
    leng = leng
    amnt = amnt
    for i in range(int(amnt)):
            user = "".join(sample(ascii_lowercase+digits, int(leng)))
            users += 1
            print(f"{user} | {users}")
            buffer = BytesIO(user.encode('utf-8'))
            file = discord.File(buffer,filename=name)```
For I in range doesn’t work for discord bot command any alternative
slate swan
boreal ravine
#

they are still usable

slate swan
slate swan
#

Also why not use multiple arguments?

#

I just find it easier

slate swan
#

Noone uses disco

boreal ravine
slate swan
#

Yea and I'll assume it was blocking since all of the methods there are normal functions ( or maybe they use them in run_in_executor)

unkempt canyonBOT
#

examples/basic_plugin.py lines 50 to 56

@Plugin.command('test')
@Plugin.command('echo', '<content:str...>')
def on_echo_command(self, event, content):
    # Commands can take a set of arguments that are validated by Disco itself
    #  and content sent via messages can be automatically sanitized to avoid
    #  mentions/etc.
    event.msg.reply(content, santize=True)```
sullen linden
#
print(interaction.message.mentions)

is being inconsistent on seeing the mentions from the message and im not sure why

slate swan
#

what's the interaction variable there? A discord.Interaction?

#

!d discord.Interaction.message

unkempt canyonBOT
sullen linden
#

working with persistent buttons

slate swan
#

do you have member intents? That may be the issue

#

since .mentions returns a list of Member objects

#

It's always printing an empty list right?

#

No one uses / commands and if you do there just preparing for update so discord.py works fine for me personally

sullen linden
slate swan
kind cargo
#

hello could i get som help?

alpine furnace
kind cargo
#

@commands.has_role("Bot Tillgång")
async def swish(ctx:discord.ApplicationContext , namn: str, nummer: str , belopp: str):
interaction = await ctx.respond(f"Processing payment request from {ctx.author.mention} to {namn}. Amount: {belopp} .....")
msg = await interaction.original_message()
payment = utils.Payment(namn,nummer,belopp,msg.created_at,msg.id)

await msg.channel.send(file = discord.File(fp=payment.mp4))

payment.close()

This is not working, how do i fix this?

slate swan
kind cargo
#

okay

alpine furnace
slate swan
#

quick question, with is utils.util already come with discord.py? or do i have to install it

kind cargo
#

and can someone teach me how to make a slash command?

alpine furnace
kind cargo
#

it is no error message the function just not working

slate swan
#

idk if utils.util is a thing catstare

slate swan
slate swan
#

am I able to GetMessage from discord.utils?

slate swan
#

!d disnake.ext.commands.Bot.get_message

unkempt canyonBOT
slate swan
kind cargo
#

import discord
from discord.commands import slash_command,permissions
from discord.ext import commands

GUILD_IDS = [945410623737589801]

Intents

intents = discord.Intents().all()

bot = commands.Bot(command_prefix="!", intents = intents)

@bot.event
async def on_ready():
print(f"We have logged in as {bot.user}")
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name ="my server"))
print(discord.version)
guild = bot.get_guild(945410623737589801)
# print(guild.roles)

<Role id=945014621033599036 name='Bot Tillgång'>

@bot.slash_command(
name = "swish" , usage="/swish" , description = "Command for making payment" , guild_ids=GUILD_IDS , default_permission = False
)
@permissions.has_role("Bot Tillgång")
async def swish(ctx:discord.ApplicationContext , namn: str, nummer: str , belopp: str):
interaction = await ctx.respond(f"Processing payment request from {ctx.author.mention} to {namn}. Amount: {belopp} .....")
msg = await interaction.original_message()
payment = utils.Payment(namn,nummer,belopp,msg.created_at,msg.id)

await msg.channel.send(file = discord.File(fp=payment.mp4))

payment.close()

need som help / command is not working

maiden fable
vocal plover
#

thats a good thing lol, pos only args are just irritating

kind cargo
#

could i get som help somone??

#

my slash command is not working

unkempt yacht
#

hey, can i get the docs for guild

slate swan
slate swan
kind cargo
#

ok ty

edgy osprey
#

Hello.
Need help. How do I get the bot to mention the user who used the command?

slate swan
slate swan
#

Why

#

that library is really unmaintained and discord.py is dead anyways

slate swan
#

use an actualy fork which does more than just slash commands

edgy osprey
slate swan
#

or disnake

#

¯_(ツ)_/¯

#

I might use disnake

#

Never used before tbh

#

@edgy osprey f"{message.author.mention}

edgy osprey
slate swan
#

Any error just ping

edgy osprey
kind cargo
#

why is mine like this?

#

i cannot press it

slate swan
kind cargo
#

oh

#

so it will be there in 1h?

azure depot
#

how do i get the bot mention the user i mention?

kind cargo
#

and i did all right?

slate swan
kind cargo
#

okaa

kind cargo
slate swan
edgy osprey
slate swan
honest shoal
slate swan
#

await ctx.send(f"{message.author.mention} hello”)

#

@edgy osprey

#

Just copy and paste that

honest shoal
#

🥄

slate swan
#

Also don’t use client use bot

edgy osprey
slate swan
slate swan
#

Bot has a lot more features compare to client

#
@bot.command()
async def alex(ctx, arg):
    name, leng = arg.split(':')
  
    users = 0
    name = name
    leng = leng
    amnt = "10"
    for i in range(int(amnt)):
            user = "".join(sample(ascii_lowercase+digits, int(leng)))
            users += 1
            print(f"{user} | {users}")
            buffer = BytesIO(user.encode('utf-8'))
            file = discord.File(buffer,filename=name)

#

The amnt amount doesn’t work bc it only sends 1

kind cargo
slate swan
#

Google > stack overflow > discord

maiden fable
slate swan
slate swan
nimble plume
slate swan
#

I got a really good coder friend to help with dms lol

nimble plume
#

cheese

slate swan
#

odd question

#

Go on

#

im trying to grab the authors icon , i don't see anything about it in the documents, unless im literally blind

#

is this correct? {ctx.author.icon_url}

#

You mean pfp?

#

yeah pfp

kind cargo
#

how to make discord bot send attatchments? 🙂

slate swan
slate swan
kind cargo
#

how im new?

scarlet rune
#

Somewhy my print command in main file got excecuted twice only when i had cogs loading

slate swan
scarlet rune
kind cargo
#

yeas

slate swan
scarlet rune
#

yeah

slate swan
#

Stack overflow is really handy ngl

scarlet rune
#

what does pass_context do ?

kind cargo
#

@slate swan

slate swan
#

Yes

kind cargo
#

@commands.has_role("Bot Tillgång")
async def swish(ctx:discord.ApplicationContext , namn: str, nummer: str , belopp: str):
interaction = await ctx.respond(f"Processing payment request from {ctx.author.mention} to {namn}. Amount: {belopp} .....")
msg = await interaction.original_message()
payment = utils.Payment(namn,nummer,belopp,msg.created_at,msg.id)

await msg.channel.send(file = discord.File(fp=template.mp4))
#

i have coded this but it does not send the template.mp4

slate swan
gaunt ice
#

yes

kind cargo
#

no XD

slate swan
kind cargo
#

yea

slate swan
#

await channel.send(file=discord.File('my_file.png'))

#

Simplest way possible

kind cargo
#

okay so then i just paste the name of the file in 'my file' right?

scarlet rune
#

you need to specify file path

kind cargo
#

whatt?

kind cargo
#

oka

slate swan
#

It’s self explanatory

scarlet rune
#

if it's not in the main folder

kind cargo
#

it is not in the main folder or it is

scarlet rune
#

yeah copy the full path

slate swan
kind cargo
#

okk

slate swan
#

Once the file is in path it should work

kind cargo
#

and how? im sorry, i use to talk swe.

slate swan
#

Not to be rude but file path should be basic pc knowledge

nimble plume
slate swan
#

I’m not sure myself

scarlet rune
#

you uh, find the file, in the location bar on your file explorer copy the location, don't forget to add the file name and extension on the path

kind cargo
#

is this right now?
@commands.has_role("Bot Tillgång")
async def swish(ctx:discord.ApplicationContext , namn: str, nummer: str , belopp: str):
interaction = await ctx.respond(f"Processing payment request from {ctx.author.mention} to {namn}. Amount: {belopp} .....")
msg = await interaction.original_message()
payment = utils.Payment(namn,nummer,belopp,msg.created_at,msg.id)

await channel.send(file=discord.File('C:\Users\sweti\OneDrive\Skrivbord\swishbot\swishbot\video\template.mp4'))

payment.close()
#

but i got an error

maiden fable
#

U got an unclosed bracket somewhere

kind cargo
#

me?

nimble plume
#

unclosed bracts as hunter said

#

in activity var

slate swan
#

See me=(

#

Your missing bracket

nimble plume
#

remove the last bracket

slate swan
kind cargo
#

okay

slate swan
#

Fixed?

#

Kk:)

kind cargo
#

but like so i cannot get help or what?

slate swan
#

I’m just gonna treat you like every other coder here I’m not gonna spoon feed

scarlet rune
#

bruh 3 cogs of mine which i wrote for hours is somewhy empty

#

life is good

slate swan
#

Rip you forgot to save

#

I feel you bro

scarlet rune
slate swan
#

Personally I use vscode but I heard of pycharm

scarlet rune
#

i would say pycharm, cuz im still learning

slate swan
#

Same

scarlet rune
#

i code cpp and htmls with vscode tho

slate swan
#

I might use it what are advantages to pycharm

scarlet rune
#

for python, pycharm is def one of the best.

slate swan
#

I’ll look into it

#

@scarlet rune advantages to cogs from normal command?

scarlet rune
slate swan
#

O

#
@bot.command()
async def alex(ctx, arg):
    name, leng = arg.split(':')
  
    users = 0
    name = name
    leng = leng
    amnt = "10"
    for i in range(int(amnt)):
            user = "".join(sample(ascii_lowercase+digits, int(leng)))
            users += 1
            print(f"{user} | {users}")
            buffer = BytesIO(user.encode('utf-8'))
            file = discord.File(buffer,filename=name)

How to send more then 1 string

slate swan
#

name = name and leng=leng peepoWTFSad

#

Ty

slate swan
#

Good luck

#

what kind of game is that

#

API fun

slate swan
#

dude

#

this is an easy kind of game

slate swan
slate swan
#

Welcome to Alex’s coding

scarlet rune
#

Does anyone know why loading cogs makes the main file prints this "Connecting to the internet"(it's in the main file) twice, it doesn't happen when i don't have any put any cogs in

slate swan
slate swan
maiden fable
slate swan
#

Wdym

scarlet rune
maiden fable
#

Reassignment just wastes RAM and CPU, tho it almost being 0 but still

slate swan
scarlet rune
#

loading cogs

slate swan
#

smh pepecry

scarlet rune
#

REALLY

maiden fable
scarlet rune
# maiden fable Show the loop where u r loading the cogs

i kind of don't get this but it loops this code

# listing all extensions in startup
for extension in os.listdir('./cogs'):
    if extension.endswith('.py'):
        bot.load_extension(f'cogs.{extension[:-3]}')
        print(f'> {extension} has been loaded.')```
maiden fable
#

And where u printing connecting to internet?

scarlet rune
#

right above it

slate swan
#

I asked exact same question WTFStare

maiden fable
#

Didn't read the chat history sorry

maiden fable
scarlet rune
slate swan
slate swan
scarlet rune
#

it worked a week ago just fine...

slate swan
#

@slate swan cogs r so much better my friend, i made the switch. makes everything more organized and easier to use imo

maiden fable
#

Show whole code

slate swan
maiden fable
scarlet rune
#

ill remove the unecessary codes

maiden fable
#

I just need the code of the main file

scarlet rune
#

yeah i was trying to send that wait

slate swan
unkempt canyonBOT
#

Hey @scarlet rune!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

slate swan
maiden fable
slate swan
#

@bot.command()
async def alex(ctx, arg):
    name, leng = arg.split(':')
  
    users = 0
    amnt = "10"
    for i in range(int(amnt)):
            user = "".join(sample(ascii_lowercase+digits, int(leng)))
            users += 1
            print(f"{user} | {users}")
            buffer = BytesIO(user.encode('utf-8'))
            file = discord.File(buffer,filename=name)``` it prints the string but doesn’t make it in txt it only writes 1 on txt
scarlet rune
slate swan
maiden fable
scarlet rune
#

lol

maiden fable
#

Damn dude yr pfp

slate swan
maiden fable
slate swan
maiden fable
#

Then use djs

kind cargo
#

why is my slash command like this?

maiden fable
#

Ezzz

maiden fable
slate swan
maiden fable
#

Dude stop

maiden fable
slate swan
kind cargo
#

ye

slate swan
maiden fable
slate swan
#

!paste the code here

unkempt canyonBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

kind cargo
#

!paste

slate swan
slate swan
maiden fable
slate swan
kind cargo
maiden fable
#

Would be fun to see how the tables turn

kind cargo
#

here is my code @maiden fable

slate swan
maiden fable
kind cargo
#

yes'

maiden fable
kind cargo
#

done

maiden fable
kind cargo
#

yes i do ..

maiden fable
#

try setting default_permissions to True

slate swan
kind cargo
#

it worked @maiden fable 🙂 ty so much

maiden fable
#

Cool!

kind cargo
maiden fable
#

the cat do be cute tho 👀

maiden fable
kind cargo
#

u mean my pfp ? ❤️

#

haha

maiden fable
#

Yea haha

kind cargo
#

so my problem is

#

my bot should be able to send a gif when i type a command (custom gif)

#

but it does not send

maiden fable
#

Mind sharing the command code?

kind cargo
#

ye

maiden fable
#

Ah

#

u need to supply a string which is the path to the gif

kind cargo
#

can we go call i dont understand

#

and i screenshare i use to talk swedish :))

maiden fable
#

Cannot get on a call rn

kind cargo
#

okay wait i will just pm you

maiden fable
#

So show me where is the gif and where is the Python file

maiden fable
kind cargo
#

okaa

#

i will share you images

maiden fable
#

Sure

kind cargo
#

there

maiden fable
#

And where is the template.mp4 present?

#

video folder?

kind cargo
#

yep

maiden fable
#

so in the fp

#

type in "video/template.mp4"

kind cargo
#

okay ty lemme try

small igloo
#

is there any way to make paid commands? (patreon's API down...)

maiden fable
#

Nope, not in dpy

#

U need a db for the same

kind cargo
#

it does not work @maiden fable

maiden fable
#

Oh, show the latest code (u can paste it here itself since its smol)

spring flax
#

how does one make it so that when a github link is posted with specified lines it displays the lines?

maiden fable
kind cargo
# maiden fable U should use regex and on_message

@commands.has_role("Bot Tillgång")
async def swish(ctx:discord.ApplicationContext , namn: str, nummer: str , belopp: str):
interaction = await ctx.respond(f"Processing payment request from {ctx.author.mention} to {namn}. Amount: {belopp} .....")
msg = await interaction.original_message()
payment = utils.Payment(namn,nummer,belopp,msg.created_at,msg.id)

await msg.channel.send(file = discord.File(fp=video/template.mp4))

payment.close()
spring flax
#

for references

maiden fable
#

Nope, sorry

small igloo
#

🗿

kind cargo
#

and @maiden fable i made custom text for this gif aswell i hope it will work if we fix this gif

kind cargo
#

where is the string?

stray carbon
kind cargo
#

@maiden fable

rancid stump
#

Hy guys how i can code my discord so that if one specific user do something i do something base on that action

#

For ezampme if akai mentioned me my bot reply dont mention me but if another mention me
Bot didn't apply

In short one functionality specifically for one user base on his one specific action

slate swan
#

user = "".join(sample(ascii_lowercase+digits, int(leng)))

How would I add amount of strings

#

I got length but no amount

elfin cave
#

Why i dont have access via reaction to a older bot message anymore?

slate swan
#

Not sure

elfin cave
#

Should i use on_reaction_add or on_raw_reaction_add ?

#

@slate swan

gaunt ice
#

show code

#

the error handling code

slate swan
#

It looks better as it tells user it doesn’t exist imo

slate swan
slate swan
gaunt ice
slate swan
stray carbon
#

hello

maiden fable
#

I meant, fp="./videos/template.mp4"

lusty yew
#

How can I host a bot what uses FFmpeg?

rancid stump
#

this piece of code didn't working in discord.py ??

is something im doing wrong or there is anyother way to do it
if yes plz let me know

manic wing
#

remove the “

slate swan
maiden fable
#

Smh imagine using emojis for no reason

ornate crater
#

what the prob.?

rancid stump
manic wing
rancid stump
#

one more thing how to sent custom emoji in embedd msg ?

ornate crater
rancid stump
#

i try :python : this way but didn't work

#

it sent default emoji which available in windows but not the one which is on custom servers

maiden fable
#

Do \:emoji: and then pass the string u get in the code

rancid stump
maiden fable
#

Show

rancid stump
#

but it send simple emoji

#

it sent this

#

but not work Total Volume :dollar: thing

slate swan
slate swan
buoyant quail
slate swan
#

^

rancid stump
#

see it send the message but not the emoji

#

that attach to :SOL:

kind cargo
#

Can someone help me? I am trying to make my bot send a video, but it is not working. What did I do wrong?
await ctx.channel.send(file = discord.File(fp=video/template.mp4))

slate swan
rancid stump
slate swan
#

and then enter

vale sierra
#
@bot.command()
async def envers(ctx, *text):
    enversChar = "ɐqɔpǝɟƃɥı̣ɾ̣ʞן ɯuodbɹsʇnʌʍxʎz"
    enversText = []
    for word in text:
        for char in word:
            if char.isalpha():
                index = ord(char) - ord("a")
                transformed = enversChar[index]
                enversText.append(transformed)
            else:
                enversText.append(char)
        enversText.append(" ")
    await ctx.send("".join(enversText)) ``` Hello, this code don't work, I try to make the bot say a phrase but in reverse (with characters) but the bot say something completely different : 
can someone help me please ? (this code work with an another alphabet)
maiden fable
rancid stump
#

\😭

slate swan
slate swan
kind cargo
#

@maiden fable can u help me?

maiden fable
#

I just DMed u a link, click on it. That's the answer

vale sierra
#
@bot.command()
async def envers(ctx, *text):
    enversChar = "ɐqɔpǝɟƃɥı̣ɾ̣ʞן ɯuodbɹsʇnʌʍxʎz"
    enversText = []
    for word in text:
        for char in word:
            if char.isalpha():
                index = ord(char) - ord("a")
                transformed = enversChar[index]
                enversText.append(transformed)
            else:
                enversText.append(char)
        enversText.append(" ")
    await ctx.send("".join(enversText)) ```
 Hello, this code don't work, I try to make the bot say a phrase but in reverse (with characters) but the bot say something completely different : 
can someone help me please ? (this code work with an another alphabet)
maiden fable
#

Please don't post repeatedly

vale sierra
#

👍

#

sorry mods

kind cargo
#

I am trying to make my bot send a video, but it is not working. What did I do wrong?
await ctx.channel.send(file = discord.File(fp=video/template.mp4))

slate swan
daring moss
#

Can someone help me? I need to create a command, that will mute users for estimated time and the time will go even after the bot was off

slate swan
#

yeah thats the best option

maiden fable
slate swan
#

disnake*

maiden fable
#

Literally copy paste the code (:

slate swan
#

nah all forks

maiden fable
#

No

#

Dpy doesn't support it since it came after dpy was discontinued

rancid stump
#

how to change the color of embed message title name ?

maiden fable
#

You gotta edit the 2.0 version of the lib, edit lines 637-752 in discord/member.py
https://github.com/Rapptz/discord.py/blob/45d498c1b76deaf3b394d17ccf56112fa691d160/discord/member.py#L637-L752

You need to add a parameter for timed_out_until: Optional[datetime.datetime] = MISSING

async def edit(
    self,
    *,
    nick: Optional[str] = MISSING,
    mute: bool = MISSING,
    deafen: bool = MISSING,
    suppress: bool = MISSING,
    roles: List[discord.abc.Snowflake] = MISSING,
    voice_channel: Optional[VocalGuildChannel] = MISSING,
    reason: Optional[str] = None,
    timed_out_until: Optional[datetime.datetime] = MISSING,
) -> Optional[Member]: 


Then add handling for the param:

if timed_out_until is not MISSING:
  if timed_out_until is None:
    payload["communication_disabled_until"] = None
  else:
    payload["communication_disabled_until"] = timed_out_until.isoformat() 

If any of this is confusing -> don't do it.
No, don't ask for help with it, we won't help.

Need to add getting the timeout duration of a member added to the Member class checkout ?tag timeout duration for Member

If u want to try implementing it yourself, @slate swan

maiden fable
#

Sorry, never used ord function

vale sierra
#

no problem

kind cargo
#

await ctx.channel.send(file = discord.File(fp="video/template.mp4"))
is this correct? @maiden fable

maiden fable
#

Yes.

kind cargo
#

okay

rancid stump
#

how to change color of embed message ?

boreal ravine
vale sierra
rancid stump
#

when i used color =red it chaneg the left bar color not the text color

slate swan
rancid stump
slate swan
#

yes

vale sierra
vale sierra
#

don't know how to define that

#

color = 0x12E67 for exemple

maiden fable
boreal ravine
#

o

slate swan
vale sierra
slate swan
vale sierra
vale sierra
slate swan
#

what did I even say wtf

slate swan
vale sierra
vale sierra
slate swan
gleaming torrent
vale sierra
#

there war and some people create problems

slate swan
vale sierra
#

ofc i dont like people like you

maiden fable
boreal ravine
#
Command raised an exception: TypeError: can't compare offset-naive and offset-aware datetimes
gleaming torrent
#

Like, does the file he is trying to send have to be in the same folder his code is in?

cedar stream
slate swan
vale sierra
boreal ravine
# cedar stream U gotta set timezones for both

how would I do that? created_at already has tzinfo im not sure how i would 'set' the tzinfo for the timedelta```py
if data['last_daily'] is None or data['last_daily'] < (ctx.message.created_at - datetime.timedelta(days=1)):

slate swan
cedar stream
vale sierra
maiden fable
#

Can we stop this?

boreal ravine
cedar stream
#

@vale sierra @slate swan go to dms

vale sierra
thick sigil
#

your whole code is useless

slate swan
#

just leave it already

cedar stream
vale sierra
cedar stream
maiden fable
#

???

vale sierra
cedar stream
boreal ravine
#

print what?

thick sigil
vale sierra
#

alr wait a second i remake the code

thick sigil
#
    await ctx.send(sentence[::-1])```
#

how can it be worse

leaden jasper
#

how to replace {0} with a variable in an embed's title?

  async def test(self, ctx):
    embed = discord.Embed(
      title = 'Title {0}'
    )
    embed.title.format('text')
    await ctx.send(embed = embed)

that does nothing

thick sigil
#

also ye dont forget the * before the sentence parameter

unkempt canyonBOT
#

Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.

>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."

Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.

vale sierra
#

ok

leaden jasper
slate swan
leaden jasper
#

because its cleaner

boreal ravine
#

no?

slate swan
#

Also, you are not changing the title with embed.title.format(..., It's just an operation you performed which is not making any changes

kind cargo
#

Hi guys! I am trying to make my bot send a video, but it is not working. What did I do wrong?
await ctx.channel.send(file = discord.File(fp="video/template.mp4"))

slate swan
vale sierra
unkempt canyonBOT
#

class discord.File(fp, filename=None, *, spoiler=False)```
A parameter object used for [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for sending file objects.

Note

File objects are single use and are not meant to be reused in multiple [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send")s.
thick sigil
#

show your code

vale sierra
#
@bot.command()
async def reverse(self, ctx, *, sentence : str):
    await ctx.send(sentence[::-1]) ```
kind cargo
#

@thick sigil u mean me?

thick sigil
#

no

kind cargo
#

OK SORRY

thick sigil
#

remove self @vale sierra

leaden jasper
#
templateEmbed = discord.Embed(
  title = 'Your word {0}',
  description = (
  'really long text here'
  'really long text here'
  'really long text here'
  'really long text here'
  'really long text here'
  'really long text here'
  'really long text here'
  )
)

@commands.command()
async def test(ctx, word):
  embed = templateEmbed.copy()
  embed.title.format(word)
  await ctx.send(embed = embed)
slate swan
cedar stream
leaden jasper
#

its cleaner that way

cedar stream
#

Not just file path

kind cargo
#

okay

leaden jasper
slate swan
spring flax
#

Would is be possible to update code without restarting the bot?

leaden jasper
#

let me try that

vale sierra
slate swan
cedar stream
leaden jasper
kind cargo
#

@cedar stream so how do i do?

cedar stream
#

!d discord.File

unkempt canyonBOT
#

class discord.File(fp, filename=None, *, spoiler=False)```
A parameter object used for [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for sending file objects.

Note

File objects are single use and are not meant to be reused in multiple [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send")s.
cedar stream
#

Read this

slate swan
#

What else is he doing?

kind cargo
#

ok

cedar stream
spring flax
slate swan
cedar stream
boreal ravine
thick sigil
#

I mean dpy will create a file object once it finds the file on the mentioned path

#

be sure that it is reachable

cedar stream
maiden fable
cold sonnet
slate swan
maiden fable
#

!pypi watchdog this was also implemented in disnake

unkempt canyonBOT
slate swan
slate swan
cold sonnet
#

he's not doing what

kind cargo
#

someone help me with this

maiden fable
#

With?

maiden fable
kind cargo
# maiden fable With?

i dont understand
await ctx.channel.send(file = discord.File(fp="video/template.mp4"))

cold sonnet
#

he's not doing what

maiden fable
#

Wym u don't understand?

slate swan
kind cargo
#

what im gonna type there

cold sonnet
slate swan
#

And its a kwarg

kind cargo
#

yes

cold sonnet
slate swan
#

!d discord.File

unkempt canyonBOT
#

class discord.File(fp, filename=None, *, spoiler=False)```
A parameter object used for [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for sending file objects.

Note

File objects are single use and are not meant to be reused in multiple [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send")s.
cold sonnet
#

not a kwarg

slate swan
#

hm

maiden fable
#

You both do know that I told him that code right? 👀

cold sonnet
kind cargo
#

im new to python

#

can anyone help me in PM

#

or here dosent matter

cold sonnet
#

remove the channel attribute

cedar stream
kind cargo
#

i dont understand what hes meaning

slate swan
kind cargo
#

what should i remove what should i type?

cold sonnet
#

await ctx.send(file = discord.File(fp="video/template.mp4"))
changes nothing, but definitely triggering

cedar stream
thick sigil
#

Removing channel attribute wont fix his code. Try to instantiate discord.File and see if it found something

slate swan
#

!e ```py
def fn(not_a_kwarg):
print(not_a_kwarg)
fn(not_a_kwarg=1)

🏃doesn't matter if he used It as a kwarg

unkempt canyonBOT
#

@slate swan :white_check_mark: Your eval job has completed with return code 0.

1
slate swan
kind cargo
#

no but it does not send the video

slate swan
#

what's your bot's latency

boreal ravine
# cedar stream Add timezone here
        today = datetime.date.today()

        new_daily = datetime.now(today.year, today.month, today.day, tzinfo=datetime.timezone.utc)
``` good?
kind cargo
#

what?

slate swan
#

um, your bot's ping

cedar stream
kind cargo
#

how can i see that

slate swan
#

you gotta use bot.latency to check it

cedar stream
#

I’ m stupid

slate swan
#

uh

#

!d discord.ext.commands.Bot.latency

unkempt canyonBOT
#

property latency: float```
Measures latency between a HEARTBEAT and a HEARTBEAT\_ACK in seconds.

This could be referred to as the Discord WebSocket protocol latency.
kind cargo
#

@slate swan

#

what should i type

slate swan
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: __init__() got an unexpected keyword argument 'timeout'
Error ^

button = Button(label="Invite", style=discord.ButtonStyle.primary,timeout=180)
Code ^

Lib | discord.py

Question | How do I fix this?

slate swan
#

Oh, it's a View

#

for cooldown

#

!d discord.ui.Button

unkempt canyonBOT
#

class discord.ui.Button(*, style=<ButtonStyle.secondary: 2>, label=None, disabled=False, custom_id=None, url=None, emoji=None, row=None)```
Represents a UI button.

New in version 2.0.
slate swan
#

A view has a timeout , not a button

#

oh

boreal ravine
kind cargo
#

can anyone maybe help me? my problem is : await ctx.send(file = discord.File(fp="video/template.mp4"))
.what have i dont wrong?

spring flax
#

can anyone remind me how to import function/class from my main file into a cog?

slim ibex
#

what the file structure

spring flax
slim ibex
#

how are you folders and files structured

slate swan
#

is there a way to make a cooldown for one specific person on buttons lib is discord.py

spring flax
slim ibex
#

are both cogs and the main file in the same directory

#

yeah

#

thats why eval should ONLY be for the owner of the bot

small igloo
#
@bot.command()
async def test_premium(ctx):
    role = get(guild.roles, id=924915779835691008)
    print(role)```

guild is not defined, and if i can, i also wanna get the example of `get()` usage ples
slim ibex
#

well the people that made this bot are on bigger brain

unkempt canyonBOT
#

@languid wagon :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'token' is not defined. Did you mean: 'open'?
slim ibex
#

they probably secured it to another level

slate swan
#

is there a way to make a cooldown for one specific person on buttons lib is discord.py

kind cargo
#

how do i make my bot send discord links?

small igloo
slate swan
#

how would i make it so if a person clicked my button it's only disabled for that person

slim ibex
#

and did you directly import discord.utils.get?

spring flax
small igloo
#

🗿 ?

slate swan
#

could someone help me :/

#

oof ok

slim ibex
small igloo
slim ibex
#

im frustrated rn because it says my db connection is established when i run the bot, and that connection is bound to my self.db instance variable, but when i try to do a transaction outside the bot file, it says no active connection 🗿

#

my ide always brings me back to that instance variable so i know that the connection is on that variable

slate swan
#

could anyone help me with buttons :\

slim ibex
#

what about them

slate swan
#

i want to make a cooldown for each person that clicks it
or better the button get's disabled after they click it

slim ibex
#

what lib are you using

slate swan
slim ibex
#

you probably should use a fork instread of dpy for buttons and stuff

slate swan
#

but do you have a idea on how to do it

slim ibex
#

yes

#

you can make a callback that sets the buttons disabled attribute to True

#

!d discord.ui.Button

unkempt canyonBOT
#

class discord.ui.Button(*, style=<ButtonStyle.secondary: 2>, label=None, disabled=False, custom_id=None, url=None, emoji=None, row=None)```
Represents a UI button.

New in version 2.0.
slate swan
kind cargo
#
async def swish(ctx:discord.ApplicationContext , namn: str, nummer: str , belopp: str):
    interaction = await ctx.respond(f"Processing payment request from {ctx.author.mention} to {namn}. Amount: {belopp} .....")
    msg = await interaction.original_message()
    payment = utils.Payment(namn,nummer,belopp,msg.created_at,msg.id)

    await msg.channel.send(file = discord.File(fp=payment.mp4))

    payment.close()```

Whats wrong with my code?
I want it to be a custom image and custom text, number, name on it.
It does not send the image.
What can i do?
slim ibex
#

yeah disabled for the interaction user

slim ibex
slim ibex
kind cargo
#

okay

slim ibex
#

its discord.Context

slate swan
buoyant igloo
spring flax
slim ibex
kind cargo
#

what should i do more? @slim ibex

spring flax
#

i want to import functions from chatbot to utility file

slim ibex
# spring flax yeah

from ..chatbot import your_function. i would put an empty __init__.py in each directory you make

#

the relative import might not work though. they never do

kind cargo
#

i got this error now
AttributeError: module 'discord' has no attribute 'discord

slate swan
kind cargo
#

anyone mb help me?

spring flax
slim ibex
#

if it was ., it would search in the cogs directory

slim ibex
cold sonnet
#

u don't even need a dot then

slim ibex
#

but you can also import all names in that directory to that file to use them in __all__

#

!star-imports

unkempt canyonBOT
#

Star / Wildcard imports

Wildcard imports are import statements in the form from <module_name> import *. What imports like these do is that they import everything [1] from the module into the current module's namespace [2]. This allows you to use names defined in the imported module without prefixing the module's name.

Example:

>>> from math import *
>>> sin(pi / 2)
1.0

This is discouraged, for various reasons:

Example:

>>> from custom_sin import sin
>>> from math import *
>>> sin(pi / 2)  # uses sin from math rather than your custom sin

• Potential namespace collision. Names defined from a previous import might get shadowed by a wildcard import.
• Causes ambiguity. From the example, it is unclear which sin function is actually being used. From the Zen of Python [3]: Explicit is better than implicit.
• Makes import order significant, which they shouldn't. Certain IDE's sort import functionality may end up breaking code due to namespace collision.

How should you import?

• Import the module under the module's namespace (Only import the name of the module, and names defined in the module can be used by prefixing the module's name)

>>> import math
>>> math.sin(math.pi / 2)

• Explicitly import certain names from the module

>>> from math import sin, pi
>>> sin(pi / 2)

Conclusion: Namespaces are one honking great idea -- let's do more of those! [3]

[1] If the module defines the variable __all__, the names defined in __all__ will get imported by the wildcard import, otherwise all the names in the module get imported (except for names with a leading underscore)
[2] Namespaces and scopes
[3] Zen of Python

spring flax
#

so you want me to make a file with the name __init__.py? Sorry I'm not good at these stuff

slim ibex
#

yeah its good practice to make one in each directory

slate swan
spring flax
#

so then I have a function async def Button in my main file, in the cog I do from ..chatbot import button?

slim ibex
#

mhmm

#

if the relative import doesn't work, we'll need to use an absolute import

slate swan
cold sonnet
#

no

slate swan
#

:((

cold sonnet
#

but I might be able to

slate swan
#

i want to make a cooldown for each person that clicks it
or better the button get's disabled after they click it

cold sonnet
#

for one person?

slate swan
slate swan
slim ibex
# slate swan ok
@command()
async def some_command(your_params):
  view = SomeView()
  button = ButtonView("a_button")
  view.add_item(button)

  async def button_callback(interaction: MessageInteraction):
    button.disabled = True

  button.callback = button_callback
#

there is 100% a better way of doing this

cold sonnet
#

make a petition

slim ibex
#

i believe you can do the callback in the view itself

cold sonnet
#

make a petition for the Button's disabled attribute to take a BucketType

slate swan
#

you cant just `disable` it for one person

slim ibex
#

^

cold sonnet
#

letsgo

slim ibex
#

unless you make the interaction only for the command invoker

#

which is possible

cold sonnet
slate swan
#

discord doesnt really care about what devs need

cold sonnet
#

and on_callback, you'd have to go through that variable and see

#

it's the only way

cold sonnet
#

~~it's just deep down in overweight, but ~~it's there

#

if many people join our petition, we can do it

drowsy thunder
#

Anyone has a reddit meme command with buttons?

manic wing
#

just disable it for the person in the code

manic wing
#

who are you making this petition to?

cold sonnet
#

discord

manic wing
#

x.x

#

just disable it in the code, its not that big of a deal

cold sonnet
#

but it'd be cool sadcat

manic wing
#

nah

#

you wouldnt even notice

#

5 people signing a petition is not enough for discord to do anything

untold flax
#

@bot.event
async def on_reaction_add(reaction, user):
if reaction.emoji == "👑":
role = user.guild.get_role(947333237951315971)

#

wanted from office by reaction more not of the post

cold sonnet
#

str(reaction.emoji)

drowsy thunder
slim ibex
#

!d discord.Member.kick

unkempt canyonBOT
#

await kick(*, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Kicks this member. Equivalent to [`Guild.kick()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.kick "discord.Guild.kick").
drowsy thunder
#

Help me

kind cargo
#

how to embed video?

#

in py

kindred epoch
#

actually you can

#

!d discord.Embed.video

unkempt canyonBOT
#

property video: _EmbedVideoProxy```
Returns an `EmbedProxy` denoting the video contents.

Possible attributes include:

• `url` for the video URL.

• `height` for the video height.

• `width` for the video width...
visual island
#

no

hushed galleon
#

iirc its a read-only property

kindred epoch
#

yea nvm

visual island
#

you cant embed videos, its generated by discord E.g. Youtube link. The property exists to read that

maiden fable
#

Cirno here 👀

visual island
#

hi

slim ibex
#

🗿

maiden fable
#

Hi

#

Long time

visual island
#

yeah ^^

maiden fable
#

Imagine nitro still

visual island
#

cant live without it whattt

maiden fable
#

Imagine

#

Am I the only one who doesn't want nitro?

visual island
#

no, but you're the only one who rejected free nitro whattt

kind cargo
#

yo can anyone help me to embed a video?

maiden fable
#

I still remember that

maiden fable
kind cargo
maiden fable
#

Yea u can't embed a video

kind cargo
#

okay a gif

#

or any type of that moves

#

so u cant embed a discord link thats a video?

maiden fable
#

I think a GIF is possible

#

Yea I guess?

kind cargo
#

okay i have a video how do i fix it to a gif?

maiden fable
#

Just search up mp4 to gif converter on google

visual island
slate swan
#

shard_count works with disnake too?

slate swan
maiden fable
slate swan
maiden fable
slate swan
maiden fable
#

Meh bot broke

slate swan
slate swan
maiden fable
slate swan
slate swan
#

maybe its just not documented

slate swan
slate swan
slate swan
cold sonnet
slate swan
unkempt yacht
#

So I have this code where if someone joins, the bot sends a message to a channel. The only issue is, if someone joins another server that the bot is in then it also sends a message even thought the user joined another server. How would I fix this:

@commands.Cog.listener()
    async def on_member_join(self, member: discord.Member):
        channel = self.bot.get_channel(935580211926405170)

        if not channel:
            return

        await channel.send(f"Welcome to Galaxy Dankers, {member.mention}!")```
slate swan
#

use member.guild.get_channel instead of bot.get_channel

#

so if the member is not for the guild the channel is in, the def will return

unkempt yacht
#

ok ty

vale sierra
#

how do we delete the commands "help" pre-existing on the system ?

kindred epoch
#

in your commands.Bot add help_command=None

spring flax
#

i have a cog folder, and in the cog folder I have a file x.py and y.py
If there is a function test in x.py, how do I import it to y.py?

kindred epoch
#

is that commands.Bot?

vale sierra
#

@kindred epoch thanks

kindred epoch
#

np

buoyant igloo
#

guys how get media link

#

Pls tell, for embed

spring flax
#

ah okay how to import those then?

final iron
#

Use an ide or text editor with intelisense when you're importing

spring flax
#

also, how do I check if a author is a bot in commands.Cog.listener('on_message')?

final iron
#

It will make your life so much easier

unkempt canyonBOT
#

property bot```
Equivalent to [`User.bot`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.bot "discord.User.bot")
spring flax
buoyant igloo
#

gudyyhdhfd how get media link of gifff

spring flax
#

i'm using visual studio code

final iron
#

I use pycharm so it's built in

kindred epoch
buoyant igloo
#

like media link

final iron
#

It shows me all the files in the directory I'm importing from which is extremely useful

spring flax
#

@slate swan also what's bad about having a file in a cog for your functions?

#

instead of making a seperate folder just for that one file

quick gust
sweet merlin
#

if channel permission got true and false what is the normal one? like in the center thing

gaunt ice
#

ur pfp is sexy lol

spring flax
#

do all functions in cogs need to be self as first param?

gaunt ice
#

yes

spring flax
#

even this?py def cleanup_code(content): if content.startswith('') and content.endswith('```'):
return '\n'.join(content.split('\n')[1:-1])
else:
return content.strip('` \n')

gaunt ice
#

hm

spring flax
#

whoops it got messed up

gaunt ice
#

um

sweet merlin
#

i tried that but it reset whole permission

#

i tried to type X and it reset whole perm

exotic kite
#

Hey guys so i got stuck somewhere here

gaunt ice
#

hm

unkempt canyonBOT
#

await add_roles(*roles, reason=None, atomic=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Gives the member a number of [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s.

You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this, and the added [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
plain thorn
final iron
#

Um

#

I don't think we should help with that

exotic kite
plain thorn
#

?

final iron
#

Extremely inappropriate

final iron
#

Yes

exotic kite
#

thats not the main purpose of this command

gaunt ice
#

hm

final iron
#

Sure

exotic kite
#

im mixing several commands into one command

plain thorn
sweet merlin
exotic kite
sweet merlin
#

okay

final iron
#

And if someone gives the bot admin role?

plain thorn
#

Yeah they cant

plain thorn
gaunt ice
vale sierra
#
@bot.command()
async def ping(ctx, self):
  the_ping = client.latency * 1000
  rounded_ping = round(the_ping)
  embed = discord.Embed(title = "🏓  **Ping**", description = f"{ctx.author.mention} Ton ping est de {round(client.latency * 1000)} ms !", color = 0x9400D3)

  await ctx.send(embed = embed) ``` Hello, i try to make a ping client commands, but there is a error in the code
plain thorn
#

nope

vale sierra
plain thorn
#

that used to be a thing but you cant do that anymore @slate swan

quick gust
#

sigh

slate swan
#

what's the best way to make it so when a user clicks a button it get's disabled
only for that person using discord.py

quick gust
#

remove self, ure not in a cog + its never the 2nd arg

vale sierra
#

ok

final iron
slate swan
#

could anyone help me

vale sierra
slate swan
quick gust
plain thorn
#

It cannot

quick gust
#

did u restart ur bot? show ur current code

vale sierra
plain thorn
quick gust
#

I believe they can't give admin perms

slate swan
vale sierra
# quick gust did u restart ur bot? show ur current code
@bot.command()
async def ping(ctx):
  the_ping = client.latency * 1000
  rounded_ping = round(the_ping)
  embed = discord.Embed(title = "🏓  **Ping**", description = f"{ctx.author.mention} Ton ping est de {round(client.latency * 1000)} ms !", color = 0x9400D3)

  await ctx.send(embed = embed)
final iron
vale sierra
#

no just nothing append

quick gust
#

no error

spring flax
final iron
final iron
quick gust
#

there we go, good catch

vale sierra
#

?

#

oh

kindred epoch
quick gust
kindred epoch
#

rounding it in the embed and rounding it outside?

vale sierra
quick gust
vale sierra
#

but when i type client i want to ping of the user

#

i make a mistake

quick gust
#

u cant do that

vale sierra
#

oh ok, thank

slate swan
#

my pc cannot find my cogs folder.

Code:

#

error:

plain thorn
#

I appear to be wrong

#

USERS can't make a role with administrator when they are an administrator

#

for some fuck all reason, bots can

slate swan
#

Guys how i can make reboot bot command?

boreal ravine
kindred epoch
slate swan
plain thorn
# slate swan Guys how i can make reboot bot command?

The only good way to restart your bot is to shut it down and have your process manager handle it. You can shutdown your bot by running Bot.close().

Do use:

  • run your bot in a process manager such as:
    • systemd
    • openrc (gentoo, devuan)
    • runit (void linux)
    • supervisord
    • upstart (old ubuntu)
    • docker
  • manually reboot it

Do not use:

  • a bash loop (it can eat your C-c by rapidly spawning python and if your bot fails it won't stop it from constantly failing)
  • subprocess.call (you will eat your memory up by not letting your old processes die)
  • os.exec*
quick gust
slate swan
sweet merlin
boreal ravine
kindred epoch
slate swan
#

can anyone help me with a problem involving buttons

quick gust
boreal ravine
slate swan
plain thorn
plain thorn
#

well, kinda

boreal ravine
slate swan
#

same error

slate swan
boreal ravine
slate swan
boreal ravine
#

hm

slate swan
#

wrong screenshot

#

youre running some file named akiri bot.py

#

i just changed it

#

how is that related to this folder?

#

show the current dir then

#

isnt it still the same?

#

wait i just noticed my problem

#

doesnt matter what file you have opened, the folder needs to be inside the bot file's dir

#

im stupid i had the module installed

#

odd how it wasn't raising that error tho

wary zenith
#

my bot giving command not found exception on this cmd, but it alr runs the cmd ```py
@client.command(aliases=['swaggy', 'swagger'])
@commands.cooldown(1, 30, commands.BucketType.user)
async def swag(ctx):
await open_account(ctx.author)

swagger = ["Your fans give you $* for being a swag master."]
money = random.randint(100, 500)

await cluster.Botswag.Accounts.update_one({"_id": str(ctx.author.id)})
embed = discord.Embed(title="Swaggy Af",
                      description=random.choice(swagger).replace('*', str(money)),
                      color=discord.Color.green())
embed.set_footer(text="N.B. This command is under development. It may not work as expected", icon_url='https://cdn.discordapp.com/avatars/748609140896694394/216c2e4a3ab7574609c049a7d3ebbdaa.webp?size=1024')
await ctx.send(embed=embed)```
slate swan
#

what not found exception? from your db or the discord module

sweet merlin
slate swan
wary zenith
untold flax
#

@bot.event
async def on_reaction_add(reaction, user):
if reaction.emoji == "👑":
role = user.guild.get_role(947333237951315971)
wanted from office by reaction more not of the post?

slate swan
#

change it to "x"

wary zenith
sweet merlin
slate swan
wary zenith
slate swan
slate swan
#

!d discord.TextChannel.permissions_for

unkempt canyonBOT
#

permissions_for(obj, /)```
Handles permission resolution for the [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") or [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role").

This function takes into consideration the following cases...
slate swan
kind cargo
#

can anyonew help me out?

slate swan
#

whats your problem though?

kind cargo
#

i dont have like an problem but, i need help to code

wary zenith
slate swan
#

or is the command made using on_message event?

wary zenith
#

brehhhh

#

my repl keeps activating for no reason

#

thats why

#

thanks

slate swan
sweet merlin
slate swan
sweet merlin
slate swan
#

so you may get the message author's permission using perms = channel.permissions_for(message.author) , set send_messages =False perms.send_messages=False and use it as the permission in set_permissions

sweet merlin
#

ok

#

ill try

honest shoal
#

can I set sticker in embed?

slate swan
#

no, and why would you do that

maiden field
#

does anyone know why vs code returns this error File "c:\Users\lange\Documents\Python Bot\VibecordModmail\bot.py", line 7, in <module> from discord_ui import Button File "C:\Users\lange\AppData\Local\Programs\Python\Python37\lib\site-packages\discord_ui\__init__.py", line 34, in <module> from .client import * File "C:\Users\lange\AppData\Local\Programs\Python\Python37\lib\site-packages\discord_ui\client.py", line 1, in <module> from .cogs import BaseCallable, InteractionableCog, ListeningComponent File "C:\Users\lange\AppData\Local\Programs\Python\Python37\lib\site-packages\discord_ui\cogs.py", line 5, in <module> from .slash.types import BaseCommand, ContextCommand, MessageCommand, SlashCommand, SlashSubcommand, UserCommand File "C:\Users\lange\AppData\Local\Programs\Python\Python37\lib\site-packages\discord_ui\slash\__init__.py", line 20, in <module> from . import ext File "C:\Users\lange\AppData\Local\Programs\Python\Python37\lib\site-packages\discord_ui\slash\ext\__init__.py", line 13, in <module> from .builder import * File "C:\Users\lange\AppData\Local\Programs\Python\Python37\lib\site-packages\discord_ui\slash\ext\builder.py", line 4, in <module> from ..types import ( File "C:\Users\lange\AppData\Local\Programs\Python\Python37\lib\site-packages\discord_ui\slash\types.py", line 31, in <module> class OptionDataPayload(t.TypedDict): AttributeError: module 'typing' has no attribute 'TypedDict' when I add from discord_ui import Button to my code? (discord ui is installed)

quick gust
honest shoal
quick gust
#

then what sarthak said

honest shoal
#

I'm using disnake

maiden field
#

does discord py even support stickers?

honest shoal
#

2.0 does i think

maiden field
#

maybe you can get the sticker's link and put it into the embed then

honest shoal
#

is there any thing like embed.set_sticker()?

maiden field
#

no

honest shoal
#

then how

boreal ravine
#
FileNotFoundError: [Errno 2] No such file or directory: './db/shop.jsonc'
``` what
mental escarp
slate swan
#

hey i tried to make an welcome event and when someone joins nothing happend

boreal ravine
honest shoal
honest shoal
slate swan
#

yeah

#

heres the code
@client.event
async def on_member_join(member):
channel = client.get_channel(947526938577240095)
await channel.send(f'{member} has joined the server')
print(f"Welcome to city 17 {member}")

honest shoal
#

show the code then

slate swan
#

im using pycord

slate swan
maiden field