#discord-bots

1 messages Β· Page 14 of 1

silk fulcrum
#

if this is enough for this award, then this thing will kill you

#

or not

maiden fable
#

Damn, another reward in your name! GGs

placid skiff
#

man, please, don't make me laugh

maiden fable
#

What language is that?

placid skiff
#

java with maven

maiden fable
#

Oh well. Compiled languages are on a whole another level πŸ™‡

dawn shard
glossy flame
#

it’s fixed now

dawn shard
#

ok

limber bison
#
 @commands.Cog.listener()
    
    # @commands.has_role()
    async def on_message(self , message):
        if message.author.id == 990358952632021043:
            return
        await asyncio.sleep(60)
        await economy.update_one({"id": message.author.id}, {"$inc": {"PAODs": +10}})```

i want user get +10 after every 60 secconds but this run every time and add 60 yo user , how can i achive 1st
#

should i go with @vale junco ?

sick birch
#

You might be looking for the discord.ext.tasks extension

limber bison
sick birch
#

Sorry?

limber bison
#

like if user type something only then he gets money

#

this think

#

!discord.ext.tasks

sick birch
#

Hmmm

#

So once a user types something, they start getting money every 60 seconds?

#

!d discord.ext.tasks.Loop

unkempt canyonBOT
#

class discord.ext.tasks.Loop```
A background task helper that abstracts the loop and reconnection logic for you.

The main interface to create this is through [`loop()`](https://discordpy.readthedocs.io/en/latest/ext/tasks/index.html#discord.ext.tasks.loop "discord.ext.tasks.loop").
tranquil sparrow
#

how feasible would making an image detection bot be for someone who is relatively new to python and discord.py?

slate swan
#

How can i make my bot 24 / 7

limber bison
#

5 sec is for testing

paper sluice
tranquil sparrow
#

hmm alright

slate swan
#

!d

unkempt canyonBOT
limber bison
#

how can i put cooldown on @commands.Cog.listener() ??

#

per user ?

slate swan
#

why would you even want that

#

time.sleep()?

silk fulcrum
slate swan
#

Master @silk fulcrum

silk fulcrum
#

me

slate swan
#

How do i make my bot 24/ 7

#

QUICK

silk fulcrum
#

.

#

can't suggest anything else

sick birch
silk fulcrum
#

and don't think anyone else could

slate swan
#

Idk how to set up

silk fulcrum
#

read?

limber bison
#

how can i put cooldown on on_message funtion ?

#

πŸ₯²

slate swan
vocal snow
slate swan
silk fulcrum
vocal snow
silk fulcrum
slate swan
#

What im gonna do?

#

To my code?

silk fulcrum
#

i never was on digital ocean site and found it

slate swan
#

Im gonna go to sleep quick grumpchib

silk fulcrum
slate swan
#

Tomorrow

limber bison
#

sense ?

slate swan
#

What county you're in?@silk fulcrum

#

Sensei

unkempt canyonBOT
#

coroutine asyncio.sleep(delay, result=None)```
Block for *delay* seconds.

If *result* is provided, it is returned to the caller when the coroutine completes.

`sleep()` always suspends the current task, allowing other tasks to run.

Setting the delay to 0 provides an optimized path to allow other tasks to run. This can be used by long-running functions to avoid blocking the event loop for the full duration of the function call.

Deprecated since version 3.8, removed in version 3.10: The `loop` parameter. This function has been implicitly getting the current running loop since 3.7. See [What’s New in 3.10’s Removed section](https://docs.python.org/3/whatsnew/3.10.html#whatsnew310-removed) for more information.

Example of coroutine displaying the current date every second for 5 seconds:
silk fulcrum
silk fulcrum
slate swan
#

To know what time you're active

#

Running out of time

silk fulcrum
#

im UTC+3

slate swan
#

Idk that

silk fulcrum
#

uhm...

#

then how would've you known my active time?

slate swan
#

oof

silk fulcrum
#

well im active almost the whole day (7 AM to 9:30 PM)

#

in my tz

limber bison
silk fulcrum
#

u just respond to that user and that's it

limber bison
#
 @commands.Cog.listener()
    async def on_message(self , message):
        asyncio.sleep(10)
        if message.author.id == 990358952632021043:
            return
        
        await economy.update_one({"id": message.author.id}, {"$inc": {"PAODs": +10}})```
silk fulcrum
#

first you didn't await it

limber bison
#

done

silk fulcrum
#

second you'll get that it will add 10 smth only after 10 secs

#

i guess you want to give 10 of smth in your economy if user speaks for 10 seconds?

limber bison
#

ohh i want the on_message its self call after 10 sec

#

if it called before

silk fulcrum
#

bruh accidental enter

limber bison
#

ok i explain what i want u suggest me the correct way

like if a user type something in my chat he get 10 somthin , then second time if he types within a 1 min he gets nothing but after 1 min agin he get 10 somthing 😳

cloud dawn
#

!customcooldown

unkempt canyonBOT
#

Cooldowns in discord.py

Cooldowns can be used in discord.py to rate-limit. In this example, we're using it in an on_message.

from discord.ext import commands

message_cooldown = commands.CooldownMapping.from_cooldown(1.0, 60.0, commands.BucketType.user)

@bot.event
async def on_message(message):
    bucket = message_cooldown.get_bucket(message)
    retry_after = bucket.update_rate_limit()
    if retry_after:
        await message.channel.send(f"Slow down! Try again in {retry_after} seconds.")
    else:
        await message.channel.send("Not ratelimited!")

from_cooldown takes the amount of update_rate_limit()s needed to trigger the cooldown, the time in which the cooldown is triggered, and a BucketType.

silk fulcrum
#

wow im stupid

limber bison
silk fulcrum
limber bison
#

pls

silk fulcrum
#

i was typing this:

#

in __init__ of your cog add self.last_call = dict(), in on_message do ```py
author_id = message.author.id
if author_id == 990358952632021043:
return

    now = discord.utils.utcnow().timestamp()
    
    try:
        if now - self.last_call[author_id] < 60:
            return
    except KeyError:
        pass

    await economy.update_one({"id": author_id}, {"$inc": {"PAODs": +10}})
    self.last_call[author_id] = now
#

but that one is much better

limber bison
#

ohhh got cha , πŸ’™

cloud dawn
#

Also better to disallow bots to enter this economy.

silk fulcrum
cosmic comet
#

yo kids it me the nephew of the creator of the dank memer bot!

cloud dawn
tidal hawk
#

Kreizy

#

What's that bot

silk fulcrum
limber bison
cosmic comet
vocal snow
# limber bison why ??

why do you want bots to earn money? It's not like they can spend it... you'll just be wasting storage

silk fulcrum
limber bison
tidal hawk
#

But other bots? (you've only blocked your bot) @limber bison

vocal snow
silk fulcrum
cosmic comet
#

aight lets work now!

limber bison
cosmic comet
#

so whats cooking up here?

limber bison
#

the id thing

vocal snow
limber bison
silk fulcrum
placid skiff
#

!d discord.User.bot

unkempt canyonBOT
slate swan
#

is anyone here familiar with bit library?

slate swan
unkempt canyonBOT
#

7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.

austere gust
#

is there a way

slate swan
#

no

austere gust
#

to change a discord bot's banner?

silk fulcrum
#

no

slate swan
silk fulcrum
#

destroyed

austere gust
#

ehr ip

slate swan
#

!pip bit

unkempt canyonBOT
slate swan
#

"related to discord"

silk fulcrum
#

bitcoin 100000% relates to discord

slate swan
#

im using it in discord

silk fulcrum
#

no, more

slate swan
silk fulcrum
slate swan
silk fulcrum
#

well bad example, agreed...

cloud dawn
#

Dunno seems like a valid point to me.

slate swan
cloud dawn
silk fulcrum
slate swan
#

πŸ’€ tf

cloud dawn
#

Discord tinder bot.

silk fulcrum
#

no

slate swan
#

ic

silk fulcrum
#

probably

shrewd apex
#

πŸ‘€ i walked into something weird

silk fulcrum
#

you're not supposed to be here

shrewd apex
#

πŸ’€

slate swan
#

nobody except us fLOOsh

shrewd apex
#

dank has one i think

silk fulcrum
#

sooo, let's switch to the topic. how to mine bitcoi...

#

OKIMII

slate swan
#

"pp length generator" πŸ‘οΈπŸ‘οΈ

silk fulcrum
#

frenn

slate swan
silk fulcrum
slate swan
slate swan
silk fulcrum
#

illusion

#

mirage

slate swan
silk fulcrum
#

you told you are bad cop(

#

oh wait, not you

#

bruh im slaughtered

slate swan
#

its not bad ig

#

why did you removed the secure from HTTP

silk fulcrum
#

because this type of words are not safe)

slate swan
#

making my browser scream its unsafe when the website can/uses HTTPS

slate swan
slate swan
#

like*

slate swan
slate swan
rose pelican
#

Someone is a pro in coding?

slate swan
silk fulcrum
slate swan
#

i think you ment to ping ash

silk fulcrum
#

nope

slate swan
#

πŸ˜…

silk fulcrum
slate swan
slate swan
#

oh fuck kek

rose pelican
#

Seriously, because i need for help me for all (PS: I'm on phone)

silk fulcrum
#

gg

slate swan
#

pinging lemonπŸ‘οΈπŸ‘οΈ

#

I'm totally not going to be off the server whenever lemon sees the ping Superman

silk fulcrum
rose pelican
#

Seriously, because i need for help me for all (PS: I'm on phone)

slate swan
#

with what exactly?

silk fulcrum
#

we'll help as we can

rose pelican
#

I don't know python

silk fulcrum
#

then we probably won't

slate swan
#

!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.

rose pelican
#

I want to create a bot

slate swan
#

UniSips master help at all costs

rose pelican
#

I wanna create a bot in python

slate swan
#

master is the best at bot development so.................~~ starts to runπŸƒβ€β™‚οΈ πŸ’¨ ~~

silk fulcrum
#

hey guys, i've gtg

rose pelican
#

I'm on ANDROID

silk fulcrum
#

RN, so gl have fun

rose pelican
#

Stop

slate swan
#

stop but for what awkward what'd I do

#

except pinging lemon

silk fulcrum
# rose pelican I'm on ANDROID

then watch, you have the following problems:
you don't know python
you are on phone
you dont want do much, because you are here asking us
And all together they're unsolvable

slate swan
#

ill actually help lmao

slate swan
#

by helping someone?

#

you guys are legit trolling the human

rose pelican
#

Go || fuck || everyone i just need || fucking || help!

silk fulcrum
silk fulcrum
silk fulcrum
#

if you don't know what ide, then ill find

grim oar
#

termux of playstore/appstore doesn't work

silk fulcrum
#

yes? bruh

rose pelican
#

Joking πŸ˜‚

grim oar
#

The base package download never does

slate swan
#

@rose pelican if you want to start your bot development journey you must learn basic python, resources has allot of good courses for that matter! Then you must learn pythons OOP and just get the hang of it, https://youtube.com/playlist?list=PL-osiE80TeTsqhIuOqKhwlXsIBIdSeYtc is a good source for learning that and then you can learn disnake or nextcord, which are library to make bots with python, from here https://tutorial.vcokltfre.dev/, if youre on mobile you would use something like replit or even better get on your pc and you could use something like visual studio code!

#

okimii's such a cutie

slate swan
round knoll
#

hello, i was wondering how to add the user name that i am giving and removing the role from, using an f string in the print statement, what method do i use and which parameter do i use (before,after)

@bot.event
async def on_member_update(before, after):
    print("----------ZeddyBot is checking for roles----------")
    if any(a for a in after.activities if a.type == discord.ActivityType.streaming):
        if LIVE_ROLE_ID in after._roles:
            return
        else:
            print("----------Giving LIVE Role----------")
            await after.add_roles(after.guild.get_role(LIVE_ROLE_ID))

    else:
        if LIVE_ROLE_ID in after._roles:
            print("----------Removing LIVE Role----------")
            await after.remove_roles(after.guild.get_role(LIVE_ROLE_ID))
silk fulcrum
slate swan
unkempt canyonBOT
#

property name```
Equivalent to [`User.name`](https://discordpy.readthedocs.io/en/latest/api.html#discord.User.name "discord.User.name")
round knoll
slate swan
slate swan
silk fulcrum
#

wait no, you!

#

he's wathcing you cus you're too good and too cute

slate swan
#

its quite funny putting a bit of terror in ashpithink

round knoll
silk fulcrum
#

gtg, bye! went offline

slate swan
austere vale
#

how do you make it so that bot commands only work when typed in certain channels?

sick birch
#

You can either add a check or a simple if statement

austere vale
#

do i have to do that to every single command ?

sick birch
#

If you do a check, no. If you use an if statement, yes

#

Your check is reusable and you can just add a quick decorator so it works anywhere

austere vale
#

can you give an example?

sick birch
#

Sure, hang on a sec

#
def is_in_general():
  """ A check that only works if the channel is the #general channel (ID: 12345) """
  async def predicate(ctx: commands.Context) -> bool:
    return ctx.channel.id == 12345 # this will be whatever your channel ID is
  return commands.check(predicate)

@bot.command()
@is_in_general() # this is important 
async def my_command_1(ctx: commands.Context, ...) -> None:
  """ This command only works in the #general channel """
  ...

@bot.command()
@is_in_general() # notice how we repeated it again?
async def my_command_2(ctx: commands.Context, ...) -> None:
  """ This command will also only work in the #general channel """
  ...

@bot.command()
# nothing here, just a regular old command.
async def my_command_3(ctx: commands.Context, ...) -> None:
  """ This command works in any channel """
  ...

@austere vale

slate swan
#

cant you just use a global check?

#

!d discord.ext.commands.Bot.check

unkempt canyonBOT
#

@check```
A decorator that adds a global check to the bot.

A global check is similar to a [`check()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is applied on a per command basis except it is run before any command checks have been verified and applies to every command the bot has.

Note

This function can either be a regular function or a coroutine.

Similar to a command [`check()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check"), this takes a single parameter of type [`Context`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Context "discord.ext.commands.Context") and can only raise exceptions inherited from [`CommandError`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError").

Example...
sick birch
#

I'm guessing they only want certain commands to work in certain channels

austere vale
#

oh no i meant all commands-

sick birch
#

Then yeah, go for a global check

slate swan
#

yeah then my case is the most suiting

austere vale
#

ohh okay thank youu

sick birch
# austere vale ohh okay thank youu

An example of a global check:

@bot.check
async def is_in_general(ctx: commands.Context) -> bool:
  return ctx.channel.id == 12345

easy as that

slate swan
#

==*

vocal snow
#

Such a pedant

silk fulcrum
slate swan
slate swan
silk fulcrum
#

oh wait, nononoo im gone im gone

vocal snow
austere vale
#

if i want to add multiple channels, do i make it into an array

slate swan
slate swan
silk fulcrum
slate swan
slate swan
vocal snow
slate swan
#

Nova's the real guy

grim oar
#

Don't you have an exam zeffo

#

I am real

slate swan
#

nova stop worrying about zeffo

grim oar
#

No

slate swan
#

nova you should write a book

#

i would buy it

slate swan
sick birch
grim oar
#

I don't think I will, no

slate swan
slate swan
#

what

slate swan
vocal snow
#

Use a set!!

slate swan
#

let's use you fLOOsh

grim oar
sick birch
unkempt canyonBOT
#

@sick birch :white_check_mark: Your 3.11 eval job has completed with return code 0.

<class 'tuple'>
sick birch
#

pretty sure it is

slate swan
#

ew

#
a = 1, 2

is a tuple lol

vocal snow
#

Ashley,

slate swan
#

I have double thoughts on how does python even work

austere vale
#

okay that worked, that you so much

vocal snow
#

Use a set though because O(1)

grim oar
vocal snow
#

And sets are cool

slate swan
silk fulcrum
#

!e py a = 1, print(type(a))

unkempt canyonBOT
#

@silk fulcrum :white_check_mark: Your 3.11 eval job has completed with return code 0.

<class 'tuple'>
slate swan
#

imagine caring about time

silk fulcrum
#

bruh it actually worked

slate swan
#

commas make a tuple, not when its empty tho lol

sick birch
#

!timeit

my_set = {123, 456, 789}
print(123 in my_set)
unkempt canyonBOT
#

@sick birch :white_check_mark: Your 3.11 timeit job has completed with return code 0.

500000 loops, best of 5: 702 nsec per loop
grim oar
#

Ok then explain ()**2

slate swan
#

that works? lmao

sick birch
#

!timeit

my_tup = (123, 456, 789)
print(123 in my_tup )
unkempt canyonBOT
#

@sick birch :white_check_mark: Your 3.11 timeit job has completed with return code 0.

500000 loops, best of 5: 539 nsec per loop
grim oar
#

No

slate swan
#

then UniSips

grim oar
#

Our prime minister thinks it does tho.

sick birch
#

looks like a tuple is faster

slate swan
#

mhm cool

sick birch
#

tf is going on

slate swan
#

Robin checking logs

#

you guys should go to sleep dogepray

grim oar
#

Tuple is faster cause you picked the first element, pick something far deeper @sick birch

slate swan
#

** β€” Today at 1:42 PM** utc -4 moment

silk fulcrum
slate swan
grim oar
#

It does lol

vocal snow
#

Atleast 52 million thousand hundred ids

slate swan
#

who in the hell would do that

sick birch
#

!timeit

my_set = {123, 456, 789}
print(789 in my_set)
unkempt canyonBOT
#

@sick birch :white_check_mark: Your 3.11 timeit job has completed with return code 0.

500000 loops, best of 5: 709 nsec per loop
sick birch
#

!timeit

my_tup = (123, 456, 789)
print(789 in my_tup )
grim oar
#

O(1) only matters because it takes constant time to pick element from any depth

unkempt canyonBOT
#

@sick birch :white_check_mark: Your 3.11 timeit job has completed with return code 0.

500000 loops, best of 5: 574 nsec per loop
vocal snow
#

Nova today some CSE final semester guy asked me for code help during his final exam

grim oar
#

More bruh.

vocal snow
#

Do you want to see question

sick birch
#

almost the same as last time

grim oar
#

More elements, face palm.

slate swan
#

im pretty sure in gets O(n) on its worse case guys

#

calm down with the more elements

sour turret
#

hey, how can i open images from discord messages with Pillow?

i want to be able to write a command (not a slash), attach an image to the message with the command and open this image using Pillow. there is no single suggestion how to implement it...

sick birch
#

If our tuple had hundreds of elements, then yeah the set would be faster

slate swan
#

hehe time comps go brrrrrrrrrrrrrrrrrrrrr

sick birch
#

but with relatively few items in the tuple it should be faster

grim oar
#

Yes.

#

Yes

unkempt canyonBOT
vocal snow
#

ctx.message.attachments for eg

sour turret
vocal snow
#

You can put it in a BytesIO and pass that to PIL.Image.open or whatever

sick birch
#

!timeit

my_set = set(range(1, 10000))
print(50 in my_set)
unkempt canyonBOT
#

@sick birch :white_check_mark: Your 3.11 timeit job has completed with return code 0.

1000 loops, best of 5: 319 usec per loop
slate swan
#

rule 7 UniSips

sick birch
#

yeah i'm gonna go do some local testing lol

#

Might have to given how range works

slate swan
#

never that set does unpack everything lmfao

vocal snow
#

What did I just read !

slate swan
#

ik just me being an idiot

vocal snow
#

Oh ok

sick birch
#

do you mean like {*range(1,10000)}?

slate swan
grim oar
#

set, list and tuple all run generators till end

slate swan
#

nova going god mode

sick birch
#

Not sure if this is the right way to test because range is lazy, so using in lookups are incredibly fast, no matter the size

grim oar
#

I sleep goodnight

vocal snow
slate swan
sick birch
# slate swan wdym by lazy lol

Like 5 in range(1, 10) would not actually do 5 in [1, 2, 3, 4, 5, ...], but it would check if 5 is between the 2 endpoints (1 and 10)

silk fulcrum
#

bye

vocal snow
sick birch
#

The implementation for range is actually really cool as it does some really nice optimizations

slate swan
sick birch
#

No, it just checks if 5 > 1 and 5 < 10

slate swan
slate swan
sick birch
#

Even with a range with billions of numbers, it's blazing fast since it's basic arithmetic

slate swan
#

yeah its way better over checking each element and if its the same lol

sick birch
#

looks like the range object is implemented in C 😬

slate swan
#

πŸ€”

scarlet aurora
#
Traceback (most recent call last):
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'bot' is not defined```
slate swan
#

you ment self.bot

sick birch
#

I'll go look at RustPython and see if the implementation is more readable

slate swan
slate swan
slate swan
sick birch
#

i can't read C to save my life 😦

slate swan
sick birch
scarlet aurora
#

ty

#

@slate swan

alpine swan
#

new to discord.py, there are so few actual examples I'm finding on a cursory google, everything says how to respond to a message, cant find how to just send a message to a channel, tried discord.Message().channel('bot-messages').send(self.index) but documentation isnt helpful on parameters for classes and message requires parameters, dunno why that isnt part of the documentation...

slate swan
#

java is cleaner than rust

#

πŸ‘‰ πŸšͺ

slate swan
sick birch
slate swan
#

Yeah I surely like Java, cleaner

#

what.........

alpine swan
alpine swan
#

ah I dont need python help, just understanding how to use discord.py, think the examples will help, the examples i've seen are just like "heres how to respond to someones message" which is great, since you already have a handle on the message which includes the channel

#

but after that the documentation makes you feel like, welp you know how to do everything with discord.py >.<

#

any insight why they might not describe the parameters to create discord models? developers not supposed to instantiate them?

sick birch
alpine swan
#

just interact with the objects that the client is connected to got it, think the examples will set me up then thanks

alpine swan
#

mmm what if a bot is listening/posting to specific channels does the bot:
A) create the channels if they dont exist? (there a way to only allow permissions to create specific channels?)
B) expect admins to create the appropriate channels and not do anything if they dont exist
if it's A what's to limit a malicious bot that doesnt create hundreds of channels?

silent portal
#

Yo, I was wondering if there's a display_banner function aswell? Why's there a display_avatar and avatar but not a display_banner and just banner?

alpine swan
#

what class is display_avatar under?

slate swan
slate swan
slate swan
silent portal
#

Wasting requests

slate swan
alpine swan
slate swan
#

!d discord.Member.display_avatar

unkempt canyonBOT
#

property display_avatar```
Returns the member’s display avatar.

For regular members this is just their avatar, but if they have a guild specific avatar then that is returned instead.

New in version 2.0.
slate swan
slate swan
#

ashley your a genius right

slate swan
alpine swan
slate swan
#

can you make files as an option type for slash commands in discord.py?

silk fulcrum
slate swan
silk fulcrum
#

didn't know what?

slate swan
slate swan
slate swan
#

oh god

slate swan
#

!d discord.File

unkempt canyonBOT
#

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

Note

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

it's used to prepare bytes for sending only

#

^

alpine swan
#

is the documentation through the bot better then the readthedocs? heh seems like it

slate swan
slate swan
slate swan
#

I agree that robo danny is far better

slate swan
alpine swan
#

0.o was trying to look at the readthedocs and didnt see the 2.0 info for display_avatar

slate swan
#

i havent used dpy in like 8 monthsπŸ—Ώ

slate swan
silk fulcrum
slate swan
#

bot dev is boring lol

alpine swan
#

ah i see it now I'm dumb

slate swan
#

try developing discord

#

i would, i just dont want to have a stroke reading css

#

πŸ™‚

#

I'm talking about a chaos IRL

#

css 😭

#

imagine making bots, you guys dont even deserve a life anymore UniSips

#

bro what

#

πŸ’€

slate swan
slate swan
#

πŸ₯Ί

#

actually js itself is beautiful

#

i would disagree

slate swan
alpine swan
#

gonna repost this sorry:
what if a bot is listening/posting to specific channels does the bot:
A) get manage channels permission and create the channels if they dont exist? (there a way to only allow permissions to create specific channels?)
B) expect admins to create the appropriate channels and not do anything if they dont exist
if it's A what's to limit a malicious bot that doesnt create hundreds of channels?

slate swan
#

JS makes me wanna yeet myself from a building

slate swan
slate swan
silk fulcrum
# slate swan try developing discord

i had 3 friends who rejected, blocked me because im coding on python, and they're JS. They did that, of course they did not fully make discord, but most of it

slate swan
slate swan
silk fulcrum
slate swan
#

pythons elegancy and readability is something else😍

silk fulcrum
slate swan
#

if you use python youre instantly attractive, its proven because sarth exists

#

😏

silk fulcrum
slate swan
#

use yaml

slate swan
#

imagine not using a text file for a config
what monsters ya'all are

slate swan
#

what all can you use .count() for?

#

!d itertools.count

unkempt canyonBOT
#

itertools.count(start=0, step=1)```
Make an iterator that returns evenly spaced values starting with number *start*. Often used as an argument to [`map()`](https://docs.python.org/3/library/functions.html#map "map") to generate consecutive data points. Also, used with [`zip()`](https://docs.python.org/3/library/functions.html#zip "zip") to add sequence numbers. Roughly equivalent to:

```py
def count(start=0, step=1):
    # count(10) --> 10 11 12 13 14 ...
    # count(2.5, 0.5) -> 2.5 3.0 3.5 ...
    n = start
    while True:
        yield n
        n += step
```  When counting with floating point numbers, better accuracy can sometimes be achieved by substituting multiplicative code such as: `(start + step * i for i in count())`...
slate swan
#

example/infolemon_glass

slate swan
#

use the same file extension as the current and import file mehh

whole lichen
#

guys i did everything, this code was running in my other pc, but its throwing this error in my laptop.

i am building a Music Bot

silk fulcrum
#

maybe that's cause of them

whole lichen
slate swan
#

sarth im not directing the info at you, its with you

whole lichen
#

thankyou so much guys, i had been looking at the code for more than last 20 mins, thanks so much for help @slate swan @slate swan

slate swan
#

no problem

slate swan
slate swan
slate swan
slate swan
#

julia does the same, Lua too

#

mhm cool

silk fulcrum
slate swan
#

pause the time

silk fulcrum
slate swan
#

i always say i dont have time, ~~continues to watch yt videos for 5 hours straight ~~

silk fulcrum
#

well maybe I have, but the problem is that I have a month to make my bot from almost nothing

slate swan
#

why

silk fulcrum
#

cus its august

slate swan
#

and

silk fulcrum
#

i've lost june and july cus of chess tournaments

slate swan
silk fulcrum
slate swan
#

reject school

silk fulcrum
slate swan
#

accept python as your new loverπŸ«‚

silk fulcrum
#

but parents won't let me

slate swan
#

reject parents

#

accept python as your new parentπŸ«‚

silk fulcrum
#

even if I am

slate swan
#

ok im going to stop messing around

silk fulcrum
#

where will I go? live?

slate swan
#

self.process

silk fulcrum
#

self.process?

alpine swan
#

whats error, i see squiggly line

slate swan
#

and add a self argument lol

silk fulcrum
#

who was faster?

silk fulcrum
slate swan
#

from my side, me
idk about discord

slate swan
silk fulcrum
#

from my side, me

slate swan
#

I should've said that dead

silk fulcrum
#

it's first line we see

slate swan
#

well just call it with ClassName.process then

slate swan
silk fulcrum
#

how

slate swan
#

B r o

silk fulcrum
#

is that a line

#

that should be nothing

slate swan
#

😭

silk fulcrum
#

why are you crying

#

self, ctx

slate swan
#

self arguments!

#

add self as the first parameter in instance methods

#

i name my instance arguments sarth

#

so i can do

sarth.give_love_to_okimii()
#

sarth has been initiated in that example😳

#

AttributeError

slate swan
#

slots

#

add self in the process fn

#

Yeah,.

#

y9 is an expert in oop😳

slate swan
#

yes, and add self as the first argument in that function.

#

isnt it referred as method

#

yes

#

i love you

#

./distract.png, it's in the same dir

#

⭐relative paths⭐

#

everyone just want me out this chat smhπŸ˜”

silk fulcrum
#

what????

#

nononononononono not out wdym

slate swan
#

codejam is not important right now

#

keyboard went brrr

#

ill assume you're aware how path strings work?

silk fulcrum
#

you're my only fren in here

#

pls dont leave me(

slate swan
#

im leaving, slides slowly to sarths dmsπŸ˜”

silk fulcrum
#

NOOOOO

#

😭 😭 😭

slate swan
#

I just wrote it there...

#

./distracted.png

#

try entering the full relative path

#

righ4 click and you will see an option for copying relative path, click on it and paste the path there

#

where did you right click? should have done on the file

silk fulcrum
#

okimii broke my heart, im leaving, i cant handle this anymore((

alpine swan
#

need to use \
\ escapes the current string to put special characters in

#

heh 2x \

silk fulcrum
#

you are here!!!

slate swan
#

πŸ‘‹

silk fulcrum
#

πŸ‘‹πŸ‘‹

alpine swan
#

so no one responded to my question earlier about bots interacting with specific channels and if it's proper to either give bots permissions to manage channels vs having the server admins create the channels manually

slate swan
#

Yes it can be done, but why? its like a 2 second job for a person to do it. Lol. But yeh give what ever permissions and code you want to write for your bot and utilise, nothings stopping you.

alpine swan
#

just kinda worrying that people install bots with manage channels when it could potentially ruin their server

slate swan
#

Then use a popular bot, they tend to be a lot more secure.

alpine swan
#

I mean, I'm trying to make a bot, and trying to make it secure. Popularity doesnt mean something is secure

#

and I am trying to find repos that do something similar to what I want, just not finding it quickly

slate swan
#

Well, yes they do as the teams behind them have better coding experience than most people, and have much better security in place to protect their data, they have a reputation to upkeep so have security always on there minds.

slate swan
#

BUt yes, you can use the manage channels permission, with https://discordpy.readthedocs.io/en/stable/api.html#discord.Guild.create_text_channel in your code, if your bothered about security then you can create .env file for your discord token and store it there and reference it in your code as you more than likely know, and don't publicly expose it, you can go even further if your using a DB and put that on to its own instance and have the bot connect remotely to the DB.

alpine swan
#

I want my bot to listen to and post messages to specific channels, but dont know how to interact with a guild that might not have those channels set up

#

so the options are have the bot require manage channels (which I find unsafe), or have the admin create the channels manually

slate swan
#

Or if the channels are not created post some sort of message to the admins to manually create the channels

alpine swan
#

yeah, was also trying that route but i'm trying to find out how to query admins which is pushing me into other permissions roles like Intent.members which I guess thats fine

#

but was hoping to find a simpler path for user/developer that felt safe to me

slate swan
#

If you absolutely will not use manage channels permissions on the bot, then you're gonna have to just have the bot post some sort of message if the channel(s) are not found

alpine swan
#

kinda wish they at least split manage channels into create/edit/delete permissions

slate swan
#

🀷

alpine swan
#

I just see someone installing a bot and boop all channels are deleted

slate swan
#

Well that is irrelevant, cause if a user gives your bot admin to their server on invite then they are at risk either way, and a lot of people do it just for simplicities sake.

#

Yeah

alpine swan
#

and admins are not developers so they wont look at code or know what stuff does

slate swan
#

But they can still nuke servers.

alpine swan
#

Just dont think the public is that aware or not concerned that installing bots might have that happen, dunno

#

just seems important to me

slate swan
#
if channels not in listofchannels:
    send message
#

Something like that

alpine swan
#

yeah I know, I think I can sort stuff like that out, just has been driving down a rabbit hole of 'there has to be a better way'

slate swan
#

Ok then, have it message admins to creat ethe channels if your bothered about security πŸ™‚

#

<@&831776746206265384>

hollow quarry
#

!cban 906176958772158464

unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied ban to @brittle swift permanently.

slate swan
alpine swan
#

speaking of malicious actions >.<

slate swan
alpine swan
#

yeah but was kinda on topic πŸ˜›

slate swan
#

Welcome to the world of the internet... Lol, but anyway back to your problem. Giving a bot manage_channels permissions do have its draw backs and security risks, mostly coming from the developers lack of security, this is also the case for if you give a bot full admin, your pretty much screwed especially if you have your token leaked.

If you don't want to go down the road of giving your bot permissions to create the channels, then you would have to make it messages admins to create the channels for example, please create Channel1! and Channel2!

So long as the code matches the name of the channel your listener should also work, unfortunately the actual code would be a bit to complicated for me to actually write.

#

Sounds about right

#

I mean there are much more things to think about to in regards to security, like where is this bot hosted, replit? heruko? a VPS on DigitalOcean or some other hosting provider? Does it have a DB? If yes, is that DB on the same server? If yes, move the DB on to its own server with only traffic open between the 2 servers, Is there a public IP on your server? If so, is there a firewall in front with traffic locked down to your IP/VPN? Lots of things to think about to help get your Discord bot more secure.

flint isle
#

uhh its not replying to the right message
code:

    @commands.command(name='poll', description='Creates a poll')
    async def poll(self, ctx, *, question):
        """Creates a poll."""
        embed = disnake.Embed()
        embed.title = 'Poll'
        embed.description = """{ctx.author.name} asks:
        {question}
        ***React with βœ” for yes, βž– for maybe, or ❌ for no.***"""
        await ctx.send(embed=embed)
        await ctx.message.add_reaction('βœ”')
        await ctx.message.add_reaction('βž–')
        await ctx.message.add_reaction('❌')
sick birch
flint isle
#

reacting*

sick birch
#

Yeah ctx.message is the message that triggered the command

#

Use the message returned from ctx.send()

flint isle
#

oh... how would I fix that lol

#

huh?
would

react = ctx.send()
react.add_reaction("emoji here")

work?

#

@sick birch ^

flint isle
#

yeah ik i forgot the f

#

Is there a way to detect when someone reacts to a reaction and then edit the message (bot sent) they reacted to?

mortal thorn
#

can a bot get someone's roles without role perms?

slate swan
#

how do i make python discord bot send a random gif from giphy (using giphy api) to discord when run bot command?

slate swan
slate swan
#

thanks bro

native kestrel
#

heya quick question, is it compulsory for message content intent to be enabled to use a bot

sick birch
native kestrel
sick birch
native kestrel
#

so I have to wait till 31st august

slate swan
#
async def giphy(ctx, *, trending):
    response = await session.get('http://api.giphy.com/v1/gifs/search?q=' + search + '&api_key=mygiphyapitoken&limit=25')
    gif_choice = random.randint(0, 24)
    await ctx.send(gif_choice)

    await session.close()```

Why does my code not work? giphy api, random gif
mortal thorn
#

can a bot get someone's roles without role perms?

full lily
#

just like normal members can see eachothers roles

mortal thorn
#

thanks

full lily
#

well no. What do you mean "take"?

mortal thorn
#

like just get a list of his roles righjt?

full lily
#

oh yes. Yes.

mortal thorn
#

not actually take lol

lilac shuttle
#

it wont let me invite my bot to my server

scarlet aurora
#
    @commands.command()
    async def name(self, ctx, name: discord.Member):
        mongo_url = "mongodb+srv://WolvTMG:(pass)@tmg.fiztp.mongodb.net/?retryWrites=true&w=majority"
        cluster = MongoClient(mongo_url)
        db = cluster["LunarVigil"]
        collection = db["Names"]
        print(name.id)
        data = collection.find_one({"_id": name.id})

        await ctx.send(data)```Why is this sending an empty message?
dusky pine
slate swan
#
async def giphy(ctx, *, trending) -> None:
    session = aiohttp.ClientSession()

    response = await session.get('https://api.giphy.com/v1/gifs/random?/api_key=apikeyhere')
    data = json.loads(await response.text())
    embed = discord.Embed()
    embed.set_image(url=data['data']['images']['original']['url'])
    
    await session.close()

    await client.send_message(embed=embed)```

this is the updated version of my code. but still not working?
error:
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "randomgif" is not found
dusky pine
#

try aliases=["randomgif"] instead of name="randomgif"

lilac shuttle
#

how do i invite my bot

#

i tried to url generator but it doesnt work

sick birch
dusky pine
sick birch
#

this "doesn't work" could be a hundred different things that are wrong, it's almost impossible for us to tell w/o more info

dusky pine
#

hmm... by "doesn't work", do you mean that your computer is catching on fire whenever you generate the URL?

lilac shuttle
#

ok so i go to oauth2 and url generator

#

i invite the bot and then it does nothing

sick birch
#

That's the problem

#

You shouldn't have to fill in a redirect URL

#

That's only if you're doing a log in with discord type thing

lilac shuttle
#

i need to or it wont generate

#

'Please enter a redirect uri'

sick birch
#

I can do it just fine

lilac shuttle
#

how do i fix it

sick birch
#

What did you select for the scope?

lilac shuttle
#

oh found it

#

i had the code grant enabled

slate swan
#
async def giphy(ctx, *, trending) -> None:
    session = aiohttp.ClientSession()
    response = await session.get("https://api.giphy.com/v1/gifs/trending?api_key=apikeyhere&limit=25&rating=g").json()
    embed = discord.Embed()
    urllist = []
    for event in response['data']:
        urllist.append(event['images']['original']['url'])
    embed.set_image(url=random.choice(urllist))
    await session.close()
    await ctx.send(embed=embed)```

how to get this working? its not work
slate swan
slate swan
sick birch
#

Okay.. but what's the issue?

slate swan
#

it doesnt work
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "randomgif" is not found

#

it shows this error

sick birch
#

That's strange, can you try the <prefix>giphy?

slate swan
#

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

sick birch
#

You sure you saved it?

slate swan
#

yes i did

sick birch
#

And you're sure you don't have any other instances running? (e.g on the production server)?

slate swan
#

no

sick birch
#

No as in you're not sure, or no as in you're sure you don't have any other instances running?

slate swan
#

Im sure that i dont have any other instances running.

tired notch
#

in dpy 2 i want to make a button name be a variable this is what i try py class Moves(View): def __init__(self, ctx, moves): super().__init__() self.moves = moves self.ctx = ctx @button(label=self.moves[0])

sick birch
sick birch
#

Perhaps try going with a more dynamic approach by subclassing button?

tired notch
#

i not understand

#

what is button

sick birch
#

What do you not understand?

#

discord.ui.Button

slate swan
sick birch
#

Doubt it

tired notch
#

is class?

sick birch
#

It is a class, but you'll want to subclass it

tired notch
#

what is @ for

sick birch
#

It's a decorator

left idol
#

in pycord can you have a dynamic cooldown with a slash command

short axle
#

ello got some dumbass error and i cant figure it out

#

Traceback (most recent call last):
File "c:/Users/sbpc/Documents/Lite-lite/_bot.py", line 19, in <module>
async def works(ctx):
File "C:\Users\sbpc\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\bot.py", line 914, in decorator
result = command(**kwargs)(func)
File "C:\Users\sbpc\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\commands\core.py", line 1551, in decorator
return cls(func, **attrs)
File "C:\Users\sbpc\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\commands\core.py", line 604, in init
validate_chat_input_name(self.name)
File "C:\Users\sbpc\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\commands\core.py", line 1621, in validate_chat_input_name
raise ValidationError(
discord.errors.ValidationError

#

just hoping someone could help

round knoll
#

hello, how would i had a timestamp in the print statements, im guessing using the datetime module? or sys?

@bot.event
async def on_member_update(before, after):
    print("----------ZeddyBot is checking for roles----------")
    if any(a for a in after.activities if a.type == discord.ActivityType.streaming):
        if LIVE_ROLE_ID in after._roles:
            return
        else:
            print(f"----------Giving LIVE role to {after.name}----------")
            await after.add_roles(after.guild.get_role(LIVE_ROLE_ID))

    else:
        if LIVE_ROLE_ID in after._roles:
            print(f"----------Removing LIVE role from {after.name}----------")
            await after.remove_roles(after.guild.get_role(LIVE_ROLE_ID))
slate swan
#

datetime module probably your best bet

round knoll
#

so using fstring {datetime.time} ?

#

hmm actually datetime.datetime would be better. so i get the day month year format too

lilac shuttle
#
Client.run('no')
#

why am i getting an error on this line

quaint epoch
#

that's not a valid token

lilac shuttle
#

weird

quaint epoch
#

or you made a typo on client

#

!traceback

unkempt canyonBOT
#

Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.

A full traceback could look like:

Traceback (most recent call last):
  File "my_file.py", line 5, in <module>
    add_three("6")
  File "my_file.py", line 2, in add_three
    a = num + 3
TypeError: can only concatenate str (not "int") to str

If the traceback is long, use our pastebin.

lilac shuttle
#
import discord
from discord.ext import commands

Client = commands.Bot(command_prefix='.')
#
  File "/Users/sketch/vscode/workspace/Bot/main.py", line 25, in <module>
    Client.run('no')
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/discord/client.py", line 723, in run
    return future.result()
round knoll
#

how do you format datetime.now() id like to drop the ms

lilac shuttle
quaint epoch
#

!d datetime.datetime.strftime

unkempt canyonBOT
#

datetime.strftime(format)```
Return a string representing the date and time, controlled by an explicit format string. For a complete list of formatting directives, see [strftime() and strptime() Behavior](https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior).
round knoll
#

i made this.. looks like it works..

print(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
#

i have to plug it into my print statement for my discord bot now

#

does that make any sense at all?

@bot.event
async def on_member_update(before, after):
    print(f"{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}----------ZeddyBot is checking for roles----------")
    if any(a for a in after.activities if a.type == discord.ActivityType.streaming):
        if LIVE_ROLE_ID in after._roles:
            return
        else:
            print(f"{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}----------Giving LIVE role to {after.name}----------")
            await after.add_roles(after.guild.get_role(LIVE_ROLE_ID))

    else:
        if LIVE_ROLE_ID in after._roles:
            print(f"{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}----------Removing LIVE role from {after.name}----------")
            await after.remove_roles(after.guild.get_role(LIVE_ROLE_ID))
#

hmm, im getting invalid syntax?

dusky pine
round knoll
#

oh, geez.. thanks w

sick birch
round knoll
sick birch
round knoll
cold tide
#
@bot.command()
async def look(ctx):
    embed=discord.Embed() embed=discord.Embed(title=f"{ctx.author} searched a ",random.choice(place),"and found a ",description=random.choice(items),color=0xffff00)
    embed.set_footer(text="Look πŸ‘€ Command ! Dev - vd#7157")
    await ctx.send(embed=embed)
#

Idk how to resolve the error.

slate swan
#

How can I delete all channel with my bot?

cold tide
zealous jay
#

why does the message.content prints empty?

    @commands.Cog.listener()
    async def on_message(self, message: discord.Message):
        print(f'{message.guild} | {message.channel} | {message.author}: {message.content}')
#

the rest seems fine but the content wont show

zealous jay
#

wdym

#

the event is already passing the message

cold tide
#

like the discord.Message

zealous jay
#

yes it does that

cold tide
#

Oh yeah i see 😭

zealous jay
#

im using the slash commands branch

zealous jay
vocal snow
zealous jay
#

oh

#

the bot is verified so it would be kinda rough to do that

#

it was just a test anyways

#

thanks

scarlet pond
#

!d events

#

does anybody know the event for when the bot joins the guild

vocal snow
#

!d discord.on_guild_join

unkempt canyonBOT
#

discord.on_guild_join(guild)```
Called when a [`Guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild "discord.Guild") is either created by the [`Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client") or when the [`Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client") joins a guild.

This requires [`Intents.guilds`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Intents.guilds "discord.Intents.guilds") to be enabled.
scarlet pond
#

oh ty

#

how do you make the bot send a message on guild join

primal token
#

!d discord.Guild.channels

unkempt canyonBOT
scarlet pond
#

how come this doesn't work? ```py

@client.event
async def on_guild_join(guild):
for channel in guild.text_channels:
if channel.permissions_for(guild.me).send_messages:
await channel.send('I will send this message when I join a server')
break

#

I pulled the code from stackoverflow but it seems fine to me

scarlet pond
#

"Guild" has no attr "channel"

#

in for channel in guild.text_channels:

silk fulcrum
#

well I don't know why

#

you don't do guild.channel

#

you do guild.text_channels

#

and there is such an attr

#

did you save the file? or maybe you sent not actual code?

scarlet pond
#

yeah lemme try re saving the file

#

and running it again

silk fulcrum
primal token
#

use f strings with the random.choice

cold tide
#

its not.

#

its title function so it wouldnt be.

primal token
#

youre passing unnecessary arguments with the usage of commas

cold tide
#

How to fix??

primal token
#

!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.

silk fulcrum
#

also what is this

cold tide
scarlet pond
scarlet pond
#

I guess I forgot to save the file

silk fulcrum
#

pycharm πŸ†’

cold tide
#

@primal token Stil cant fix it.

primal token
#

whats your error?

scarlet pond
silk fulcrum
unkempt canyonBOT
#

await create_text_channel(name, *, reason=None, category=None, news=False, position=..., topic=..., slowmode_delay=..., nsfw=..., overwrites=..., default_auto_archive_duration=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Creates a [`TextChannel`](https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel "discord.TextChannel") for the guild.

Note that you need the [`manage_channels`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission to create the channel.

The `overwrites` parameter can be used to create a β€˜secret’ channel upon creation. This parameter expects a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.10)") of overwrites with the target (either a [`Member`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member "discord.Member") or a [`Role`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Role "discord.Role")) as the key and a [`PermissionOverwrite`](https://discordpy.readthedocs.io/en/latest/api.html#discord.PermissionOverwrite "discord.PermissionOverwrite") as the value.

Note

Creating a channel of a specified position will not update the position of other channels to follow suit. A follow-up call to [`edit()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel.edit "discord.TextChannel.edit") will be required to update the position of the channel in the channel list...
white aurora
#

πŸ‘€

cold tide
#

@primal token

primal token
#

as told, youre passing unnecessary arguments with the usage of commas.

cold tide
#

How to fix it??

#

Idk how to.

silk fulcrum
#

do not pass unnecessary arguments with the usage of commas.

#

lmao

primal token
#

use your f strings and pass it in to curly brackets, idk how theyre called

cold tide
rain olive
#

f"my name is {arg}"

scarlet pond
cold tide
#

{ these? @primal token

silk fulcrum
primal token
#

you guys missed my entire point, its frightening

silk fulcrum
#

i get your point

#

you're saying that this doesnt work like they want

cold tide
#
@bot.command()
async def look(ctx):
    embed=discord.Embed() embed=discord.Embed(title=f"{ctx.author} searched a ",random.choice(place),"and found a ",description=random.choice(items),color=0xffff00)
    embed.set_footer(text="Look πŸ‘€ Command ! Dev - vd#7157")
    await ctx.send(embed=embed)
rain olive
#

new to py ig

primal token
#

just pass your expressions into curly brackets?

cold tide
primal token
#

it seems like thats a lie

cold tide
#

i just cant function correctly.

cold tide
rain olive
primal token
silk fulcrum
primal token
#

no offense, but even having a brain fart you should know how to navigate yourself which such a descriptive error

cold tide
silk fulcrum
white aurora
cold tide
#

i just havent slept for 2 days

white aurora
cold tide
#

Ill just ask in reddit

#

bye

primal token
#

that has no participation in this conversation...

primal token
#

Learning python before working with a advanced library is essential non the less.

rain olive
primal token
silk fulcrum
cold tide
#

Theres 350+ lines in my bot i know what im doing. Im not sitting here waiting to be spoonfed i just want the code.

primal token
white aurora
#

intermediate python programmers could easily familiarize themselves with discord.py

silk fulcrum
#

@cold tide py embed = discord.Embed(title=f"{ctx.author} searched a {random.choice(place)} and found a", description=random.choice(items), color=0xffff00) see? no commas around random.choice, that's all

white aurora
#

maybe without OOP though lol

silk fulcrum
cold tide
primal token
primal token
dusky pine
#

Im not sitting here waiting to be spoonfed i just want the code
i just want the code
isn't that basically asking to be spoonfed

silk fulcrum
cold tide
#

@dusky pine bro stop πŸ₯’ 🚴

primal token
silk fulcrum
dusky pine
silk fulcrum
#

and a couple of listeners

slate swan
silk fulcrum
rain olive
#

@cold tide i feel rather kind today.

we all know you are new to Python, its very clear from the error you're getting.
However not to worry.

discord.Embed(title=f"my name is", name, "what is ur name")

this is wrong, title only takes ONE argument.
Fixed code:

Embed(title=f"my name is {name}, what is ur name?")

Also having 350+ lines doesnt matter

primal token
dusky pine
silk fulcrum
#

im not new to JS guys, im just new to DJS

rain olive
#

stop telling us you arent new

this is the same as telling an f1 driver you can drive a car, when you only have a bike license lol

slate swan
cold tide
#

anyways its fixed so goodbye, i did understand what @primal token was saying my brain just cant function properly rn.

primal token
slate swan
#

Whay

rain olive
silk fulcrum
#

because there is asyncio?

white aurora
#

asyncio.sleep()

rain olive
#

you really need to stop lying to yourself

cold tide
#

Im not new and thats the truth. I may need to get used to discord.pys syntax since ive only been using py but im still learning.

rain olive
#

this is for your greater good

primal token
slate swan
#

My bot died

dusky pine
cold tide
rain olive
#

discord.py has no syntax, its the same as other libraries

cold tide
#

yk what i mean.

rain olive
#

no

primal token
#

theyre called library abstractions, not syntax.

rain olive
#

this is what happens when you brute force python just to use it with discord.py for a discord bot

dusky pine
#

but i think we're getting a little too rude

rain olive
#

harsh truth

#

not being rude here, its for this user's greater good

silk fulcrum
#

Guys, why are we arguing here, let's make a fund and buy MEE6 :lemaoX3:

cold tide
#

Ive just told you all i havent slept for 2 days and i havent took my medication, which is why you dont understand what im trying to say.

slate swan
#

welcome to the gang

primal token
#

Maybe worry about your health over your discord bot

cold tide
#

i do.

rain olive
#

clearly not XD

cold tide
#

i like coding as a hobby and it supports my mental health.

#

like a distraction.

#

i cant get my medication right now other wise i would.

rain olive
#

we're getting off topic here

primal token
#

!ot

unkempt canyonBOT
slate swan
#

what's your issue @cold tide ?

dusky pine
#

just another day in this channel

rain olive
slate swan
#

ah

rain olive
cold tide
#

Well... not really

#

but i cant be bothered

#

Ill just ask my dad when hes up.

#

but thankyou for the help ig

rain olive
#

pov: your dad is Danny

primal token
#

He would archive you

silk fulcrum
dusky pine
slate swan
#

and unarchive you with breaking changes later

cold tide
#

nope my dad just codes like me. He gets paid to build websites etc

#

he has way more knowledge than me + a 1 to 1 would be more benefical.

silk fulcrum
cold tide
#

nice.

#

he just uses html, java and py

silk fulcrum
#

for sites?

slate swan
#

VC_thonk imagine making websites and not using js/ts

primal token
#

funny how CSS wasnt mentioned

cold tide
#

i believe.

silk fulcrum
cold tide
#

im not sure tho

silk fulcrum
#

and you need at least CSS so it would look nice

cold tide
rain olive
#

offtopic

silk fulcrum
#

whocares

cold tide
#

Were not gonna get arrested are we?? πŸ₯²πŸ₯²