#discord-bots

1 messages · Page 62 of 1

grim oar
#

😫

#

Let's move the fuck up I am on the brink of getting perma banned 🤡

slate swan
#

ldxe as a desktop environment is quite convenient even for potato systems

#

*lxde

cerulean shale
#

Yo ✌️

slate swan
#

can somehow be written in a new line? [enter]

#

in opis

grim oar
#

Doesn't discord handle where those things have to appear based on screen size, idk tbh

slate swan
#

so how i can make embed creator?

#

:c

glad cradle
#

add \n in the param input

vale wing
glad cradle
vale wing
#

For some reason it works

vale wing
glad cradle
#

Good

slate swan
glad cradle
#

I'm writing a Discord file extension autoreloader (it reload extension file if changes were made)

vale wing
glad cradle
slate swan
#

😐

quaint epoch
#

!d discord.Guild.created_at

unkempt canyonBOT
quaint epoch
#

It’s UTC time

#

Just so you know

#

Documentation is your friend

maiden fable
#

Dude... cloudflare is being weird

quaint epoch
#

Not the first time

maiden fable
#

What the fuck

quaint epoch
#

Uh

maiden fable
#

Lmao

#

Proved... @quaint epoch is a bot

quaint epoch
#

No

#

The bottom part is 98.76% fluffy cat

maiden fable
#

Lmao

quaint epoch
#

This part

slate swan
quaint epoch
#

Saw that

maiden fable
#

Same

quaint epoch
#

Mods*

maiden fable
#

Lmaoo

quaint epoch
#

Damn autocorrect

slate swan
#

nice

quaint epoch
#

?

maiden fable
#

mods have delete logs smh

#

😄

slate swan
#

Hunter is so smart and kind

vale wing
# maiden fable Lmaoo

Um, actually, the code on your PFP doesn't work unless the function sad() returns different types, in condition you are comparing it to a bool, consequently the return type of the function sad() must be bool as well, but in the next line you call stop() method on presumed bool which will cause AttributeError. Also, according to PEP 8 you should compare to bools with is 🤓

#

I nerded

maiden fable
#

PoV: It's a class instance with a __call__ and __bool__ dunder implemented

#

And.... yea, that doesn't make any sense

clear elm
#

i need help w/ select menus. ive tried a million different codes, i searched and nothing has worked

vale wing
slate swan
#

IS THIS RIGHT CODE

#
import discord
from discord.ext import commands

client = commands.Bot(command_prefix = "command_prefix", intents=discord.Intents.all())
@client.event
async def on_ready():
    print("BOT IS READY")

@client.event
async def on_message(mssg):
    if message.author == client.user:

    
        return
    if message.content.startswith("HELLO"):
         await message.channel.send("HELLO") 
client.run("TOKEN")
   
vale wing
#

Kinda but formatting is cringe

clear elm
#

i know basic commands and permissions etc

vale wing
#

!d discord.Guild.created_at

unkempt canyonBOT
magic zenith
#

How can I make it so the status is determined by an argument when making the bot variable?

bot = commands.Bot(command_prefix="?", status=discord.Status.sys.argv[1])
vale wing
clear elm
#

yes, i did but i dont understand it

vale wing
#

For example

d = {"idle": discord.Status.idle, "dnd": discord.Status.dnd}

try:
    status = d[sys.argv[1].lower()]
except KeyError:
    print("Such status doesn't exist")
    sys.exit(1)```
slate swan
#

Does anyobody know a command handler for interactions so that i can make a commands folder for every single command

vale wing
#

And the status will be enum object you can use

magic zenith
#

Alright thanks

slate swan
#

what?

vale wing
#

I didn't understand what you mean

slate swan
#

what did you not understand?

vale wing
#

Entire thing

#

How can you store commands in a folder

#

The command is code, code must be in file, not in folder

#

And the commands are organised into cogs

slate swan
#

i know

#

i meant i put the files inside the commands folder

#

sry for not saying

clear elm
#

how do i add a selectmenu to this?

async def _help(ctx: SlashContext):
    embed = discord.Embed(title="Help Menu", description="To find the help you're looking for, look below in the dropdown menu and select the help you need!", colour=0xFF4C4C)
    await ctx.send(content="The help menu is shown below!", embeds=[embed])```
slate swan
#

don't use discord_slash

#

and use the official dpy 2.0

silk fulcrum
#

this 👍

paper sluice
silk fulcrum
#

what does smh mean

quaint epoch
#

What

#

Shaking my head

dull knot
#

How do I mention 2 different users? I'm stumped. Tried different stuff but I couldn't figure it out. Here's the code:

    @commands.command(name="pat")
    async def Pat(self, ctx, *, Target: disnake.Member):
      Pat_Url= "https://purrbot.site/api/img/sfw/pat/gif", "https://purrbot.site/api/img/sfw/pat/gif"
      async with request("GET", random.choice(Pat_Url), headers={}) as response:
        if response.status == 200:
         data = await response.json()   
         Pat_Url= data["link"]
         embed = disnake.Embed(title="Awwww",
                               description=f"**{Target.mention} is patting {Target.mention}!**",
                               colour = disnake.Colour.random())
         embed.set_image(url=Pat_Url)
         await ctx.send(embed=embed)

— I'm still starting out so go easy on me MyBad_

silk fulcrum
#

ok

maiden fable
#

You might wanna delete that

silk fulcrum
#

why

clear elm
#

because u can get banned

#

..

slate swan
#

no

silk fulcrum
#

ok

winged coral
swift pumice
clear elm
winged coral
#

It looks like it’s not registering as a command

swift pumice
slate swan
winged coral
# swift pumice

Name the function _help and set the name kwarg in the decorator to help

swift pumice
winged coral
#

No he means in regular python

swift pumice
#

@rugged tulip

swift pumice
cold sonnet
#

he not you

swift pumice
#

oh

winged coral
#

!d help

unkempt canyonBOT
#

help([object])```
Invoke the built-in help system. (This function is intended for interactive use.) If no argument is given, the interactive help system starts on the interpreter console. If the argument is a string, then the string is looked up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on the console. If the argument is any other kind of object, a help page on the object is generated.

Note that if a slash(/) appears in the parameter list of a function when invoking [`help()`](https://docs.python.org/3/library/functions.html#help "help"), it means that the parameters prior to the slash are positional-only. For more info, see [the FAQ entry on positional-only parameters](https://docs.python.org/3/faq/programming.html#faq-positional-only-arguments).

This function is added to the built-in namespace by the [`site`](https://docs.python.org/3/library/site.html#module-site "site: Module responsible for site-specific configuration.") module.
winged coral
#

Name the function _help and change the name kwarg to register it seperately, then do @_help.command

swift pumice
#

nvm it works

cold sonnet
#

I think this is a lib

swift pumice
#

i did something very dumb

winged coral
#

Oh

cold sonnet
#

!e help()

unkempt canyonBOT
#

@cold sonnet :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'help' is not defined
cold sonnet
#

what's a Helper object

#

did you import something

paper sluice
cold sonnet
#

{ctx.author.mention}

#

is patting

dull knot
paper sluice
#

yea

dull knot
#

Ah, alr. Gotchu. Thanks!

tawdry tendon
#

hello

#

i did
from math import *

#

but i get an error from math.py saying that bot doesnt exist in bot.command() even though its defined in main.py

#

can anyone help

quaint epoch
#

math is a stdlib module

tawdry tendon
#

oh

quaint epoch
#

So you can’t import the file

tawdry tendon
#

i have to rename?

quaint epoch
#

Rename the file to something like math1.py

tawdry tendon
#

ok

#

thanks

slate swan
quaint epoch
#

I don’t think that will work

tawdry tendon
#

ye you cant

#

it will get this error

#

ImportError: attempted relative import with no known parent package

quaint epoch
#

Since its not a package

tawdry tendon
#

btw if i want to import does it have to be in the same file

quaint epoch
#

You mean directory?

#

Yes

tawdry tendon
#

oh-

#

can i screen share with you

#

i want to show u smthn

#

@quaint epoch ?

paper sluice
quaint epoch
#

No

tawdry tendon
#

oh ok

#

oh shit shit shit shit shit shit shit

maiden fable
#

Nice

#

Press Ctrl Z

tawdry tendon
#

gone

#

but luckily i saved my files in replit

#

anyways

#

it still doesnt work

#

@quaint epoch

shrewd apex
#

pycharm even has project history

slate swan
#
import discord
from discord.ext import commands

client = commands.Bot(command_prefix = "command_prefix", intents=discord.Intents.all())
@client.event
async def on_ready():
    print("BOT IS READY")

@client.event
async def on_message(mssg):
    if message.author == client.user:

    
        return
    if message.content.startswith("HELLO"):
         await message.channel.send("HELLO") 
client.run("TOKEN")
#

is any thing wrong with this

grim oar
#

the parameter is called mssg

slate swan
grim oar
#

you are using message.stuff

tawdry tendon
grim oar
#

its visible bro

tawdry tendon
#

and the mssg

#

should be message

#

not mssg

slate swan
#

oh

#

thx'

tawdry tendon
#

i have this thing

slate swan
#

can you make a bot that makes accounts for you

tawdry tendon
#

dont know what it is

#

at the top is the error

tawdry tendon
slate swan
slate swan
#

alr

#

and can you make a discord bot do anything

tawdry tendon
#

not anything

#

a lot of things

slate swan
#

alr because im new so i might be asking alot of things

tawdry tendon
#

where does it say anything about welcome

late kraken
tawdry tendon
late kraken
#

you can only view .sql files as text

tawdry tendon
#

so what do i do?

late kraken
tawdry tendon
#

i already have that

late kraken
#

Its free

tawdry tendon
#

so should i remove the sqlite file from there

late kraken
#

why dont you use it then

tawdry tendon
#

it was working before

slate swan
late kraken
#

no you can leave it there

tawdry tendon
late kraken
#

but you cant read it, or you can try the extension ?

tawdry tendon
#

ok

late kraken
#

but what are you trying to do exactly ?

tawdry tendon
#

welcome command that you can edit

#

it was working yesterday

late kraken
#

oh idk much about discord bots

tawdry tendon
#

ok

#

bro wth is going on

#

i dont even have a file named maths1

vale wing
vale wing
late kraken
vale wing
#

I have infinite free licenses

hollow lantern
#

I'm making a discord bot but it only works for one server right now, how do I make it so if it is paused on one server it doesn't pause for the other. Sorry if this sounds dumb

late kraken
vale wing
late kraken
#

did you pay for them ?

vale wing
#

free

late kraken
#

oh lol

vale wing
#

Yk jetbrains have partners

vale wing
#

By doing some stuff with partners you can get free licenses

#

For example doing certain courses on stepik

late kraken
#

how long do each license last ?

vale wing
#

Around 3 months

late kraken
#

And how many do you have

vale wing
#

Currently 2

sage otter
#

Seems like a lot of work.

#

OSS licenses last for a year

late kraken
#

ok so you dont have inifinite

sage otter
#

Id rather do those tbh.

vale wing
#

I just do courses for some langs and if I am not in a mood I just speedrun "python for beginners" lmao

late kraken
#

And are the courses free ?

vale wing
#

Yes

late kraken
#

damn you got smth going on there

vale wing
primal token
#

Youre welcome!

sage otter
vale wing
#

They give licenses too?

sage otter
#

Yea

vale wing
#

Ok cool ima check them out

sage otter
#

They have licenses for students, oss, etc

vale wing
#

Ah so they require verification?

sage otter
#

You just apply and tell them about a open source project you want to apply for and it takes two days for them to process and bam done

vale wing
#

Nice

sage otter
tawdry tendon
#

please please please someone help

#
class WelCog(commands.Cog, name='Welcome') :

    def __init__(self,bot):
        self.bot = bot

    @commands.Cog.listener()
    async def on_member_join(self,member):
        wel = discord.Embed(color=0x0ff7d, description=str(result1[0]).format(members=members, mention=mention, user=user, guild=guild))
        wel.set_thumbnail(url=f"{member.avatar_url}")
        wel.set_author(name=f"{member.name}", icon_url=f"{member.avatar_url}")
        wel.set_author(name=f"{member.guild}", icon_url=f"{member.guild.icon_url}")
        channel = self.bot.get_channel(id=int(result[0]))
        await channel.send(embed=embed)

    @commands.group(invoke_without_command=True)
    async def welcome(self, ctx):
        await ctx.send('Available setup commands: \nWelcome Channel <#channel>\nwelcome text <message>')

    @welcome.command()
    async def channel(self, ctx, channel:discord.TextChannel):
        if ctx.message.author.guild_permissions.manage_messages:
            db = sqlite3.connect('main.sqlite')
            cursor = db.cursor()
            cursor.execute(f'SELECT channel_id FROM main WHERE guild_id = {ctx.guild.id}')
            result = cursor.fetchone()
            if result is None:
                sql = ("INSERT INTO main(guild_id, channel_id) VALUES(?, ?)")
                val = (ctx.guild.id, channel.id)
                await ctx.send(f"Channel has been set to {channel.mention}")
            elif result != None:
                sql = ("UPDATE main SET channel_id = ? WHERE guild_id = ?")
                val = (channel.id, ctx.guild.id)
                await ctx.send(f"Channel has been updated to {channel.mention}")
            cursor.execute(sql, val)
            db.commit()
            cursor.close()
            db.close()

def setup(bot):
    bot.add_cog(WelcomeCog(bot))
    print('Welcome has been loaded')```
silk fulcrum
#

Error?

loud imp
tawdry tendon
#

thats the code
when i do .welcome i get this error

discord.ext.commands.errors.CommandNotFound: Command "welcome" is not found
tawdry tendon
loud imp
#

yah

#

it says the same for me

silk fulcrum
loud imp
#

[2022-08-27 16:40:36] [ERROR ] discord.ext.commands.bot: Ignoring exception in command None
discord.ext.commands.errors.CommandNotFound: Command "spotify" is not found

loud imp
#

how do i make it into a command`

silk fulcrum
#

You can find an example on my gist

near sail
tawdry tendon
loud imp
#

@bot.event
async def on_ready():
' print("The bot is ready!")

@bot.command(pass_context = True)
async def randomnumber(ctx):
embed = discord.Embed(title = "Random Number", description = (random.randint(1, 101)), color = (0xF85252))
await ctx.send(embed = embed)
@bot.command(pass_context=True)
async def gen(ctx, *, message, requests=None):
if message == "spotify" or message == "SPOTIFY" or message == "Spotify":
accs = []
file = read(f"database/1.txt").split()
for line in file:
accs.append(line)
accs.pop(0)
file = open("database/1.txt", "w")
for item in accs:
file.write(item + "\n")
l = requests.post("https://hastebin.com/documents", data=acc)
link = "https://hastebin.com/" + l.json(['key'])
alias = randint(1, 9999999999999)
r = requests.get(f"https://shrinkme.io/api?api=6dc4f985e980f70eaafdd155fe747a35bdee1fed&url=(link)&alias={alias}")
await ctx.send(f"Spotify account generated - (r.json()['shortenedUrl'])")
'

silk fulcrum
#

I'm currently on phone so can't send the link to it

loud imp
#

why?

silk fulcrum
unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

loud imp
#

i dont have all bc of the token in it

#

bit it sayd '[2022-08-27 16:40:36] [ERROR ] discord.ext.commands.bot: Ignoring exception in command None
discord.ext.commands.errors.CommandNotFound: Command "spotify" is not found
'

tawdry tendon
#

i got these two errors btw

silk fulcrum
#

!code plsplspls

tawdry tendon
#

how can i fix that?

silk fulcrum
#

Which lines

tawdry tendon
#

ok

near sail
primal token
# tawdry tendon

you define the variables before its assignment meaning its not defined

tawdry tendon
#

they are defined here

                sql = ("INSERT INTO main(guild_id, channel_id) VALUES(?, ?)")
                val = (ctx.guild.id, channel.id)
                await ctx.send(f"Channel has been set to {channel.mention}")
            elif result != None:
                sql = ("UPDATE main SET channel_id = ? WHERE guild_id = ?")
                val = (channel.id, ctx.guild.id)
                await ctx.send(f"Channel has been updated to {channel.mention}")
            cursor.execute(sql, val)
            db.commit()
            cursor.close()
            db.close()```
tawdry tendon
#

whats that lol

maiden fable
#

and instead of the elif, use else

#

That warning will be fixed

shrewd apex
#

ik that would be the response

primal token
unkempt canyonBOT
#

@primal token :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 4, in <module>
003 |   File "<string>", line 2, in a
004 | UnboundLocalError: cannot access local variable 'b' where it is not associated with a value
tawdry tendon
#

ok

#

oh ye

#

it did fix it ty

vale wing
tawdry tendon
#

oh ok

vale wing
#

You gotta define it anyway

tawdry tendon
#

it still says welcome isnt a command

maiden fable
#

Where do u define welcome

#

Show that code

tawdry tendon
#
    async def welcome(self, ctx):
        await ctx.send('Available setup commands: \nWelcome Channel <#channel>\nwelcome text <message>')```
maiden fable
#

Show where did u add that command

#

Did you load the cog?

tawdry tendon
#
    bot.add_cog(WelcomeCog(bot))
    print('Welcome has been loaded')
maiden fable
tawdry tendon
silk fulcrum
#

await bot.add_cog!!!

tawdry tendon
maiden fable
#

!d discord.ext.commands.Bot.add_cog

unkempt canyonBOT
#

await add_cog(cog, /, *, override=False, guild=..., guilds=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Adds a “cog” to the bot.

A cog is a class that has its own event listeners and commands.

If the cog is a [`app_commands.Group`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.app_commands.Group "discord.app_commands.Group") then it is added to the bot’s [`CommandTree`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.app_commands.CommandTree "discord.app_commands.CommandTree") as well.

Note

Exceptions raised inside a [`Cog`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Cog "discord.ext.commands.Cog")’s [`cog_load()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Cog.cog_load "discord.ext.commands.Cog.cog_load") method will be propagated to the caller...
maiden fable
#

Yea, u gotta await it

#

Weird that u didn't get a warning on startup tho

#

Or u ignored it 👀

quaint epoch
#

What

tawdry tendon
#

i didnt

quaint epoch
#

The hell

tawdry tendon
#

i never ignore em

maiden fable
quaint epoch
#

You have to await it?

maiden fable
grim oar
#

why it needs to be async

maiden fable
quaint epoch
#

God

loud imp
#

import random
import discord
import asyncio
from discord.ext import commands
prefix = "!"
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)

token = ''
@bot.event
async def on_ready():
print("The bot is ready!")

@bot.command(pass_context = True)
async def randomnumber(ctx):
embed = discord.Embed(title = "Random Number", description = (random.randint(1, 101)), color = (0xF85252))
await ctx.send(embed = embed)
@bot.command(pass_context=True)
async def gen(ctx, *, message, requests=None):
if message == "spotify" or message == "SPOTIFY" or message == "Spotify":
accs = []
file = read(f"database/1.txt").split()
for line in file:
accs.append(line)
accs.pop(0)
file = open("database/1.txt", "w")
for item in accs:
file.write(item + "\n")
l = requests.post("https://hastebin.com/documents", data=acc)
link = "https://hastebin.com/" + l.json(['key'])
alias = randint(1, 9999999999999)
r = requests.get(f"https://shrinkme.io/api?api=6dc4f985e980f70eaafdd155fe747a35bdee1fed&url=(link)&alias={alias}")
await ctx.send(f"Spotify account generated - (r.json()['shortenedUrl'])")

silk fulcrum
loud imp
#

why wont the command work?

quaint epoch
#

That's why my production went down

#

Twice

grim oar
maiden fable
#

Fuck I thought he wasn't in this server

#

Sorry Danny

unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

grim oar
#

who is that

#

bruh

maiden fable
#

The creator of dpy?

quaint epoch
#

Creator of day iirc

maiden fable
quaint epoch
#

No

grim oar
#

it didnt show the name so i asked

quaint epoch
#

Read the emved

loud imp
#

!code

tawdry tendon
maiden fable
#

Oh wait, nvm he isn't in this server

primal token
silk fulcrum
#

Oh

royal bone
#

how to integrate crypto payment in discord bot ?

maiden fable
#

Outside dpy's scope

#

Gotta use a payment gateway or smth idk

grim oar
#

you use monkey pictures

maiden fable
#

Professionally known as NFTs lemon_fingerguns_shades

royal bone
primal token
#

🙈

loud imp
#

can anyone help me?

royal bone
#

hold on guys !!!!!!! ,answer me ?

maiden fable
#

PyDis's Super Duper Secret Bot Craig lemon_glass

maiden fable
royal bone
silk fulcrum
primal token
maiden fable
#

Ouh

loud imp
#

well i need to make the command working

quaint epoch
maiden fable
#

Thanks slash commands

loud imp
#

it sas

maiden fable
loud imp
#

[2022-08-27 16:57:01] [ERROR ] discord.ext.commands.bot: Ignoring exception in command None
discord.ext.commands.errors.CommandNotFound: Command "hel" is not found

grim oar
#

hel was not found

silk fulcrum
#

hell

loud imp
#

yah just

royal bone
loud imp
#

man wait then im gonna run the real command

loud imp
#

i cant the token

maiden fable
#

Only the command code

#

The part of the code where yr command lives resides

grim oar
loud imp
#

import random
import discord
import asyncio
from discord.ext import commands
prefix = "!"
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)

token = ''
@bot.event
async def on_ready():
print("Successfully logged in as zhs$capx#9502")

@bot.command(pass_context = True)
async def randomnumber(ctx):
embed = discord.Embed(title = "Random Number", description = (random.randint(1, 101)), color = (0xF85252))
await ctx.send(embed = embed)
@bot.command(pass_context=True)
async def gen(ctx, *, message, requests=None):
if message == "spotify" or message == "SPOTIFY" or message == "Spotify":
accs = []
file = read(f"database/1.txt").split()
for line in file:
accs.append(line)
accs.pop(0)
file = open("database/1.txt", "w")
for item in accs:
file.write(item + "\n")

grim oar
#

monkey picture person spawned

quaint epoch
maiden fable
unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

primal token
maiden fable
#

@royal bone u should just supply yr crypto wallet address and hope that people send u the payment

loud imp
#

!code

#

why wont it work for me

maiden fable
#

Its on cooldown

grim oar
#
stuff 
loud imp
#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

maiden fable
grim oar
#

thats crazy!!

loud imp
#
import discord
import asyncio
from discord.ext import commands
prefix = "!"
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)

token = ''
@bot.event
async def on_ready():
    print("Successfully logged in as zhs$capx#9502")

@bot.command(pass_context = True)
async def randomnumber(ctx):
    embed = discord.Embed(title = "Random Number", description = (random.randint(1, 101)), color = (0xF85252))
    await ctx.send(embed = embed)
    @bot.command(pass_context=True)
    async def gen(ctx, *, message, requests=None):
        if message == "spotify" or message == "SPOTIFY" or message == "Spotify":
            accs = []
            file = read(f"database/1.txt").split()
            for line in file:
                accs.append(line)
                accs.pop(0)
            file = open("database/1.txt", "w")
            for item in accs:
                file.write(item + "\n")
            l = requests.post("https://hastebin.com/documents", data=acc)
            link = "https://hastebin.com/" + l.json(['key'])
            alias = randint(1, 9999999999999)
            r = requests.get(f"https://shrinkme.io/api?api=6dc4f985e980f70eaafdd155fe747a35bdee1fed&url=(link)&alias={alias}")
            await ctx.send(f"Spotify account generated - (r.json()['shortenedUrl'])")



bot.run("")```
#

like this?

grim oar
#

turn on the code highlighting too pls

silk fulcrum
#

Not py still but ok

grim oar
maiden fable
#

pass_context
@slate swan you might wanna help on this one

grim oar
#

put a py after ```

loud imp
#
import discord
import asyncio
from discord.ext import commands
prefix = "!"
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)

token = ''
@bot.event
async def on_ready():
    print("Successfully logged in as zhs$capx#9502")

@bot.command(pass_context = True)
async def randomnumber(ctx):
    embed = discord.Embed(title = "Random Number", description = (random.randint(1, 101)), color = (0xF85252))
    await ctx.send(embed = embed)
    @bot.command(pass_context=True)
    async def gen(ctx, *, message, requests=None):
        if message == "spotify" or message == "SPOTIFY" or message == "Spotify":
            accs = []
            file = read(f"database/1.txt").split()
            for line in file:
                accs.append(line)
                accs.pop(0)
            file = open("database/1.txt", "w")
            for item in accs:
                file.write(item + "\n")
            l = requests.post("https://hastebin.com/documents", data=acc)
            link = "https://hastebin.com/" + l.json(['key'])
            alias = randint(1, 9999999999999)
            r = requests.get(f"https://shrinkme.io/api?api=6dc4f985e980f70eaafdd155fe747a35bdee1fed&url=(link)&alias={alias}")
            await ctx.send(f"Spotify account generated - (r.json()['shortenedUrl'])")



bot.run("")```
#

uh

silk fulcrum
#

Enter

grim oar
#

without space

loud imp
#

oh alr

silk fulcrum
#

Enter, new line

grim oar
#

dont put it on newline

quaint epoch
#

Use aiohttp, not requests

grim oar
#

9999999999999

primal token
#

no one is gonna talk about the nested command?

grim oar
#

you tried bro

quaint epoch
#

I saw that

loud imp
#

nah wth

primal token
silk fulcrum
#

Indentation is sick gdhdhs

#

Command inside command

loud imp
#

wha

grim oar
#
import random
import discord
import asyncio
from discord.ext import commands
prefix = "!"
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)

token = ''
@bot.event
async def on_ready():
    print("Successfully logged in as zhs$capx#9502")

@bot.command(pass_context = True)
async def randomnumber(ctx):
    embed = discord.Embed(title = "Random Number", description = (random.randint(1, 101)), color = (0xF85252))
    await ctx.send(embed = embed)
    @bot.command(pass_context=True)
    async def gen(ctx, *, message, requests=None):
        if message == "spotify" or message == "SPOTIFY" or message == "Spotify":
            accs = []
            file = read(f"database/1.txt").split()
            for line in file:
                accs.append(line)
                accs.pop(0)
            file = open("database/1.txt", "w")
            for item in accs:
                file.write(item + "\n")
            l = requests.post("https://hastebin.com/documents", data=acc)
            link = "https://hastebin.com/" + l.json(['key'])
            alias = randint(1, 9999999999999)
            r = requests.get(f"https://shrinkme.io/api?api=6dc4f985e980f70eaafdd155fe747a35bdee1fed&url=(link)&alias={alias}")
            await ctx.send(f"Spotify account generated - (r.json()['shortenedUrl'])")



bot.run("")

better

maiden fable
#

Remove one py

#

And then its fine

primal token
grim oar
#

yeah so theres no command named hel

silk fulcrum
maiden fable
#

Mobile Client Moment

primal token
#

master is slow like windows level slow

slate swan
#

is it possible to make messages when booting the server?

grim oar
#

you need to make a command named hel

loud imp
#

nah i know but i just took some random before, it wont work with spotify either

silk fulcrum
primal token
#

ok

loud imp
#

how do i make the command then? kind of new to discord bot

silk fulcrum
#

Learn python ig

grim oar
#

@bot.command()
async def hel(ctx, ...):
...

primal token
grim oar
#

i did

#

👍

primal token
#

😳

grim oar
#

fix what

slate swan
#

is it possible to make messages when booting the server?

grim oar
#

show full error

green garnet
#

How do I make arguments with labels?

silk fulcrum
#

Your connection is already done you don't need await connection()

grim oar
#

blame this dude @elfin island

maiden fable
#

For?

#

The error?

grim oar
#

yes!!

#

he rewrote aiomysql!!

maiden fable
#

We. Need. An. Answer.

loud imp
grim oar
#

it will work when you add stuff

#

yes blame anad

maiden fable
#

anad

loud imp
#

where u put "hel" is where i change the command?

silk fulcrum
#

Ah no I'm not gonna help with that on phone

green garnet
vocal snow
#

Poor Anand don't blame 😭

grim oar
#

no he sucks!! i should be helper in place of him!!

vocal snow
#

No 😡

grim oar
#

😔

primal token
maiden fable
#

No use
There is a civil fight going on rn

vocal snow
#

okimii would've been the best helper

maiden fable
#

Well, he left

grim oar
#

true

primal token
#

nova you shouldnt be a helper you should be an adminducky_party

maiden fable
#

So we don't talk about it

vocal snow
#

Yes so unfortunate that okimii left...

grim oar
#

i should be an owner and ban a certain admin

vocal snow
#

Nova that admin is going to perma ban u

primal token
loud imp
#

Nova the command wont wok,can u help me so when i say !spotify it answers and no errors

loud imp
#

async def hel(ctx, ...):

#

didnt change anything

silk fulcrum
#

hell

grim oar
#

huh?

loud imp
#

should i change hel to "spotify"

grim oar
#

aah i am not sure what you asking

loud imp
#

i wanna make the spotify command work

silk fulcrum
#

U don't have it

grim oar
#

where even is spotify command

loud imp
#

i need help making it

#

thats what im asking xD

grim oar
#

😔

#

what you need help with

primal token
#

nova you literally recommended him to make a command named hel

grim oar
primal token
slate swan
#

Mornin

loud imp
#
import discord
import asyncio
from discord.ext import commands
prefix = "!"
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)

token = ''
@bot.event
async def on_ready():
    print("Successfully logged in as zhs$capx#9502")

@bot.command(pass_context = True)
@bot.command()
async def hel(ctx, ...):

async def randomnumber(ctx):
    embed = discord.Embed(title = "Random Number", description = (random.randint(1, 101)), color = (0xF85252))
    await ctx.send(embed = embed)
    @bot.command(pass_context=True)
    async def gen(ctx, *, message, requests=None):
        if message == "spotify" or message == "SPOTIFY" or message == "Spotify":
            accs = []
            file = read(f"database/1.txt").split()```
grim oar
#

brah

slate swan
#

What’s the problem?

loud imp
#

what should i change? havent touched the think u sent to me Nova

grim oar
#

everything there is a problem

hollow agate
#

Don’t use a text file for a database lol

primal token
#

double registering and nested commands🙈

hollow agate
#
  • actually attempt to code the Spotify command, done expect spoon feeding
slate swan
#

Oh what the hell

grim oar
hollow agate
#

^

slate swan
#

I didn’t even see that

#

!resources

unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

grim oar
#

wont take long!

maiden fable
loud imp
#

hm alright then

slate swan
maiden fable
#

Morning

primal token
hollow agate
#

lol

#

“Spotify discord bot command Python” ez

grim oar
primal token
hollow agate
#

Basic Python with enough knowledge to make a simple Spotify command shouldn’t take that long tbf

white aurora
#

placebo

grim oar
primal token
#

if they actually want to learn how to make a discord bot then the process would take time

grim oar
#

😼 thats my opinion tbh, no need to fight over it

silk fulcrum
#

123456 thousand years

primal token
#

you wouldn't understand either wayducky_beer

grim oar
#

slow is not an absolute term dude, we can create an environment where even learning within a week is slow as fuck ;) but in reality it isnt.

#

that word is always used relatively if you have ever noticed

primal token
#

someone being slow is something subjective per person so being slow or not really depends on the person's view

grim oar
#

person's view depends on the environment in which they are in

silk fulcrum
primal token
#

im just saying giving a person false hope that its going to take no time is nice until the person gets a headache and thinks hes stupid

grim oar
#

😎 its not false at all.

grim oar
#

he should think of himself as stupid, thats what drives them into learning even more and faster!!!

primal token
#

I already gave my point, if you dont care cool we can change thentopic if you would like

slate swan
silk fulcrum
primal token
#

1 lol

turbid furnace
slate swan
#

😳

slate swan
primal token
silk fulcrum
#

3 yrs - 2 yrs of nothing = 1 yr

#

For me

slate swan
slate swan
#

I started off watching discord bot tutorials

primal token
slate swan
sick birch
#

Look, I'm always down for a productive debate. But I think this one has run it's course and is a back and forth, we aren't getting anywhere

slate swan
#

What debate?

silk fulcrum
slate swan
#

Also a lot of googling

silk fulcrum
slate swan
#

Stackoverflow 😻

silk fulcrum
slate swan
#

I still use stackoverflow a lot

#

There’s some actual geniuses on there

silk fulcrum
slate swan
#

Yeah

silk fulcrum
slate swan
#

Okimii is no longer here 😢

rocky trench
rocky trench
slate swan
rocky trench
#

I used to be a good friend of him and we haven't talked in quite some time now

slate swan
#

He was a really good friend

silk fulcrum
slate swan
#

He taught me a lot too

#

Okimii if you are reading this come back please

grim oar
#

hehe

silk fulcrum
#

Just like dpy

slate swan
primal token
#

im pretty sure Nova is okimiis alt

grim oar
#

😼

slate swan
#

What are you laughing about

primal token
#

kek

rocky trench
slate swan
#

This is not funny

rocky trench
#

Its getting a bit off topic though

slate swan
primal token
#

its a joke, nova isnt charming

slate swan
#

Don’t joke about that 😔

rocky trench
#

Guys you're gonna have to move this conversation somewhere else, mods won't be happy

primal token
#

either way i know its not him because hes never coming back and i guarantee you that

primal token
#

¯_(ツ)_/¯

rocky trench
#

...

primal token
#

because i know it lol

slate swan
#

How

rocky trench
#

Dude how about you guys move this convo somewhere else, people are requiring help. Move to dms or general or sum

primal token
#

ive said this many times, i knew him personally ans trhst me hes not coming backducky_beer

rocky trench
#

You typehint it in your class init

#

Use = instead of :

rocky trench
#

(Not the channel:)

#

your init has a bot argument that you typehint instead of passing it

primal token
slate swan
rocky trench
#

bot = commands.Bot

slate swan
#

I thought typehints were Just like annotations l

rocky trench
#

U will het a new error that ur channel is missing

rocky trench
slate swan
#

Makes sense

rocky trench
#

I don't even know if he's trying to use his bot variable or use commands.Bot argument

slate swan
#

Channel has to go first I think

rocky trench
#

Yep

slate swan
#

Listen to Bertie though he knows more

rocky trench
slate swan
#

Me too

wispy spade
#

I don't think they meant there

rocky trench
#

Its usefull within multiple files but its a no go for me in 1 file

slate swan
#

Okimii was teaching me oop 😢

primal token
#

pythons OOP is lovely

paper sluice
#

i think you want to do bot: commands.Bot instead of =

slate swan
#

Yeah…

rocky trench
#

I keep forgetting what OOP stands for LOL

primal token
#

kek

paper sluice
#

object oriented programming

wispy spade
# wispy spade I don't think they meant there
  File "/home/container/main.py", line 331, in joinmsg
    await interaction.response.send_modal(Modal2())
TypeError: Modal2.__init__() missing 2 required positional arguments: 'bot' and 'channel'

Issue is that you're missing some args in your Modal2() init. You have to provide them for it to actually do something (or at least give you an object)

slate swan
#

Mornin Ryuga

rocky trench
paper sluice
rocky trench
#

I need to shut my mouth in classes, I don't have enough experience

paper sluice
slate swan
#

How are ya

paper sluice
#

im good 😄

slate swan
#

Me too

paper sluice
#

just had dinner

#

you didn't pass in channel...

slate swan
#

Just had breakfast 😂

paper sluice
#

Nice

#

why do you have channel there?

#

what are you trying to achieve?

#

then pass in the channel object in the setup of the cog

wispy spade
#

You put it there and you need to pass it so it does something.

wispy spade
paper sluice
#
def setup(bot):
    MyCog(<enter your channel object>, bot)

but you are not using the channel so i don't know what you are trying to do with that

#

oh wait, yea, then just pass in the channel while making the modal

#

its the same thing

#

where you are making an instance of the modal...

paper sluice
primal token
#

kek

paper sluice
#

that will help you more than me.

wispy spade
#

at this point I think it's better you go there

paper sluice
wispy spade
#

review on what's in there

silk fulcrum
wispy spade
silk fulcrum
#

you're forced ig

paper sluice
silk fulcrum
#

doesnt seem very long

paper sluice
#

2 months is long enough

silk fulcrum
#

if you were using github version of dpy then setup was already async

paper sluice
#

every other fork uses sync setup ( i hope ) 🤷‍♂️

shrewd apex
#

at this point u are not asking for help u are asking to be spoonfeed

vale wing
#

The great spoon

shrewd apex
#

hmm

vale wing
#

I like forknife

shrewd apex
paper sluice
vale wing
shrewd apex
#

ok i should stop spamming gifs pithink

vale wing
primal token
#

What has happened

floral frigate
#

so guys

#

whats the library used for discord bots in python these days

primal token
floral frigate
#

i heard it died someitme later

primal token
#

yeah but it got resumed kek

floral frigate
#

oh i didnt hear about that

primal token
#

yeah its actually in pypi

floral frigate
#

when did it get resumed

primal token
unkempt canyonBOT
floral frigate
#

wow

primal token
floral frigate
#

mhm

#

so like business is back to usual?

shrewd apex
#

5 months around

primal token
#

yep

shrewd apex
#

2.0 beta test was out

#

i think

floral frigate
#

i started like september of 2020 and then moved to pygame by i think feb 2021

shrewd apex
floral frigate
primal token
#

either way if youre experienced i wouldnt really use dpy

#

i would probably just use disnake if you dont want to learn another lib but its still better to use hikari or make your own wrapper🙈

wispy spade
#

btw you'd need to add one more indent to that

#

and by required I assume you're still referring to the channel arg

warped mirage
#
await client.change_presence(status=discord.Status.dnd, activity=discord.Activity(type = discord.activityType.watching, name = ("The Community")))
AttributeError: module 'discord' has no attribute 'activityType'```, any ideas?
wispy spade
#

the self.add_ part

#

reason is self doesn't exist at that level so it has to be inside the function for it to get a self (i.e. the instance)

#

you'd need to put inside your Modal2() thing

#

Do you have any errors?

warped mirage
#

does anyone know how to fix my error

warped mirage
#

like the status

wispy spade
#

yeh you could

#

seems to be the same thing as the inputtext in self.add_item (just without the required=True part)

warped mirage
#
status=discord.Status.dnd``` doesnt work
wispy spade
warped mirage
#

k

sick birch
#

Code?

wispy spade
#

that's why I told you to indent the self.add_item line

#

again, self doesn't exist at that level since it's part of the __init__ method

#

yeah that looks better

mossy jacinth
#

Is it possible to see if a user logged in with the generated link and give them extra commands afterwards?

wispy spade
#

seems that super() line has a space, they have to be at the same level

vale wing
#

What for is required kwarg in class

vale wing
wispy spade
#

yeh not there

mossy jacinth
vale wing
#

Where can user even find that link

#

What's its origin

#

And destination

mossy jacinth
#

The link is in the Help command and it will lead them to the hosting website where I'm hosting the bot

vale wing
#

Alright

#

For that just implement oauth2 on your site

#

Check discord dev portal docs, oauth2 section

wispy spade
#

same error as earlier, you did not provide the channel parameter in your Modal2() call

#

either that or you can just provide the channel parameter when calling Modal2()

#

did you go over the article someone sent earlier?

#

same thing as calling a function

#

errors?

#

aight, can you send the callback method inside the modal?

#

or actually, can you add a print statement just to check whether it's actually being called?

paper sluice
#

your callback is not a method of the class because its inside __init__

shrewd apex
#

u can call a function on a submit

silk fulcrum
#

Dead chat?

primal token
#

ok

silk fulcrum
#

ok

wispy spade
#

uhm by sending it?

#

it's part of your class, and as others mentioned, it should be indented a level lower (since it's currently part of __init__)

leaden cosmos
#

hmm help me
Traceback (most recent call last):
File "/home/runner/mmcbgg/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 190, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 22, in money
cursor.execute(f"SELECT wallet, bank, bank1 FROM mainfdb WHERE user_name = {user.name}")
sqlite3.OperationalError: near "🆆o𝓻𝓵𝓭": syntax error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/runner/mmcbgg/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 1347, in invoke
await ctx.command.invoke(ctx)
File "/home/runner/mmcbgg/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 986, in invoke
await injected(*ctx.args, **ctx.kwargs) # type: ignore
File "/home/runner/mmcbgg/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 199, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OperationalError: near "🆆o𝓻𝓵𝓭": syntax error

wispy spade
#

that's not the entire callback method but I can at least tell that bot isn't a variable inside of it so yeah

wispy spade
#

your method should be part of Modal2 but it's actually part of the __init__ method as others mentioned, what you have to do here is to unindent the entire callback method one level for it to be part of Modal2

cold sonnet
#

use IDs instead of names

#

names are changeable

#

IDs will never change

#

and you won't encounter this error

wispy spade
#

you'd go back

cold sonnet
leaden cosmos
wispy spade
#

that's going forward, I said back

#

till the same level as that __init__ func

leaden cosmos
cold sonnet
#

no such table mainfdb

leaden cosmos
#

it save nothing in it

wispy spade
#

you still have a bit to go

silk fulcrum
#

Not file

cold sonnet
#

I don't know shit about replit

leaden cosmos
wispy spade
#

yes, 1 indent back

cold sonnet
#

and I like that about me

silk fulcrum
leaden cosmos
silk fulcrum
wispy spade
#

the callback method, not that

leaden cosmos
silk fulcrum
#

That is a db itself

#

Not a table

leaden cosmos
silk fulcrum
wispy spade
# wispy spade yes, 1 indent back

remove the space before the super() thing, again, indentation should be at the same level as other indentation in that area (unless you are starting a new indent block)

silk fulcrum
#

Btw that's googleable

wispy spade
leaden cosmos
silk fulcrum
#

Why screenshots...

primal token
silk fulcrum
leaden cosmos
silk fulcrum
primal token
#

ok

leaden cosmos
#

why not show me
where are my messages

silk fulcrum
leaden cosmos
leaden cosmos
primal token
primal token
#

we can literally see your tag?!?

tidal hawk
#

How do I modify my bot output volume?

#

it's loud af when it's playing songs

#

and new ppl who haven't lowered it, get ear damage

#

disnake

polar scroll
novel apexBOT
#

This is not a Modmail thread.

#

This is not a Modmail thread.

leaden cosmos
#

uhh how

potent spear
potent spear
leaden cosmos
#

intents=discord.Intents.all()

polar scroll
potent spear
unkempt canyonBOT
#

Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default discord.py has all intents enabled except for Members, Message Content, and Presences. These are needed for features such as on_member events, to get access to message content, and to get members' statuses.

To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.

Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:

from discord import Intents
from discord.ext import commands

intents = Intents.default()
intents.members = True

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

For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.

potent spear
leaden cosmos
potent spear
#

yeah, you should always keep it as minimalistic as possible

polar scroll
#

still giving me the error

slate swan
#

!paginations

#

ok

potent spear
leaden cosmos
leaden cosmos
potent spear
#

you either choose a bot or a client, not both

leaden cosmos
# polar scroll

hahaha
if you use bot = commands.Bot so don't use client = discord.Client anymore

polar scroll
#

oh.

#

i wanna pick client, how do i change it

potent spear
#

since you most likely want commands and not only events, you should prefer the bot

leaden cosmos
polar scroll
#

OH IT WORKED

potent spear
#

just bump your previous message instead of asking it again

polar scroll
#

NICE

leaden cosmos
polar scroll
#

how do i make slash commands, is it hard?

leaden cosmos
vestal dagger
polar scroll
wispy spade
#

the examples for each should give you a decent idea on how

leaden cosmos
slate swan
#

!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.
potent spear
#

I'd say slash commands are much more user-friendly, since you get to SEE in the textfield what the next argument is

#

or if the command even exists at all

polar scroll
#

as a beginner, should i learn it, or stick with commands?

silk fulcrum
#

Learn them

leaden cosmos
potent spear
#

so called "slash commands" are also commands...

#

they're called "app commands" in dpy

wispy spade
potent spear
polar scroll
#

ok so, where do i look for examples? or even get started with it?

junior verge
#

Do you know python?

polar scroll
#

yeah

wispy spade
junior verge
#

Do you know dpy in general?

polar scroll
#

no

silk fulcrum
leaden cosmos
polar scroll
potent spear
#

but learning python is the first step in your case

polar scroll
#

also, im getting this, idk how to solve it

junior verge
#

..

leaden cosmos
wispy spade
polar scroll
junior verge
#

Show code

wispy spade
potent spear
junior verge
#

yeah lol

polar scroll
junior verge
#

lol

#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

potent spear
#

I don't use modals, can't say
but to get people to read your help message again, just do this

leaden cosmos
wispy spade
# polar scroll

prob someone mentioned it, but as the warning says, you're missing the Message Content intent required to read off message content. You can specify it same say you did with intents.members

wispy spade
polar scroll
junior verge
#

You don't even need message content intent

polar scroll
#

it still gives the error

slate swan
#

how to get the username that used the command?

leaden cosmos
wispy spade
# polar scroll it still gives the error

again, safe to ignore but if you really need it, you also need to specify it inside your code (again, same way you do with intents.members, but with intents.message_content instead)

leaden cosmos
#

that's not glitch or error

polar scroll
leaden cosmos
#

intents = Intents.default()
intents.members = True
intents.message_content = True

slate swan
#
    embed = disnake.Embed(title="PROPOZYCJA", description=f"Propozycja użytkownika {user using command}", colour=0xb700fa)
#

how to do it?

polar scroll
wispy spade
#

oh wait

leaden cosmos
slate swan
wispy spade
polar scroll
polar scroll
silk fulcrum
polar scroll
#

i did

#

and i went do discord dev

#

and its all enabled

silk fulcrum
#

Show

polar scroll
silk fulcrum
#

Did u save?

leaden cosmos
#

maybe nooo

polar scroll
#

also, Ping me when reply pls

leaden cosmos
slate swan
#

guys how could I add slash commands on my discord.py bot

silk fulcrum
polar scroll
slate swan
leaden cosmos
polar scroll
#

whats Ctx?

#

this aint working 😭

primal token
#

i have so many questions

polar scroll
#

same bro

silk fulcrum
#

same bro

tawdry tendon
#

hello

silk fulcrum
#

hello

tawdry tendon
#
@bot.listen()
async def on_member_join(member):
    wel = discord.Embed(color=discord.Color.magenta(), title=f"Welcome {member.name}!", description=f"Welcome {member.mention} If you don't know the commands type in '.help', this will tell you all the commands. I am a math bot so if you ever need help with math, I am the one to use. I can do other things aswell, test me out in. Enjoy your stay!")
    wel.set_thumbnail(url={member.avatar.url})
    wel.set_author(name={member.name}, icon_url={member.avatar.url})
    wel.set_author(name={member.guild}, icon_url={member.guild.icon.url})
    await member.send(embed=wel)```
#
  File "C:\Users\Ayman\PycharmProjects\pythonProject1\venv\lib\site-packages\discord\client.py", line 409, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\Ayman\PycharmProjects\help\main.py", line 211, in on_member_join
    wel.set_thumbnail(url={member.avatar.url})
AttributeError: 'NoneType' object has no attribute 'url'```
#

but it works for

silk fulcrum
#

Use display_avatar.url

tawdry tendon
#
@bot.command(aliases=['getprofilepic','getprofilepicture','pfp','profilepic','profilepicture','avatar'])
async def getpfp(ctx):
    await ctx.send(ctx.author.avatar.url)```
tawdry tendon
tawdry tendon
#

do i have to do it instead of member

silk fulcrum
#

No?

tawdry tendon
#

oh

#

so what do i do

#

this is my updated code

#
@bot.listen()
async def on_member_join(member):
    wel = discord.Embed(color=discord.Color.magenta(), title=f"Welcome {member.name}!", description=f"Welcome {member.mention} If you don't know the commands type in '.help', this will tell you all the commands. I am a math bot so if you ever need help with math, I am the one to use. I can do other things aswell, test me out in. Enjoy your stay!")
    wel.set_thumbnail(url=f"{display_avatar.url}")
    wel.set_author(name=f"{member.name}", icon_url=f"{display_avatar.url}")
    wel.set_author(name=f"{member.guild}", icon_url=f"{member.guild.icon}")
    await member.send(embed=wel)```
silk fulcrum
#

Bruh

tawdry tendon
#

what?

silk fulcrum
#

Nothing

#

You are very good

crimson plover
#

so... sorry to ask again, is there a way to give a description to this.. the arguments part.

silk fulcrum
unkempt canyonBOT
#

discord.ext.commands.parameter(\*, converter=..., default=..., displayed_default=...)```
A way to assign custom metadata for a [`Command`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command")'s parameter.

New in version 2.0.

Examples

A custom default can be used to have late binding behaviour.

```py
@bot.command()
async def wave(ctx, to: discord.User = commands.parameter(default=lambda ctx: ctx.author)):
    await ctx.send(f'Hello {to.mention} :wave:')
silk fulcrum
#

I think you've already been answered with that

crimson plover
#

am i stupid

tawdry tendon
silk fulcrum
#

No idea

crimson plover
#

i dont see how thats describing something

tawdry tendon
#

@silk fulcrum whats wrong

silk fulcrum
tawdry tendon
#

u said you are very smart

#

but it sounded like sarcasm

crimson plover
#

oh

silk fulcrum
tawdry tendon
#

what did i do wrong

#

PLEAAAAAAAAAASEEEEE

#

TELL MEEEEEE

silk fulcrum
#

Think about what you did?

polar scroll
#

can i get some help?

silk fulcrum
tawdry tendon
polar scroll
silk fulcrum
polar scroll
tawdry tendon
#

@opaque fiber

crimson plover
#

can you give me an example?

tawdry tendon
silk fulcrum
#

Message*