#discord-bots

1 messages · Page 655 of 1

steep drift
#

?

#

yeah use uptime robot it is free and good

#

my opinion though

slate swan
slate swan
#

Has 2gb of ram

steep drift
#

even so uptime robot will work

slate swan
#

Depending on how many members the guilds have it will be overkill

steep drift
#

Not everything is always behind a pay wall my man

slate swan
#

Free isnt always good either

steep drift
#

But Uptime Robot is good

#

trust me

#

lol

slate swan
#

Any free vps is horrible compared to premium ones

#

If it works for you well good for you

#

reloading modules, Is there one with the help of a command?

#

Hi

#

How can i make my bot do that

heavy folio
slate swan
#

Whos talking about replit?

heavy folio
#

gcp offers free $300 credit

#

aws is free for students

heavy folio
slate swan
slate swan
steep drift
#

yeah

steep drift
#

¯_(ツ)_/¯

slate swan
slate swan
slate swan
slate swan
heavy folio
#

i thought you meant what zones and regions there are for gcp

#

anyways aws is good if your a student, just need to sign up with student info

worldly bane
#

Not really discord-bots related

#

with variables?

#

Well if you use database its different

#
a = 100
b = 1000
transfer_amount=50
newWallet = a+tranfer_amount
newBank = b+transfer_amount
a, newWallet = newWallet, a
b, newBank = newBank, b
#

@slate swan

#

a and b is wallet and bank

stark lintel
#

if i have a function or definition thing i want to run in a code, but the actual definition is in another code

#

this is discord bot related

#

its still got to do with the buttons

pliant lotus
#

How do i format a request using json.dumps with aiohttp?

stark lintel
#

how do i run it

#

like i know there is a way

worldly bane
#

you have a function in another py file?

stark lintel
#

nonononon

#

here, let me make an example...

#

python file 1:

def hello():
  print("hi")
worldly bane
#

the one they say is transfer_amount

stark lintel
#

python file 2:

print("hello")
#

lets say...

#

i wanted to run python file 1 in python file 2

#

without copying over the code

#

i know there is a way to do this, i just dont remember how

worldly bane
#

so
print(hello())?

stark lintel
#

yeah

#

i guess so

#

how would i import file 1 though

worldly bane
#

use import file1

stark lintel
#

that's it

#

i dont need to add any .py or anything

worldly bane
#

if it doesn't work make a folder then place the py file in it then ```py
from folder import file1

worldly bane
stark lintel
#

thank you, ill try that

slate swan
#

@stark lintel you can import the local file and call the function

#file 1

def func():
    print("function")

#file 2

import file1

file1.func()

output:

function
stark lintel
#

thanks both of you, this will help

slate swan
#

Classes can also be done in separate files

worldly bane
#
transfer_amount = await bot.wait_for('How much are you depositing?', check=check(ctx.author))
visual island
worldly bane
#

does this work?

visual island
worldly bane
#

try it

worldly bane
#

ttry this

#

try it then tell me if there is an error

#

you should use it still

#

I said to ignore it

#

I was wrong lol

#

👍

full valley
#

does await embed.delete() not work?

worldly bane
#
memberData.wallet = memberData.wallet
memberData.bank = memberData.bank

what is this for @slate swan ?

worldly bane
#

did you convert it to int?

#

int(transfer_amount)

slate swan
worldly bane
slate swan
worldly bane
#

for newWallet and bank

#

shouldn't wallet be -

#

not +

#

can you place print (int(transfer_amount))

#

and tell me what is prints?/

polar ice
#

                category = discord.utils.get(interaction.guild.categories, name="Tickets")
                if trusted_role is None:
                    await interaction.guild.create_role(name="Trusted")
                if category is None:
                    new_category = await interaction.guild.create_category(name="Tickets")
                    category = await interaction.guild.fetch_channel(new_category.id)
                overwrites = {
                    interaction.guild.default_role: discord.PermissionOverwrite(read_messages=False),
                    member: discord.PermissionOverwrite(read_messages=True, send_messages=True),
                    administrator_role: discord.PermissionOverwrite(read_messages=True, send_messages=True)
                }
                ticket_channel = await category.create_text_channel(f'ticket-{randint(100, 999)}',
                                                                    overwrites=overwrites)```

Any idea why im getting

```    category = await interaction.fetch_channel(new_category.id)
AttributeError: 'Interaction' object has no attribute 'fetch_channel'```
visual island
#

you dont even have wait_for in your code

#

then how would you wait for the reply

late wigeon
#

how do I create a thread that handles discord interactions and closes when it's completed?

fringe harness
#

does anyone here wanna create a discord bot collaboratively, friend req and dm if so

late wigeon
#
loop = asyncio.get_event_loop()
loop.create_task(self.team_find_thread(interaction))

I tried this but the active thread count just keeps increasing till the bot crashes

loud junco
#

.paste

#

.p paste

#

!paste

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.

fringe harness
#

asdass

#

yo

#

anyone bot devs

#

in discord py

#

that have some knowledge

#

can we make a bot together

#

dm me if you want to do it

final iron
#

I doubt anyone will if you don't give any information

#

i.e What is the bot made for? How long should the project take? How much experience do you have? Do you have a model and list of commands you want to work towards creating?

fringe harness
#

The bot is basically a calculator, but instead of the basic functions, there will be different ones for different subjects like for example if u do "!geometry" there will be like sin, tan, cos, distance formula, mdpt formula, etc. It can take as long it it will take, I have at least 1 year of experience programming, I have ideas for certain subjects like algebra and geometry, and if we have time we can expand more

slate swan
#

Hi, this doesn't seem to be working at all... any idea what my problem is? Not getting the print or the csv updated

#

oh wait, i'm dumb

#

it's on_guild_join and not on_join_guild 😭

boreal ravine
#

jesus christ these variable names

worldly bane
#

why won't you just let it be .deposit 100 like dank memer?

#
@bot.command()
async def deposit(ctx, amount: int):
    memberData = loadMemberData(ctx.author.id)

   
    newWallet = memberData.wallet - amount
    newBank = memberData.bank + amount
    memberData.wallet, newWallet = newWallet, memberData.wallet
    memberData.bank, newBank = newBank, memberData.bank

    saveMemberData(ctx.author.id, memberData)
drifting arrow
#

Is discordpy updated to use the new button features? or is there another discord library?

sullen shoal
#

discord.py has everything except slash command implementation

#

which will be forced to bots with 75+ server count after a year

spring verge
#

Do you guys think that you can make a career out of discord bot development?

sullen shoal
#

no

supple thorn
#

no

spring verge
#

Hmm but there are some examples like dank memer etc who have their patron pages

#

I think very few people can still make a career out of it (depends on their luck and their bot popularity)

sullen shoal
#

im pretty sure just making discord bot is not the developer's career

#

it is just the developer's anothet thing to earn money from

spring verge
#

Hmm I agree on that statement

#

So more like a side source of income

sullen shoal
#

yes

slate swan
spring verge
#

It can open you to various opportunities... Like imagine ur bot gets very famous then you can open a website etc and promote your other related projects via it? Just an opinion .

slate swan
#

You dont get money from discord for making a bot and you rely on donations or people who buy premium plans of your bot

spring verge
#

Yea true

#

Well it's best for experience then I guess?

#

Like how databases work etc

slate swan
#

Only thing your learning is about oop and other stuff

spring verge
#

Hmm I think it's mostly oop + rdbms

slate swan
spring verge
#

I mean even normal bots will need it depending upon features they want to provide .. like dbs can be used for a lot of things.. so imo every type of bot might need it even if it's big or small

#

I think it depends on the dev how much far they want to go with the project

slate swan
#

Yes really depends on what the bot does

sullen shoal
#

you can get the experience of some basic database management
i dont think anyone would care about the other stuff of your bot. I personally believe it will be better if try to make your own discord.py instead of learning to use it

drifting arrow
spring verge
pliant gulch
#

No point in really monetising things, especially since there is gonna be 50+ other bots that do the same thing your locked feature does for free

spring verge
#

Hmm

pliant gulch
#

There is a lot of library abstraction in discord.py that makes things easy for the user but a lot of hard stuff is done backend, good experience

sullen shoal
pliant gulch
#

Intents are easy, just identify to the gateway with them

#

Then the websocket sends relevant payloads

spring verge
pliant gulch
#

Not really

sullen shoal
#

i find it pain in the ass

pliant gulch
#

I know if I wanted a lite bot, I wouldn't want to receive payloads for event's I don't care about E.g PRESENCE_UPDATE

upbeat otter
sullen shoal
#

i tried to connect to the discord api, my websocket didn't crash, i got that "hello" response and the "ready" event but then after some time my bot goes down

pliant gulch
sullen shoal
#

yeah

#

maybe my math was wrong

pliant gulch
#

How did you calculate the intents?

sullen shoal
#

of the heartbeat interval

sullen shoal
#

i didnt, i just pasted the default one for testing

#

that's why i find it pain in the ass

pliant gulch
#

If you send a correct payload response to IDENTIFY and start the heartbeat it should be working fine

sullen shoal
#

im probably gonna try doing it someday again

pliant gulch
#

Maybe you aren't handling resume and reconnect events

sullen shoal
#

oh yeah, i didn't. maybe that was causing it

pliant gulch
#

Or you don't have a for-loop reading messages from the websocket

#

Could be a lot of things

sullen shoal
#

but i didn't get any response to that says to resume

pliant gulch
#

Do you actually have a loop to read messages from the websocket??

sullen shoal
#

yes

#

a while loop to receive the events

#

i got the ready event

pliant gulch
#

If the gateway sends a RESUME or RECONNECT operation code your while loop should get the event

pliant gulch
sullen shoal
#

i only got the ready event

#

yes

pliant gulch
#

A proper connection should have READY -> GUILD_CREATE X amount of guilds

sullen shoal
#

only that one

#

i think it had it

#

my bot was in one server

#

so there were a few ids

pliant gulch
#

You should still receive a GUILD_CREATE for that guild

#

Like here in my discord api wrapper

sullen shoal
#

or maybe it was just the bot because my intents were wrong 🤷‍♂️

sullen shoal
#

nothing else

pliant gulch
#

What intents value are you passing to the IDENTIFY response

sullen shoal
#

i forgot now and i currently dont have access to my pc

final iron
slate swan
#
@bot.command()
async def ign(ctx, ign:str):
    user_exists = False
    for i in range(0,len(Json_Items)): #It doesn't exist
        for x in Json_Items[i]:
            if int(x) == int(ctx.message.author.id):
                if len(Json_Items[i][x]["User IGN"]) == 0:
                    Json_Items[i][x]["User IGN"] = ign
                    await ctx.send(f"Registered your IGN as:{ign}")
                    await abc(ctx)
                    user_exists = True
                    return

How can I get this code to pass ign to the json?
It is originally defined as "User IGN": "", and doesn't change when this code is ran

#

u can use json methods instead

#

like dump

boreal ravine
#

Is it possible to get a nonetype on context

sullen shoal
sick birch
#

What are you really trying to accomplish?

boreal ravine
sick birch
#

Sounds like your question is what you think is a solution to another issue

boreal ravine
#

yes, i guess

sick birch
#

Right, what is it?

pliant gulch
#

It shouldn't be possible to get NoneType for context, that is granted you haven't overridden get_context of Bot

sick birch
#

It's a really odd question, which is why I immediately sniffed out the possibility of an XY question haha

boreal ravine
# sick birch Right, what is it?

no need, i was getting nonetype on sending a message to a channel that wasn't cached yet, and I had channel.send and ctx.send so i got confused lol

sick birch
#

I see

sullen shoal
#

ctx.send is a shortcut to ctx.channel.send

pliant gulch
#

Your Messageable.send was returning None instead of a message?

#

If that's what your saying that makes no sense at all

sick birch
#

No, it was giving a NoneType has no method "send" error, or something along those lines

#

Simple issue really, channel was not found/not cached

pliant gulch
#

Oh ok

hazy agate
#

see my calculator code

#

buttons = [
[
Button(style=ButtonStyle.grey, label='1'),
Button(style=ButtonStyle.grey, label='2'),
Button(style=ButtonStyle.grey, label='3'),
Button(style=ButtonStyle.blue, label='x'),
Button(style=ButtonStyle.red, label='Exit')
],
[
Button(style=ButtonStyle.grey, label='4'),
Button(style=ButtonStyle.grey, label='5'),
Button(style=ButtonStyle.grey, label='6'),
Button(style=ButtonStyle.blue, label='÷'),
Button(style=ButtonStyle.red, label='←')
],
[
Button(style=ButtonStyle.grey, label='7'),
Button(style=ButtonStyle.grey, label='8'),
Button(style=ButtonStyle.grey, label='9'),
Button(style=ButtonStyle.blue, label='+'),
Button(style=ButtonStyle.red, label='Clear')
],
[
Button(style=ButtonStyle.grey, label='00'),
Button(style=ButtonStyle.grey, label='0'),
Button(style=ButtonStyle.grey, label='.'),
Button(style=ButtonStyle.blue, label='-'),
Button(style=ButtonStyle.red, label='=')
],
]

#

def calculator(exp):
o = exp.replace('x', '*')
o = o.replace('÷', '/')
result = ''
try:
result =str(eval(o))
except:
result='An error Occured'
return result

boreal ravine
#

Copied

sullen shoal
#

eval

hazy agate
#

client.command()
async def info(ctx):
name = str(ctx.guild.name)
description = str(ctx.guild.description)

owner = str(ctx.guild.owner)
id = str(ctx.guild.id)
region = str(ctx.guild.region)
memberCount = str(ctx.guild.member_count)

icon = str(ctx.guild.icon_url)

embed = discord.Embed(
    title=name + " Server Information",
    description=description,
    color=discord.Color.green()
hazy agate
#

)
embed.set_thumbnail(url=icon)
embed.add_field(name="Owner", value=owner, inline=True)
embed.add_field(name="Server ID", value=id, inline=True)
embed.add_field(name="Region", value=region, inline=True)
embed.add_field(name="Member Count", value=memberCount, inline=True)

await ctx.send(embed=embed)
boreal ravine
#

Bruh

hazy agate
boreal ravine
#

Wtf

hazy agate
#

that interaction failed

boreal ravine
hazy agate
#

wait join thi server to seee wats the problem

boreal ravine
#

no

hazy agate
#

okok

#

i will send screenshot

#

wat

slate swan
#

Wait nvm😭

hazy agate
#

u mean token right?

slate swan
#

Nah nvm nvm😭

verbal cairn
#

Anyone good with tasks

sage otter
#

Like let other people use it

pliant gulch
#

Eval 👁️👄 👁️

hazy agate
#

who cares

sage otter
#

If so enjoy getting fucked by eval

hazy agate
#

oof

sullen shoal
boreal ravine
#

Dude, it's just a calculator, read his code

hazy agate
boreal ravine
#

Bruh

sage otter
boreal ravine
sage otter
#

He doesn’t even filter out anything

hazy agate
#

wait

boreal ravine
sullen shoal
#

¯\_(ツ)_/¯

hazy agate
#

it tells

#

that interaction failed

#

when ever

#

i make

boreal ravine
hazy agate
#

no erroe

#

only 1 problem

sage otter
verbal cairn
#

How tf do u paginate embeds

sullen shoal
#

!d discord.ui.View

unkempt canyonBOT
#

class discord.ui.View(*, timeout=180.0)```
Represents a UI view.

This object must be inherited to create a UI within Discord.

New in version 2.0.
verbal cairn
slate swan
sage otter
#

or wait…. I could be wrong here

sullen shoal
sage otter
#

I could be getting exec and eval mixed up

boreal ravine
hazy agate
#

wat is @novel apex for?

#

to messsage?

boreal ravine
hazy agate
#

i made 1

boreal ravine
#

nice

hazy agate
#

but notsuccesful

#

it worked

normal ginkgo
hazy agate
#

for 2days then went go crazy aaaaaa

hazy agate
normal ginkgo
#

?

sage otter
sullen shoal
#

its still not a good thing to fucking put eval directly

#

use some filtered ones

normal ginkgo
sick birch
#

parsing and solving expressions manually is fun 👍

upbeat otter
sick birch
#

helps you understand how it actually works, stacks are very very helpful as well. you can try to do this instead of eval

normal ginkgo
upbeat otter
normal ginkgo
upbeat otter
# normal ginkgo

but.......doesnt the write function only print statements and not write anything

normal ginkgo
#

Look at the error

upbeat otter
#

I did smh

normal ginkgo
#

It doesnt find the file

#

Why is that

upbeat otter
#

wait

normal ginkgo
sullen shoal
normal ginkgo
#

Where

upbeat otter
#

terminal

sullen shoal
normal ginkgo
#

In what part of the code ofc

upbeat otter
normal ginkgo
#

At the tip?

sullen shoal
#

before the open

normal ginkgo
#

Like 43

#

Line*

sullen shoal
#

yeah

#

wait

#

put breakpoint() there

#

we will debug later

#

43

normal ginkgo
#

Ok

sick birch
#

you forgot the ()

#

after the os.getcwd

sullen shoal
#

you didnt call it

normal ginkgo
#

Whoops

sullen shoal
#

import os

normal ginkgo
#

I did

sullen shoal
#

then get os.getcwd()

#

in the debug session

#

type import os there

#

then execute os.getcwd()

normal ginkgo
#

Ok

vapid ingot
#

How can I embed images using nextcord?

normal ginkgo
sullen shoal
sullen shoal
#

(pdb) is an input field

normal ginkgo
#

Lmao which line

sullen shoal
#

its an input field

normal ginkgo
#

No…

sullen shoal
#

just run and put import os

#

there

#

ok i guess i am wasting more time by doing this

#

@normal ginkgo remove everything we did then put print(os.getcwd())

#

on pine 43

normal ginkgo
#

Ok

#

I imported os btw

sullen shoal
#

!d os.listdir

unkempt canyonBOT
#

os.listdir(path='.')```
Return a list containing the names of the entries in the directory given by *path*. The list is in arbitrary order, and does not include the special entries `'.'` and `'..'` even if they are present in the directory. If a file is removed from or added to the directory during the call of this function, whether a name for that file be included is unspecified.

*path* may be a [path-like object](https://docs.python.org/3/glossary.html#term-path-like-object). If *path* is of type `bytes` (directly or indirectly through the [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike "os.PathLike") interface), the filenames returned will also be of type `bytes`; in all other circumstances, they will be of type `str`.

This function can also support [specifying a file descriptor](https://docs.python.org/3/library/os.html#path-fd); the file descriptor must refer to a directory.

Raises an [auditing event](https://docs.python.org/3/library/sys.html#auditing) `os.listdir` with argument `path`.
sullen shoal
#

pass the value of that to it

#

then print it

dry pelican
#
from discord import DiscordException, Embed, Forbidden, Thread

By the way, importing Thread is right?

shadow wraith
#

wait discord threads already exist on dpy 2.0

#

woah i didnt know that

dry pelican
#

Nah, I can't import it

#

That's why I was confirming if it was possible..

normal ginkgo
dry pelican
#

Or my code's wrong

shadow wraith
#

wait discord threads don't exist on dpy 2.0

#

woah i know that

dry pelican
#

Don't know..

sullen shoal
normal ginkgo
#

Ok

untold token
untold token
#

!d discord.Embed.set_image

unkempt canyonBOT
#

set_image(*, url)```
Sets the image for the embed content.

This function returns the class instance to allow for fluent-style chaining.

Changed in version 1.4: Passing [`Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty") removes the image.
normal ginkgo
untold token
normal ginkgo
#

Yeah

untold token
#

Hmm

#

That's not supposed to happen

normal ginkgo
untold token
#

Right so this would work

#

I guess its repl having some issues

#

Try kill 1 in shell

normal ginkgo
#

U think?

shadow wraith
#

dont use replit for discor bots unless your repl is private

normal ginkgo
#

How?

untold token
#

kill 1 resets the repl

#

Do that in shell

heavy folio
#

use vsc or some proper ide

untold token
#

Also this isn't the right channel btw

shadow wraith
untold token
#

@normal ginkgo you should get a help channel

shadow wraith
untold token
#

Although I use pycharm

shadow wraith
normal ginkgo
untold token
#

Dobe?

normal ginkgo
#

Done*

untold token
#

Okay

#

Now run it again

normal ginkgo
#

Same error

untold token
#

Okay hmm

untold token
#

This isn't the proper channel

upbeat otter
#

Try making a new repl

sullen shoal
#

they didn't put ./

untold token
#

New repl won't solve the issue and let's not continue here

untold token
lament mesa
untold token
lament mesa
#

oh ok_handbutflipped

vapid ingot
upbeat otter
boreal ravine
# vapid ingot
  1. Why are you using bot.say
  2. it's nextcord.Color.blue() not nextcord.color.blue()
  3. Error says you forgot a comma, try running the command again
#

!d nextcord.Colour.blue <==

unkempt canyonBOT
#

classmethod blue()```
A factory method that returns a [`Colour`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Colour "nextcord.Colour") with a value of `0x3498db`.
vapid ingot
#

Client doesn't work

#

so I thought I'd use bot

untold token
#

!d disnake.ext.commands.Param

boreal ravine
# vapid ingot
  1. bot.say doesn't exist (except if your using an old version of dpy)
  2. add a parameter to the command
untold token
#

Oh woah

#

That's cool

boreal ravine
#

indeed

vapid ingot
#

Why do I keep getting another instance of VSC somehwere, I have to keep shutting my pc off to fix that and it's annoying

untold token
#

Multiple instances

#

You can reset the token, which will stop all the instances immediately

upbeat otter
#

^

untold token
#

If you could run multiple times on vsc, it opens up new instances

heavy folio
#

you host on a vps not replit

boreal ravine
#

replit is good

untold token
#

Yeah I know lol

boreal ravine
#

use bot i guess

upbeat otter
vapid ingot
#

bot doesn't work either

untold token
upbeat otter
untold token
#

Yeah

boreal ravine
lament mesa
#

bot.run

boreal ravine
vapid ingot
boreal ravine
#

why are you using client and bot

upbeat otter
lament mesa
boreal ravine
#

do you know what variables are? @vapid ingot

upbeat otter
#

lol

untold token
#

Then you should learn basic python before this

upbeat otter
#

told ya

untold token
untold token
#

They are advanced

#

And if you don't know basic, you won't be able to do anything

upbeat otter
vapid ingot
#

When I try to learn basic python it leads me no where and I don't retain the info

upbeat otter
vapid ingot
#

I'm just trying to learn as I go I guess

slate swan
vapid ingot
boreal ravine
#

will to learn yes

untold token
#

Its simple logic really

#

If you want fly a plane, you need to know the plane

vapid ingot
#

Thanks guys I appreciate that and I will do that, I just want to know how to embed atm

untold token
#

You can't fly a plane but not know how it works and what its controls are

boreal ravine
#

I mean, when I first made a bot, I didn't know python but I learnt it on the way 😎

vapid ingot
#

^^

untold token
untold token
#

That's like sitting on a rocket, learning how to add 2 + 2

upbeat otter
#

Was I the only one who watched a 13 hour tutorial first 🥲

lament mesa
slate swan
boreal ravine
slate swan
upbeat otter
slate swan
boreal ravine
slate swan
#

Watched a 5hour tutorial about python after that i realized it was python ||2.0|| 😔

lament mesa
upbeat otter
upbeat otter
upbeat otter
#

@vapid ingot you learned algebra?

slate swan
vapid ingot
boreal ravine
vapid ingot
upbeat otter
vapid ingot
vapid ingot
#

I don't understand why you need to drown out the knowledge of others with your negativity.

lament mesa
vapid ingot
daring olive
#

please refrain from non-constructive messages

vapid ingot
#

Thank you mina

upbeat otter
#

what did I even do pithink

vapid ingot
# lament mesa can you send all of the code
from nextcord.ext import commands  
bot = commands.Bot(command_prefix="!")
@bot.command(name="Join")
async def join(ctx: commands.Context):
    await ctx.send("""Upon entering our discord you received a dm from @spring summit 
Please follow all instructions listed there
If you need further assistance please head to #❓support 
Here's an example of how I joined //add RogueAlien86
Enter your gamertag **exactly** how it appears in miencraft""")

@bot.command()
async def displayembed():
    embed= nextcord.Embed(
        title= 'Title',
        description = 'Plot Test',
        color = nextcord.Color.blue()
    )

    embed.set_footer(text='footer')
    embed.set_image(url='https://cdn.discordapp.com/attachments/748496947291226172/915417044986503198/pic_1.png')
    embed.set_thumbnail(url='https://cdn.discordapp.com/attachments/776192375323230259/917149822748860446/topia.png')
    embed.set_author(name='Author Plot Topia')
    icon_url='https://cdn.discordapp.com/attachments/776192375323230259/917151883427217459/pastel.png'
    embed.add_field(name='Field Name', value='Field Value', inline=False )
    embed.add_field(name='Field Name', value='Field Value', inline=True )
    embed.add_field(name='Field Name', value='Field Value', inline=True )

    await bot.say(embed=embed)

bot.run("token")```
daring olive
#

that's everyone here, I'm not singling anyone out

upbeat otter
vocal plover
#

bot.say isnt a method

slate swan
#

Wasnt that deprecated?

vocal plover
#

your command should take a parameter, ctx, which you can reply to or use to send to the channel

vocal plover
slate swan
worldly bane
#

that was before the rewrite lol

vocal plover
#

3 years ago or so iirc

worldly bane
#

at the top he uses ctx then at the bottom he uses say

torpid dew
#
@client.command()
async def hack(ctx):
  botmsg = await ctx.reply(f'Commencing hack!')
  
  await asyncio.sleep(5)

  botconfirm = await ctx.edit(botmsg=f"Successfully hacked into their device!")

i am making hack command, first msg gets sent, 2nd doesnt

#

the edit msg doesnt get sent

#

i import asyncio

vocal plover
#

botmsg isnt a parameter of edit

#

did you mean content?

torpid dew
upbeat otter
vocal plover
vapid ingot
torpid dew
#
@client.command()
async def hack(ctx):
  botmsg = await ctx.reply(f'Commencing hack!')

  await asyncio.sleep(5)
  
  botconfirm = await ctx.content.edit(botmsg=f"Successfully hacked into their device!")
#

idk if i did it wrong

boreal ravine
#

context has no attr content

#

!d discord.ext.commands.Context.message <= use this

unkempt canyonBOT
torpid dew
#

ok

slate swan
vapid ingot
#

How can I change my token as well? I didn't realize I shared the token earlier

vocal plover
torpid dew
#

i think i did it wrong...

@client.command()
async def hack(ctx):
  botmsg = await ctx.reply(f'Commencing hack!')

  await asyncio.sleep(5)
  
  botconfirm = await discord.ext.commands.Context.message.edit(botmsg=f"Successfully hacked into their device!")
vocal plover
#

You need to edit the instance, not the type

vocal plover
#

you're trying to edit discord.ext.commands.Context.message which is a property on a type (Context) rather than the actual message

vocal plover
#

you've already saved the message earlier to botmsg, so use that

vocal plover
#

yes, and then proceeded to ignore that variable

worldly bane
vocal plover
#

you need to use edit on that

torpid dew
#

botmsg.edit

vocal plover
#

yes

worldly bane
#

finally

slate swan
#

anyone know this theme used in this vid; https://www.youtube.com/watch?v=AquIwgga0ek&ab_channel=Lucas ( i do not watch lucas )

In this video we learn about events and how to use them in our discord bot.

NOTE: Discord released a breaking change a while back that prevents bots from receiving information about various events unless they opt into it. As I cannot edit the video, if you want a quick explanation of what you will need to do, you can join my discord help server...

▶ Play video
slate swan
#

trying to make a channel with slowmode pre-enabled(manually), its a verification channel, so you send "(pre)verify" and you get dmed a captcha to fill out blah blah blah

#

but using this source

def checkk(message):
    return message.channel.id == 917289006335680592

@bot.event
async def on_message(message):
    purgeChannel = bot.get_channel(917289006335680592)
    await purgeChannel.purge(limit=1, check=checkk)``` none of my commands work
#

why is that

slate swan
worldly bane
#

await bot.process_commands(message)

#

u beat me lol

slate swan
#

lmao thanks

#

alright question two, how can i make a variable check for another variables output

#

so lets say i have a bunch of captcha images

worldly bane
#

what

slate swan
#

and captcha 1 gets picked (of ten)

#

how can i make the bot tie a specific message to that captcha

#

god thats hard to explain

sullen shoal
#

idk what you talking bout

worldly bane
#

can you send the code so I can understand you better

vapid ingot
#

I've given up on embeds for the night

After trying to add another command I get Command "social" is not found

async def social(ctx: commands.Context):
    await ctx.send("""First time followers can earn themselves some cool rewards. Be sure to ask a staff member about some extra perks!
https://vm.tiktok.com/ZM8qmyREn/
https://www.youtube.com/channel/UCDi0BvhS_CDDhyglD5MnOGQ""")```
worldly bane
polar ice
#

                category = discord.utils.get(interaction.guild.categories, name="Tickets")
                if trusted_role is None:
                    await interaction.guild.create_role(name="Trusted")
                if category is None:
                    new_category = await interaction.guild.create_category(name="Tickets")
                    category = await interaction.guild.fetch_channel(new_category.id)
                overwrites = {
                    interaction.guild.default_role: discord.PermissionOverwrite(read_messages=False),
                    member: discord.PermissionOverwrite(read_messages=True, send_messages=True),
                    administrator_role: discord.PermissionOverwrite(read_messages=True, send_messages=True)
                }
                ticket_channel = await category.create_text_channel(f'ticket-{randint(100, 999)}',
                                                                    overwrites=overwrites)```

Any idea why im getting

```    category = await interaction.fetch_channel(new_category.id)
AttributeError: 'Interaction' object has no attribute 'fetch_channel'```
slate swan
#

ok so, ive got an idea to explain what i need

polar ice
slate swan
#

this is captcha 1, if someone executes my verify command, it sends them this in dms (ill obviously format it in an embed and make it pretty), but if this image is selected, the bot knows that if the user replys with "KZEXEH", they've successfully passed the verification. otherwise, theyve failed and must re-execute the command. lets say i have 3 captchas, how can i tie the proper verification key (such as "KZEXEH") to its proper coresponding captcha image

#

hopefully that makes sense

upbeat otter
#

it did

slate swan
#

never used dicts

upbeat otter
#

wha....

slate swan
#

OK SO im self taught but ik what im doing, just need steering in the right direction

#

not spoonfeeding, but steering

worldly bane
#
dictionary={
"KZEXEH": "some.png"
}
upbeat otter
slate swan
#

and how would i check for it

#

like, as a reference

upbeat otter
upbeat otter
worldly bane
#

dictionary.get("captcha1.png")

jade tartan
#
@client.event
async def on_member_join(member, get):
        guild = client.get_guild(730651046459998218)
        channel = await (await client.fetch_channel(885464532959526913)).send(f'Welcome to server **{member.mention}**.')
        role = get(member.guild.roles, name='Unverified')
        role = get(member.guild.roles, name='•.¸¸.•:Colours:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Verification:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Age:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Gender:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Sexuality:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Preference:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Height:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Distance:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Ethnicity:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Hobbies:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Relationship:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Location:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•::•.¸¸.•`Seeking`•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:DM:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Levels:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        role = get(member.guild.roles, name='•.¸¸.•:Games:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•')
        await member.add_roles(role)
        print(f"{member.name} has joined the server")
Ignoring exception in on_member_join
Traceback (most recent call last):
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
TypeError: on_member_join() missing 1 required positional argument: 'get'
slate swan
#

so if captcha2?

#

thats the part i dont understand

jade tartan
#

Am guessing that i have to change the variable

#

in this case

worldly bane
#

just put member

jade tartan
#

well it wants me to define get as i do want it to add multiple roles

#

when a member joins

#

so

slate swan
upbeat otter
#

string

jade tartan
#

Wdym iterate through them?

upbeat otter
#

I dont understand your question now

upbeat otter
slate swan
shadow wraith
#

dm me a command idea i need those 🤔

upbeat otter
upbeat otter
#

just convert it after the response is back

slate swan
shadow wraith
#

crab

upbeat otter
unkempt canyonBOT
#

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

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
shadow wraith
#

^

slate swan
#

thanks ill look into that

upbeat otter
#

welcomee

#
async def deposit(ctx, amount):
  amount = int(amount)
shadow wraith
#

jk idk if that works

jade tartan
upbeat otter
upbeat otter
#

as many as you want

jade tartan
#

ayeeee ok no matter what the limit is ?

upbeat otter
#

Add only 5 roles at a time that is

jade tartan
upbeat otter
#

whats the point of sending this?

transfer = await ctx.channel.send('How much are you willing to deposit, sir? ')
upbeat otter
#

yes

transfer = await ctx.channel.send('How much are you willing to deposit, sir? ')

^^remove this

#

yep

#

and send a message to the user at the end

#

and see if it works

jade tartan
#

thanks

#

much more readable

worldly bane
#

try and except int(transfer)

upbeat otter
#

the transfer parameter is where they mention the amount

worldly bane
#

you should place a check since they could place pls dep what

upbeat otter
#

yeah

worldly bane
#

try and except could do it

upbeat otter
#

and that command is gonna give a lot of errors since there are a lot of possibilities in an economic command

vapid ingot
jade tartan
upbeat otter
jade tartan
#

ok

upbeat otter
# vapid ingot

an embed object requires arguments, plain text wont work

jade tartan
#

Am bad at explaining some things

upbeat otter
#

!d discord.Embed

unkempt canyonBOT
#

class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.

len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.

bool(b) Returns whether the embed has any data set.

New in version 2.0.

Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").

For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
jade tartan
#
async def on_member_join(member, ctx, get):
        guild = client.get_guild(730651046459998218)
        channel = await (await client.fetch_channel(885464532959526913)).send(f'Welcome to server **{member.mention}**.')
        roles_list = ["•.¸¸.•:Colours:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•", "•.¸¸.•:Verification:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Age:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Gender:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Sexuality:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•"]
        for roles in roles_list:
            role = discord.utils.get(ctx.guild.roles, name=roles)
        member.add_roles(role)
        roles_list = ["•.¸¸.•:Preference:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Height:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•"]
            member.add_roles(role)
    
upbeat otter
jade tartan
#

my english is my 2nd langauge

#

so

worldly bane
upbeat otter
# jade tartan ```@client.event async def on_member_join(member, ctx, get): guild = cli...

only one

roles_list = ["•.¸¸.•:Colours:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•", "•.¸¸.•:Verification:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Age:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Gender:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Sexuality:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•"]
for roles in roles_list:
        role = discord.utils.get(ctx.guild.roles, name=roles)
        member.add_roles(role)

will work

vapid ingot
upbeat otter
#

let me see role rate limits

upbeat otter
worldly bane
vapid ingot
jade tartan
worldly bane
#
try:
  int(transfer)
except Exception:
  #respond
worldly bane
upbeat otter
# vapid ingot First command isn't embeded and it worked

smh, the Embed object requires title, description, color <--- optional

# an embed example
embed = nextcord.Embed(title="smh", description="smh", color=nextcord.Color.blue())
embed.add_field(name="smh", value="smh")
await ctx.send(embed=embed)
worldly bane
#

detect error

jade tartan
boreal ravine
upbeat otter
upbeat otter
worldly bane
upbeat otter
boreal ravine
jade tartan
worldly bane
#

never tried it

maiden fable
worldly bane
#

await ctx.send or print()

maiden fable
#

Yea

upbeat otter
#
except Exception as e:
  print(e)```
jade tartan
upbeat otter
maiden fable
worldly bane
#

if u want

sullen shoal
#

catch ValueError instead

worldly bane
sullen shoal
#

yes, less bugs

#

fix the indentation

#
try: 
    ...
except ValueError:
    ...```
jade tartan
#
async def on_member_join(member, ctx, get):
        guild = client.get_guild(730651046459998218)
        channel = await (await client.fetch_channel(885464532959526913)).send(f'Welcome to server **{member.mention}**.')
        roles_list = ["•.¸¸.•:Colours:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•", "•.¸¸.•:Verification:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Age:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Gender:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Sexuality:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•",
        "•.¸¸.•:Distance:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Ethnicity:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Hobbies:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Relationship:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Location:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•",
        "•.¸¸.•::•.¸¸.•`Seeking`•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:DM:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Levels:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Games:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•"]
        for roles in roles_list:
            role = discord.utils.get(ctx.guild.roles, name=roles)
        member.add_roles(role)```

RIght?
prisma spoke
#

try:
int(transfer)
except ValueError:
pass

worldly bane
#

('Error!') doesn't do anything

slate swan
jade tartan
#

Well you mentioned ctx as it is

jade tartan
#

so

maiden fable
#

There's only member arg there nothing else

jade tartan
#

member.guild.roles

slate swan
jade tartan
#

then?

slate swan
#

bruh i sent nitro

jade tartan
#
Traceback (most recent call last):
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
TypeError: on_member_join() missing 1 required positional argument: 'get'```
#
async def on_member_join(member, get):
        guild = client.get_guild(730651046459998218)
        channel = await (await client.fetch_channel(885464532959526913)).send(f'Welcome to server **{member.mention}**.')
        roles_list = ["•.¸¸.•:Colours:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•", "•.¸¸.•:Verification:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Age:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Gender:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Sexuality:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•",
        "•.¸¸.•:Distance:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Ethnicity:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Hobbies:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Relationship:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Location:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•",
        "•.¸¸.•::•.¸¸.•`Seeking`•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:DM:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Levels:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Games:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•"]
        for roles in roles_list:
            role = discord.utils.get(member.guild.roles, name=roles)
        member.add_roles(role)
        print(f"{member.name} has joined the server")
slate swan
#

why did it get deleted

languid jungle
slate swan
#

because im generouse

languid jungle
#

self bots will snipe it

slate swan
#

whats a self bot?

worldly bane
slate swan
#

oh ok

worldly bane
#

or autoclicker

sullen shoal
#

did it get deleted or sniped?

maiden fable
#

More probably sniped

worldly bane
maiden fable
#

Since I am damn sure there are many self bots here

sullen shoal
#

it doesnt delete the message after receiving so ig python bot deleted it

slate swan
#

I have a command that is like +command and then I have on_message_events. When I have the on_message_events on, the +command doesn't work. How can I like pass this

worldly bane
#

await bot.process_commands(message)

jade tartan
#
Traceback (most recent call last):
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
TypeError: on_member_join() missing 1 required positional argument: 'get'```
#
async def on_member_join(member, get):
        guild = client.get_guild(730651046459998218)
        channel = await (await client.fetch_channel(885464532959526913)).send(f'Welcome to server **{member.mention}**.')
        roles_list = ["•.¸¸.•:Colours:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•", "•.¸¸.•:Verification:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Age:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Gender:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Sexuality:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•",
        "•.¸¸.•:Distance:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Ethnicity:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Hobbies:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Relationship:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Location:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•",
        "•.¸¸.•::•.¸¸.•`Seeking`•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:DM:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Levels:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•","•.¸¸.•:Games:•.¸¸.•``•.¸¸.•``•.¸¸.•``•.¸¸.•"]
        for roles in roles_list:
            role = discord.utils.get(member.guild.roles, name=roles)
        member.add_roles(role)
        print(f"{member.name} has joined the server")```
sullen shoal
#

whats get doing there

jade tartan
#

its telling me to define it

sullen shoal
#

you defined it thats why

worldly bane
slate swan
#

passing get?

worldly bane
sullen shoal
#

?

jade tartan
# worldly bane show error
Traceback (most recent call last):
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
TypeError: on_member_join() missing 1 required positional argument: 'get'
maiden fable
#

Remove the get

sullen shoal
#

its raising this error because the library is only passing one argument

jade tartan
#

role = discord.utils.get(member.guild.roles, name=roles but it needs to be passed through the role

vapid ingot
#
from nextcord.ext import commands  
bot = commands.Bot(command_prefix="!")
@bot.command(name="Join")
async def join(ctx: commands.Context):
    await ctx.send("""Upon entering our discord you received a dm from @spring summit 
Please follow all instructions listed there
If you need further assistance please head to #❓support 
Here's an example of how I joined //add RogueAlien86
Enter your gamertag **exactly** how it appears in miencraft""")

@bot.command(name="social")
async def social(ctx: commands.Context):
    em = nextcord.Embed(description="""First time followers can earn themselves some cool rewards. Be sure to ask a staff member about some extra perks!
https://vm.tiktok.com/ZM8qmyREn/
https://www.youtube.com/channel/UCDi0BvhS_CDDhyglD5MnOGQ""")
    await ctx.send(embed=em)```

first command works, second one doesn't
jade tartan
vapid ingot
#

I did

#

and that didn't work either

jade tartan
#

Show error?

vapid ingot
#

Ignoring exception in command None: nextcord.ext.commands.errors.CommandNotFound: Command "social" is not found

#

It seems like the bot can only handle one command and there may be an underlying issue here

#

When I change Join to ``Jointest`

maiden fable
#

Ah

coral vessel
#

How to send bot to spesific channel ?

maiden fable
#

Enclose them inside another curly brackets

maiden fable
unkempt canyonBOT
maiden fable
#

!d discord.TextChannel.send

unkempt canyonBOT
#

await send(content=None, *, tts=None, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, mention_author=None, view=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Sends a message to the destination with the content given.

The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.

To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.

To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
maiden fable
#

Show

#

Oh hmm

#

What does it send?

#

Isn't that what u want?

#

Ah nvm

#

!f-string

unkempt canyonBOT
#
Did you mean ...

sql-fstring
f-strings

maiden fable
#

!f-strings

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.

manic wing
#

surely thats a joke

maiden fable
# manic wing wtf lol

No it was my bad. But I read somewhere that if u wanna print curly braces just add them inside another pair of brackets

#

Eh I know I don't know shit about Python don't bulli ;-;

manic wing
#

hmmmm

hoary gust
#

guys anyone here who can tell me how to wait for the btos message itself in someones dm

maiden fable
unkempt canyonBOT
#

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

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
loud junco
#

profilePicture = user.avatar_url

upbeat otter
loud junco
#

will this still work? or is it outdated

#

i googled it

upbeat otter
#

where are you using it?

loud junco
#

im trying to send the author's profile picture

#

in part of the embed

#

but idk how to get the pfp

maiden fable
upbeat otter
loud junco
#

which one =.=

maiden fable
#

It's changed in 2.0

#

Breaking change

upbeat otter
loud junco
#

user,avatar.url or user.avatar.url?

upbeat otter
#

,-,

loud junco
#

;-;

maiden fable
#

Depends on your dpy version

loud junco
#

ok

maiden fable
#

If it's 2.0 then it's user.avatar.url
If it's 1.7 then it's user.avatar_url
If it's older than 1.7 then.... || only God can tell you ||

maiden fable
#

Well that God gonna be like: Why the fuck you are not using 1.7 and still on the older version

loud junco
#

🤣

#

true

maiden fable
#

So yea, better is to not ask the God and be on at least 1.7 :D

upbeat otter
loud junco
#

=.=

maiden fable
loud junco
#

alright

#

things are getting worse and worse

upbeat otter
loud junco
#

embed.set_thumbnail(url = user.avatar.url ),

maiden fable
#

Why does everyone use reserve psychology on me ;-;

maiden fable
loud junco
#

big error

maiden fable
#

They are easy to fix

loud junco
#

🤣

upbeat otter
maiden fable
upbeat otter
maiden fable
#

Anyways what's the error?

#

Only the error, don't tell the traceback

loud junco
#

positional argument

#

follows keyword argument

maiden fable
#

Ah u somewhere did something like

loud junco
#

🤣

maiden fable
#

(a=b, c)

loud junco
#

embed.set_thumbnail(url = user.avatar.url ),

this is the error

maiden fable
#

U did this somewhere

loud junco
#

the whole line is the error

upbeat otter
#

code and error

maiden fable
loud junco
#

wait

#

it should be at the end?

#

🤣

upbeat otter
#

no?

maiden fable
#

.....?

#

Okay I am confused rn

#

What u even talking about

loud junco
upbeat otter
#

light mode

maiden fable
loud junco
#

i cant turn it to dark mode

upbeat otter
loud junco
#

,

upbeat otter
maiden fable
loud junco
#

YESS

maiden fable
#

Also

loud junco
#

I FOUND THE DARK THEME

maiden fable
#

Move that outside of the embed function

maiden fable
#
embed = discord.Embed(...) 
embed.set_thumbnail(...) 
upbeat otter
#

!d discord.Embed

unkempt canyonBOT
#

class discord.Embed(*, colour=Embed.Empty, color=Embed.Empty, title=Embed.Empty, type='rich', url=Embed.Empty, description=Embed.Empty, timestamp=None)```
Represents a Discord embed.

len(x) Returns the total size of the embed. Useful for checking if it’s within the 6000 character limit.

bool(b) Returns whether the embed has any data set.

New in version 2.0.

Certain properties return an `EmbedProxy`, a type that acts similar to a regular [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") except using dotted access, e.g. `embed.author.icon_url`. If the attribute is invalid or empty, then a special sentinel value is returned, [`Embed.Empty`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed.Empty "discord.Embed.Empty").

For ease of use, all parameters that expect a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") are implicitly casted to [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") for you.
loud junco
#

undefined user

#

user = ctx.author?

upbeat otter
maiden fable
#

Yea

loud junco
#

is this how i define it?

#

ok nice

maiden fable
#

O my net dies

loud junco
#

can i just do ctx.author.avatar.url
🤣

maiden fable
#

Sure

loud junco
#

ok nice

worldly bane
#

why do people still use ctx: commands.context

loud junco
#

=.=

upbeat otter
worldly bane
loud junco
#

dont tell me u use msg

upbeat otter
upbeat otter
maiden fable
loud junco
#

its call auto format

hoary gust
worldly bane
maiden fable
spring obsidian
#

guys any bot command suggestion?

maiden fable
worldly bane
loud junco
twilit canopy
#

!voiceverify

loud junco
#

mod bot?

maiden fable
#

Make a bot command to suggest us new ideas for bot commands

spring obsidian
twilit canopy
#

cap

maiden fable
maiden fable
twilit canopy
#

captain

worldly bane
sweet geyser
#

sollu

hoary gust
maiden fable
maiden fable
spring obsidian
maiden fable
worldly bane
spring obsidian
hoary gust
#

that check it waiting for whose message, the author of the dm or the bot , cause i want the bot to wait for its message

#

not the author

maiden fable
#

It's checking if the message author is the command author and the channel is a DM Channel

hoary gust
worldly bane
#

will keep you occupied

spring obsidian
hoary gust
#

i want to execute it when the bot msgs

maiden fable
loud junco
worldly bane
loud junco
#

whats wrong now 🤦

maiden fable
hoary gust
spring obsidian
maiden fable
#

U r on 1.7

loud junco
#

lmao ok

maiden fable
spring obsidian
hoary gust
hoary gust
maiden fable
loud junco
#

2.0

maiden fable
#

Last version of dpy.

hoary gust
#

where?

worldly bane
maiden fable
#

Won't get updated anymore

maiden fable
#

Instead use a fork like disnake

hoary gust
worldly bane
#

I use disnake

#

very nice

maiden fable
#

Totally not bias towards disnake

spring obsidian
#

use py-cord

hoary gust
#

i use pycord but pycord not that good

spring obsidian
#

very simple

#

and has support for buttons and slash commands

worldly bane
worldly bane
spring obsidian
#

oh

#

then use nextcord

hoary gust
#

ah guys i have became a bit rusty, so can somebody tell me whats the required argument in the on_member_join event?

spring obsidian
#

like they have built-in ipc support but no slash command

worldly bane
worldly bane
#

has all the application already

maiden fable
worldly bane
slate swan
manic wing
#

ctx != member

maiden fable
manic wing
#

we’re here to help, not to confuse

maiden fable
#

It will always be a member object

manic wing
maiden fable
#

And there ain't a rule that u gotta name your context object ctx. It's just the same thing we do with self