#discord-bots

1 messages ยท Page 1064 of 1

glad cradle
#

Read the source code ๐Ÿ˜ซ

slate swan
#

it would be allot to document, to understand them internals as said they shouldnt be really documented but more like explained in a sense of examples inside of a method of a class users can access

slate swan
slate swan
#

as if the methods were actually thats simple.

#

thats my point, its too. documenting only methods of a internal class seems useless for users as they wouldnt know where the methods are actually being used.

slate swan
#

still doesnt change the fact that documentation makes the library better even if its about internals

glad cradle
#

application.commands scope is equal to guild_integrations intent?

slate swan
#

and i dont think function which are explicitly public ( ones without _s ) are really something which dont need to be documented

#

well, it still would be useless. as their usage isnt shown, yes they show what the function can do but what would the users do with that information if the method is only used within another front end method for users to actually use.

#

yes it would be great for internals to be documented but it would be a problem as a normal method for users to use is like a network of other internal methods

#

highly arguable, that "can" save many API calls if exposed to users

#

well, dont they already quite explain it already in their documentation?

#

for someone who doesnt have member intents and still wants to dm a user they would first fetch the user and then send the message

#

while it could it be done just with their ID, in a single http req

#

only if it was exposed to users or atleast documented

#

well, that isnt really the documentations fault but the libraries abstractions, as you said you can just send a message with the id without fetching the whole user object then dont you think the library can just make a kwarg that accepts a snowflake?

#

ask them, not me.

warped mirage
#

Guys can someone help me my code is crap so dont laugh , unless u have to

slate swan
slate swan
#

and its been used for all the parts which is sending a message, dont see anything private in that

warped mirage
#
@commands.command(self)
    @commands.has_permissions(ban_members=True)
    async def warn(self, ctx, member : discord.Member):

     warn = [0]
     cursor = cursor
     member = member
     guild = guild
     warns = warns

    async with self.client.db.execute("INSERT INTO warnsystem (guild_id, warns , id, guild) VALUES (?, ?, ?, ?)"(id, warns, guild.id, member)) as cursor:
      await self.client.db.commit()

      warn = [0] += 1
      
    await self.client.db.execute("UPDATE warnsystem SET warns = ? WHERE id = ? AND guild = ?")```
#

im bad but how shall i fix

slate swan
#

things like caching messages, catching/dispatching events could be considered private

unkempt canyonBOT
#

Indentation

Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.

Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.

Example

def foo():
    bar = 'baz'  # indented one level
    if bar == 'baz':
        print('ham')  # indented two levels
    return bar  # indented one level

The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.

Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines

More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation

slate swan
#

your indentations are wrong

warped mirage
slate swan
#

actually thats correct, whats the issue?

#

notice the extra gap before warn, cursor etc..

warped mirage
#

whatever does that code event work

#

im making a warning system

slate swan
#

did you even call that function? ๐Ÿšถโ€โ™‚๏ธ

warped mirage
#

honestly , half the code i guessed , i need serious help

slate swan
#

did you call the function???

warped mirage
#

i showed my code

slate swan
#

...

#

!e ```py
def foo():
print(1,2)

calling the function now

foo()

#

this is a function, it wont give any output until you call it

unkempt canyonBOT
#

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

1 2
warped mirage
#

i think i called it , idk

fallow mauve
#

is it possible for a bot to fetch a deleted message that was deleted before the bot was added to the server?

slate swan
#

well, thats what deleted means.

warped mirage
#

uknow what

#

ima code other stuff to my bot instead of wasting time on one thing

#

leave harder stuff till ----> last

heady sluice
#

if role is not GM or role is not HC: this is always True @slate swan

#

if role is not GM and role is not HC: you want this

heavy shard
#

not (A or B or C) = not A and not B and not C

slate swan
scarlet sorrel
#

anyone got an example i could look at of a music bot?

heady sluice
#

ToS breaker bot

slate swan
heavy shard
#

gentlemen do

slate swan
#

include me in

heady sluice
#

gentlewoman

slate swan
#

lady*

heady sluice
#

same thing

slate swan
#

that aint a word....

#

anyways

slate swan
#

english is sure weird

#

if gentlemen is a word why is gentlewomen not? its just lean to a different gender.

#

I thought you put a space in between gentle and woman in that

heavy shard
#

isn't it just "ladies" ?

slate swan
#

its a synonym of lady as per that link

heady sluice
#

idk I just said some shit for a meme and it turned out like I've been using a doctorical language style

warped mirage
#

Ok damn

#

I made a choice to code other stuff first and leave others till last

#

Doesnโ€™t mean that Iโ€™m fine with that Iโ€™ll still need help in future

zealous jay
#

Is there any decorator so only the bot owner can use the command?

outer violet
#

@commands.is_owner()

zealous jay
#

thanks

outer violet
#

Np

zealous jay
#

Why does this returns None?

slate swan
#

youre missing intents

zealous jay
#

Is this wrong?

slate swan
#

pass all intents

zealous jay
#

can't

#

it's a verified bot

slate swan
#

define a var and then pass it to the intents kwarg becuase it seems like its just setting the default intents without the members

zealous jay
#

can I pass the same var im defining down there?

slate swan
#

you can make a variable in the init and then pass it

zealous jay
#

i'll try that, thx

slate swan
#
def __init__(self) -> None:
    intents = discord.Intents.default()
    intents.members = True
    super().__init__(
        intents=intents
        )

e.g

warped mirage
#
import discord
import asyncio


async def GetMessage(
   client, ctx, contentOne="Default Message", contentTwo="\uFeFF", timeout=100
):

    embed = discord.Embed(
       title=f"{contentOne}",
       description=f"{contentTwo}",
    )
    sent = await ctx.send(embed=embed)
    try:
        msg = await client.wait_for(
            "message",
            timeout=timeout,
            check=lambda message: message.author == ctx.author
            and message.channel == ctx.channel,
        )
        if msg:
           return msg.content
    except asyncio.TimeoutError:
       return False
``` can someone confirm if this would work
fading marlin
#

as a command, no, as a function, try it and see

warped mirage
#

its not meant to be a command

fading marlin
#

then try it and see

slate swan
#

they want to send a message with that function

warped mirage
#

im using some of the stuff for giveaway system

slate swan
#
sent = await ctx.send(embed=embed)
#

it still wouldnt triggger the wait_for

#

as sarth shown youre sending the message before waiting for an event

zealous jay
#

Same thing, pretty weird

#

anyways this command is not neccesary tho, just testing some things

slate swan
#

can you show your code?

zealous jay
#

the command?

#

or the intents part

slate swan
#

the intents

zealous jay
slate swan
#

weird it should have the members intent on

zealous jay
#

yeah

#

no problem tho

#

thanks for helping

slate swan
#

!d discord.ext.commands.Bot.fetch_guilds

unkempt canyonBOT
#

async for ... in fetch_guilds(*, limit=200, before=None, after=None)```
Retrieves an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator "(in Python v3.10)") that enables receiving your guilds.

Note

Using this, you will only receive [`Guild.owner`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.owner "discord.Guild.owner"), [`Guild.icon`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.icon "discord.Guild.icon"),
[`Guild.id`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.id "discord.Guild.id"), and [`Guild.name`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.name "discord.Guild.name") per [`Guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild "discord.Guild")...
slate swan
#

its limited in attrs

heavy shard
#

what about "SERVER MEMBERS INTENT" on bot developer page?

slate swan
zealous jay
#

so I set limit to None?

slate swan
#

no no

#

look at the note in docs

#

!d discord.ext.commands.Bot.guilds

unkempt canyonBOT
slate swan
#

use this

#

its a list of guild objects

zealous jay
#

oh

warped mirage
#

Guys when I finish coding and if I have errors can someone help maybe?

heavy shard
#

maybe ๐Ÿ™‚

zealous jay
slate swan
#

thats great

zealous jay
#

I tried it before but because my Intents weren't configured the right way it used to give me an error or something

#

what t

#

that's a big guild

slate swan
#

๐Ÿ˜ณ

wet crystal
#

wrong

radiant wave
#

@tiny mountain Just for the record, this is how to do what I was trying to achieve

@client.slash_command(
    options=[
        disnake.Option(
            name="Option_one_name",
            description="Option_one_description",
            type=disnake.OptionType.string,
            choices=[
                "choice_one",
                "choice_two",
                "choice_three"
            ]
        )
    ]
)
async def foo(ctx):
    ...
zealous jay
#

is that discord-interactions library?

slate swan
#

Hello Guys!!
Me and my friend build a discord bot that tells the Ethereum price stock but when we hosted it and runned it on replit ,replit banned my friends IP adress.How can we prevent that

vocal plover
zealous jay
#

oh

slate swan
vocal plover
#

yes I do kek

slate swan
#

kek

wet crystal
#

wtf is this?

<property object at 0x000001F6E5AEF560>

this come from this code btw

@bot.command()
async def roulette(ctx):
    await ctx.send(str(nextcord.Member.voice))
slate swan
#

bro

#

you need an instance of a member object and not the actual class and you tried to string a property object

wet crystal
#

instance and object are the same thing right?

slate swan
#

no

wet crystal
#

bro then I dont know wtf a instance was

slate swan
wet crystal
#

instance is like

class item:
...

item1 = item(...)

slate swan
#

you would need an instance of the class/object Member of the module nextcord

slate swan
#

which remember instances can have different states

wet crystal
slate swan
#

self.var = ... is a variable bound to a instance of a class which can be different depending on the instance

wet crystal
#

and some guy told me

x = item1

is a object

slate swan
#

well item1 is an instance of a Class so yes its a object

wet crystal
#

which didnt really make sense to me idk

cloud dawn
cloud dawn
slate swan
#

everything in python is an object

#

python depends on objects

heavy shard
#

you can do "TEXT".lower()

wet crystal
wet crystal
slate swan
#

oop*

#

object oriented programming yes

cloud dawn
#

ool

slate swan
#

yup

heavy shard
#

oO

wet crystal
#

object oriented programming language

#

but alr im not gonna argue lmao

cloud dawn
#

OoOoOooOOooOO

slate swan
#

yeah lets not haha

heavy shard
slate swan
#

๐Ÿ’€

wet crystal
#

underline

slate swan
heavy shard
#

well said

slate swan
#

yup

cloud dawn
#

oฬ…vฬ…eฬ…rฬ…lฬ…iฬ…nฬ…eฬ…

slate swan
wet crystal
#

how

slate swan
#

whats the command

#

!charinfo oฬ…

unkempt canyonBOT
slate swan
#

oh

wet crystal
#

why do u even know about stuff like that

cloud dawn
#

;-;

slate swan
#

๐Ÿคทโ€โ™‚๏ธ

heavy shard
#

!e oฬ… = "Hi!"; print(oฬ…)

unkempt canyonBOT
#

@heavy shard :white_check_mark: Your eval job has completed with return code 0.

Hi!
slate swan
#

๐Ÿ—ฟ

cloud dawn
wet crystal
slate swan
unkempt canyonBOT
#

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

Hi!
cloud dawn
slate swan
#

panda what the heck

cloud dawn
#

I'm very busy

slate swan
#

๐Ÿ˜ญ

wet crystal
#

nahhhhhh, this game is so good I would find time for it

cloud dawn
#

Playing w/ some friends rn

wet crystal
# cloud dawn yes

a average person wouldnt know where certain apes are but a player always knows where who is ๐Ÿค“

slate swan
#

@wet crystal are you knew with pythons oop?

slate swan
#

let me give you some knowledge

wet crystal
#

mostly
i know some basic stuff

wet crystal
slate swan
#

In this Python Object-Oriented Tutorial, we will begin our series by learning how to create and use classes within Python. Classes allow us to logically group our data and functions in a way that is easy to reuse and also easy to build upon if need be. Let's get started.

Python OOP 1 - Classes and Instances - https://youtu.be/ZDa-Z5JzLYM
Python...

โ–ถ Play video
#

best oop tutorial it helped me allot

cloud dawn
wet crystal
# slate swan https://www.youtube.com/watch?v=ZDa-Z5JzLYM&list=PL-osiE80TeTsqhIuOqKhwlXsIBIdSe...

Object Oriented Programming is an important concept in software development. In this complete tutorial, you will learn all about OOP and how to implement it using Python.

๐Ÿ’ป Code: https://github.com/jimdevops19/PythonOOP

๐Ÿ”— Tutorial referenced for a deeper explanation about repr: https://www.youtube.com/watch?v=FIaPZXaePhw

โœ๏ธ Course develo...

โ–ถ Play video
heavy shard
#

i hope the example class is not Vehicle

wet crystal
#

at 4am

wet crystal
#

so yeeaaaaaaaaaaaaaaah....

slate swan
cloud dawn
#

Then y are saying i'm wasting time, while watching freecodecamp.

slate swan
#

Corey Schafer is a ๐Ÿ

cloud dawn
wet crystal
wet crystal
potent spear
slate swan
heavy shard
#

Bicorn

slate swan
#

๐Ÿ—ฟ

cloud dawn
potent spear
#

they made a typo there

cloud dawn
wet crystal
#

unicoat

potent spear
cloud dawn
#

๐Ÿ’

wet crystal
cloud dawn
#

freecodecamp is meh

slate swan
cloud dawn
#

beep beep i'm a sheep

wet crystal
slate swan
heavy shard
#

official python documentation tutorial is good too, for learning python

potent spear
#

this is the point where imma head out

heavy shard
#

take care!

potent spear
#

peace

wet crystal
#

they mostly go through the docs and put it in a video and make it better understandable for "beginners"

cloud dawn
# wet crystal why tho?

Their code is just not really good and there is not much time spend on research, it's quantity over quality there.

cloud dawn
slate swan
#

fcc mostly uses py2.0 in some of his tutorials

potent spear
#

I never watch long tutorials, I just suck at keeping focus tbh

cloud dawn
#

Same i just make it.

wet crystal
heavy shard
#

i prefer written tutorials over video

slate swan
#

panda = corey

wet crystal
#

see the coincidence

heavy shard
#

Panda's real name is Po

slate swan
#

๐Ÿ˜ณ

wet crystal
#

๐Ÿ‘€

potent spear
cloud dawn
#

Wow expose me like that smh

slate swan
#

๐Ÿ™€

cloud dawn
#

To be completely honest the pandas lib sucks, just use regular python.

slate swan
#

if panda is corey does that mean i can be guido van๐Ÿ˜ณ

wet crystal
cloud dawn
#

sorted and filtered functions easily beats pandas.

slate swan
#

panda

#

what do you think about red pandas?

wet crystal
slate swan
cloud dawn
cloud dawn
slate swan
cloud dawn
#

now

slate swan
#

thats great

cloud dawn
#

Sips cider

slate swan
#

๐Ÿ—ฟ

heavy shard
#

don't drink and Discord, my gramps always said

cloud dawn
#

But it's an apple cider ๐Ÿ˜”

slate swan
#

"said"๐Ÿ˜”

wet crystal
heavy shard
#

don't capitalize variables ๐Ÿ™‚

slate swan
#

nah nah you would need to satisfy arguments @wet crystal

wet crystal
cloud dawn
wet crystal
#

omg

#

bro come on

slate swan
#

!d discord.ext.commands.Context.author

unkempt canyonBOT
slate swan
#

this returns a Member object

wet crystal
#

yeah i know about ctx.author

cloud dawn
wet crystal
#

ok so now wtf do I do with that

slate swan
vast gale
#

๐Ÿ‘€

heavy shard
#

you barely need to construct objects in dpy by yourself

cloud dawn
#

false info

wet crystal
heavy shard
wet crystal
#

no

wet crystal
slate swan
#

well whatever you want really in this case you want to use a Members method right?

slate swan
#

๐Ÿ˜ญ

cloud dawn
wet crystal
#

these are the Members methods right?

wet crystal
cloud dawn
slate swan
#

ok so it seems like you want the id of the voice channel the member is in so it would be ctx.author.voice.channel.id

slate swan
#

i also needed that thanks panda ily

cloud dawn
#

:3 โค๏ธ

heavy shard
#

ส•โ€ขแดฅโ€ขส”

wet crystal
#

(I was connected)

#

)

#

oh wait

#

after like 10minutes it reacted

#

I love my internet speeds

#

@slate swan

THANK YOU SOOOOOOOOOO MUCH

also just for my brain to understand everything ab it more, would you mind telling me why discord.Member.voice.channel.id doesn't work?

heavy shard
#

discord.Member is a class... it's like blueprint for an object instance

wet crystal
#

so ctx.author = Member()
Something like that right?

slate swan
slate swan
#

ctx is an instance of Context and author is a property of such class that returns a member object!

heavy shard
#

somewhere "inside" d.py creates Member(), fills up needed fields, and assigns to ctx.author, roughly speaking

slate swan
#
class Context:

    @property
    def author(self):
       return Member()

its something like this but more complicated and it needs to parse some stuff etc

cloud dawn
#

What okimii is trying to say discord.Member is a template, it gets defined once a command gets invoked. Then it uses the author id to create a member object using the template.

wet crystal
#

also, @cloud dawn I have been listening to drunken sailor for the past 1/2 hour and took it for normal till now haha

#

Wuhu its officially the Thursday now

cloud dawn
#

Imagine living in the uk

heavy shard
#

here's already thursday for 1 hour... and a national Mother's Day

slate swan
#

imagine

#

what if timezones arent a thing and freyinframe is a time traveler๐Ÿ˜ณ

wet crystal
slate swan
#

๐Ÿ˜ณ

#

i would love to

heavy shard
#

Poland

slate swan
#

๐Ÿ‡ต๐Ÿ‡ฑ

cloud dawn
#

It would be so much nicer if everyone had the same time

wet crystal
slate swan
heavy shard
#

<t:1653519900:f> like this?

wet crystal
#

freyoutoframe now๐Ÿฅต

heavy shard
#

we can have same timestamp \o/

wet crystal
slate swan
slate swan
wet crystal
#

dont forget to open a mask resellers buisness and import from chinese kids working 25 hours a day

heavy shard
#

||voodoo||

slate swan
#

๐Ÿ™€

wet crystal
cloud dawn
#

25hrs a day js pretty impressive

wet crystal
slate swan
#

๐Ÿ‘‹

wet crystal
#

๐Ÿ‡ฉ๐Ÿ‡ช

slate swan
cloud dawn
#

Germany is meh

heavy shard
#

||ich habe ein kartoffelsalad in mein lederhosen||

wet crystal
wet crystal
cloud dawn
#

German is also just a drunken spoken dutch dialect

wet crystal
cloud dawn
#

Nah

slate swan
#

im not from the uk so i know nothing shipit

#

i worded that so badly

wet crystal
cloud dawn
#

Acc if i want i can sleep 13 hrs rn

slate swan
wet crystal
slate swan
#

๐Ÿ˜”

#

big strokes

wet crystal
#

looking at Java, python is a blessing

slate swan
#

i agree

#

but you know whats more of a blessing?

#

||You๐Ÿ˜‰ ||

wet crystal
slate swan
#

๐Ÿ˜ญ omg

cloud dawn
wet crystal
cloud dawn
#

They sleep around 12 hrs a day

slate swan
cloud dawn
slate swan
heavy shard
wet crystal
slate swan
#

dont forget about poop

cloud dawn
wet crystal
heavy shard
#

it's a nerd joke, you can google it, valid java code

slate swan
cloud dawn
wet crystal
# cloud dawn No..

first time writing java went like this:

Frey: googled "Hello World! in Java
Frey: sees code
Frey: rewrites into VSCode
Frey: gets 18 errors, pc crashes

wet crystal
slate swan
#

interesting

wet crystal
slate swan
#

same

wet crystal
#

thankfully scratch is the most Java thing I have ever touched

heavy shard
#

what about minecraft?

slate swan
#

good thing js is just

console.log("Hello World!");
slate swan
slate swan
#

it even has types๐Ÿ˜ณ

heavy shard
#

i mean minecraft as a whole... it's written in java

slate swan
#

depends

wet crystal
#

Imagine a full stack Java dev seeing everyone recreating his 5000 code project in 9 lines in py

slate swan
#

minecraft bedrock edition is written in cpp while minecraft java edition is ofc written in java

slate swan
#

yep i mostly just use cpp since it means C plus plus and because thats the file ext

wet crystal
#

Is C++ worth learning?

#

for 100% legal pruposes

slate swan
#

its one of the most powerful languages yes but remember its can make your ram go boom

#

since just a hello world function can be vulnerable in many ways

slate swan
#

no but i dont mean overloading it iirc it can like break it some how idk

#

probably overloading and other dangerous stuff

wet crystal
slate swan
#

๐Ÿ—ฟ

wet crystal
slate swan
#
 global _main
    extern _printf

    section .text
_main:
    push    message
    call    _printf
    add        esp, 4
message:
    db    'Hello World', 10, 0

assembly

#

๐Ÿ—ฟ

wet crystal
# slate swan ```assembly global _main extern _printf section .text _main: push ...

arm 64

.data

/* Data segment: define our message string and calculate its length. */
msg:
    .ascii        "Hello, ARM64!\n"
len = . - msg

.text

/* Our application's entry point. */
.globl _start
_start:
    /* syscall write(int fd, const void *buf, size_t count) */
    mov     x0, #1      /* fd := STDOUT_FILENO */
    ldr     x1, =msg    /* buf := msg */
    ldr     x2, =len    /* count := len */
    mov     w8, #64     /* write is syscall #64 */
    svc     #0          /* invoke syscall */

    /* syscall exit(int status) */
    mov     x0, #0      /* status := 0 */
    mov     w8, #93     /* exit is syscall #93 */
    svc     #0          /* invoke syscall */
#

what are these languages for even?

slate swan
#

god bless python is a thing

wet crystal
slate swan
#

so i wouldnt need to use assembly or arm64

wet crystal
#

Java still worse tho lol

slate swan
#

imagine needing to write like 200 lines of code just for a hello world๐Ÿ˜ญ

wet crystal
slate swan
#

๐Ÿ˜ญ imagine

wet crystal
#

have you heard about these troll languages

slate swan
#

nope

heavy shard
#

like brainf**k ?

wet crystal
#

like for example "brainfuck"

slate swan
#

heard of it never seen its syntax

wet crystal
heavy shard
#

i'd add break if len(output_str_A) > some_threshold

#

or more difficult, split it into several embeds

heavy shard
wet crystal
heavy shard
#

๐Ÿ™‚

wet crystal
#

why do people do it/need it again?

heavy shard
#

to prove they're skilled

regal pulsar
#

make 2 embeds

#

split the text in half

heavy shard
#

it's doable, you can use sets, but it would be easier if i saw example json() output

regal pulsar
#

or iterate over 2k characters

#

for duplicate names just use a second list and pass a check

#
for name in names:
    if name not in names2:
        names2.append(name)
azure nebula
#
@bot.command()
async def verify(ctx, member:discord.Member):
  role = discord.utils.get(ctx.guild.roles, name="Usuario")
  await member.add_roles(role)```
potent spear
azure nebula
#

discord.ext.commands.errors.MissingRequiredArgument: member is a required argument that is missing.

potent spear
#

!verify @azure nebula
will work fine

#

since you typehinted the member arg, ID's, names and channelmentions all work

azure nebula
#

it's not

potent spear
#

you don't have another command named verify right?

azure nebula
#

no

haughty nova
#
from email import message
import discord
import random

TOKEN = 'Token'

client = discord.Client()

client.event
async def on_ready():
    print('we have logged in as {0.user}'.format(client))



@client.event
async def on_massage(message):
     username = str(message.author).slipt('#')[0]
     user_massage = str(message.content)
     channel = str(message.channel.name)
     print(f'{username}: {user_massage}({channel})')

     if message.author == client.user:
         return

     if message.channel.name == 'vagt-kill':
        if user_massage.lower() == '!vkc':
             response = f'@everyone det er vagt kill i b! Join VK B nu!'
             await message.channel.send(response)
             return
        elif username.lower() == '!vkb':
            response = f'@everyone det er vagt kill i b! Join VK B nu!'
            await message.channel.send(response)
            return
        elif username.lower() == '!vka':
            response = f'@everyone det er vagt kill i b! Join VK B nu!'
            await message.channel.send(response)
            return

    


client.run(TOKEN)```
none errors but when I type !vkc in vagt-kill in my discord server nothing happens
potent spear
azure nebula
#

already tried

potent spear
#

!paste

unkempt canyonBOT
#

Pasting large amounts of code

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

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

potent spear
#

you're currently using on_message as some sort of command system, which isn't really its intended use

heavy shard
#

slipt is not a str-ing method

haughty nova
#

how do i check that? (btw I am new to pytohn)

potent spear
#

it's splitmhm, but still, not a good implementation

potent spear
#

note, you'll need to change you bot constructor to commands.Bot instead of discord.Client

#

check out a basic bot example

potent spear
#

you should always have an else: ...

#

since you're just hiding other errors

haughty nova
potent spear
#

lol, didn't even see that import

#

anyways, he might be able to keep it, but then just from toilet import shit as snack

regal pulsar
azure nebula
regal pulsar
#

lmao

potent spear
#

what do you expect, that it'll verify yourself if you don't pass a member argument?

haughty nova
potent spear
#

you might've copy pasted it then

regal pulsar
#

yeah it auto imported

#

its just your ide trying to help you out

potent spear
#

anyways, start looking into commands asap

haughty nova
potent spear
#

and DON'T follow YT tutorials

haughty nova
#

yes

#

thank you

haughty nova
#

asking you?

potent spear
haughty nova
#

ok thank you very much

regal pulsar
#
@bot.command()
async def ping(ctx: commands.Context):
    await ctx.channel.send(fโ€Latency is {bot.latency}โ€)
#

basic command structure

azure nebula
#

I don't get it.

regal pulsar
#

!d discord.ext.commands.Bot.latency

unkempt canyonBOT
#

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

This could be referred to as the Discord WebSocket protocol latency.
regal pulsar
#

ah yes

regal pulsar
#

like !verify @user

azure nebula
potent spear
regal pulsar
#

what do you mean dont get it

#

i just sent what you had to do ๐Ÿ’€

regal pulsar
heavy shard
#

heh when Emotional Support needs emotional support ๐Ÿ™‚

potent spear
haughty nova
#

I just want an discord bot that write a massage when you type !vkc

#

are I'm wrong or I don't feel like I need a long code like I have?

#

Isn't it a very easy thing to do when you think about it?

regal pulsar
#

its easy if you know the very basics of python and discordโ€™s api

haughty nova
#

ok

#

But how many lines do you think it's should be?

regal pulsar
#
import discord
from discord.ext import commands

bot = commands.Bot(command_prefix=โ€œ!โ€)

@bot.command()
async def vks(ctx):
    await ctx.send(โ€œOkโ€)

bot.run(token)

#

@haughty nova

haughty nova
#

should it work?

regal pulsar
#

why would i send you code that doesnt work

#

;-;

azure nebula
regal pulsar
haughty nova
#

oohhh

regal pulsar
#

im on mobile so itโ€™s different

haughty nova
#

so the " is the command?

regal pulsar
#

no

#

its just a string

haughty nova
#
from discord.ext import commands

TOKEN = 'Token'```

bot = commands.Bot(command_prefix=!vkc)

@bot.command()
async def vks(ctx):
    await ctx.send(โ€œOkโ€)

bot.run(token)```
#

so not like that?

haughty nova
#

sorry if I don't understand

heavy shard
regal pulsar
unkempt canyonBOT
#

class discord.Member```
Represents a Discord member to a [`Guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild "discord.Guild").

This implements a lot of the functionality of [`User`](https://discordpy.readthedocs.io/en/latest/api.html#discord.User "discord.User")...
regal pulsar
#

wait i forgot the method

azure nebula
livid hinge
#

add_roles?

regal pulsar
#

:d discord.Member.add_roles

#

!d discord.Member.add_roles

unkempt canyonBOT
#

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

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

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

ok

regal pulsar
#

thought it was give roles for a sec

azure nebula
#
@bot.command()
async def verify(ctx, member:discord.Member, reason=None):
  role2 = discord.utils.get(ctx.guild.roles, name='Usuario')
  await add_roles(role2)```?
livid hinge
regal pulsar
#

hmm

#

maybe learn a bit pf python ๐Ÿ’€

azure nebula
regal pulsar
#

and check the docs

#

member.add_roles

#

and you dont need reason

azure nebula
#

ye ik

haughty nova
#

wait

azure nebula
#
@bot.command()
async def verify(ctx, member:discord.Member):
  role2 = discord.utils.get(ctx.guild.roles, name='Usuario')
  await member.add_roles(role2)``` so this is supposed to work?
livid hinge
#

!d discord.utils.get

unkempt canyonBOT
#

discord.utils.get(iterable, /, **attrs)```
A helper that returns the first element in the iterable that meets
all the traits passed in `attrs`. This is an alternative for
[`find()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.utils.find "discord.utils.find").

When multiple attributes are specified, they are checked using
logical AND, not logical OR. Meaning they have to meet every
attribute passed in and not one of them...
regal pulsar
#

maybe try it

#

and tell us yourself

azure nebula
haughty nova
#

so

from discord.ext import commands

TOKEN = 'Token'

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

@bot.command()
async def vks(ctx):
    await ctx.send("Ok")

bot.run(token)```

I can't have the TOKEN = ''
in caps
becuase it's say "token" is not defined
regal pulsar
#

who else will you give the role to

azure nebula
#

I want it to give the role to the person who executes the command

regal pulsar
#

oh

#

then just

haughty nova
#

but when i change TOKEN to token it works?

azure nebula
haughty nova
azure nebula
#

wdym

#

just replace 'Token' with the token

regal pulsar
#
@bot.command()
async def verify(ctx):
  role = discord.utils.get(ctx.guild.roles, name='Usuario')
  await ctx.author.add_roles(role)
azure nebula
#

I also tried that before

regal pulsar
#

well what was the error

livid hinge
#

is "Usuario" really the exact name

azure nebula
#

yes

haughty nova
azure nebula
#

don't use bot.run(token)

#

use bot.run(TOKEN)

regal pulsar
#

im starting to think you havnt made a bot on the dev portal

haughty nova
#

I have

livid hinge
#

doesnt show anything?

regal pulsar
#

then just run that token

haughty nova
#

it's just errors in the vsc

livid hinge
#

you might need Intents.message_content

azure nebula
#

replace token in 'token' to the token of the bot

regal pulsar
#
TOKEN = โ€œyour tokenโ€
bot.run(TOKEN)

haughty nova
#

i have

livid hinge
#

seems like in some versiom of dpy that intent is no longer default

regal pulsar
#

discord updated their api

#

changed how intents are assigned

azure nebula
#

How can I make a command only work in a specific channel?

regal pulsar
#
@bot.command()
async def test(ctx):
    channel = discord.utils.get(ctx.guild.channels, name='general')
    if ctx.channel == channel:
        โ€œrun commandโ€
slate swan
regal pulsar
#

๐Ÿคฆโ€โ™‚๏ธ

heavy shard
#

not in quotes :S

haughty nova
#
from discord.ext import commands

TOKEN = 'token'

bot = commands.Bot(command_prefix="!vkc")

@bot.command()
async def vks(ctx):
    await ctx.send("Ok")

bot.run(TOKEN)```

When i run the code in vsc and then types the command in my discord server nothing happens?
slate swan
slate swan
#

All good

regal pulsar
#
@bot.command()
async def test(ctx):
    channel = await ctx.guild.get_channel(channel_id)
    if ctx.channel == channel:
        โ€œrun commandโ€
azure nebula
#

id in quotes?

regal pulsar
#

not !vkc

haughty nova
#

ahhhh

regal pulsar
azure nebula
#

?

haughty nova
#

omfg how stupid can i be

azure nebula
#

ok

regal pulsar
slate swan
heavy shard
#

i think he's gonna need intent, too

slate swan
regal pulsar
#

im on mobile too lmao

slate swan
#

I dont think so lol

azure nebula
haughty nova
#

Thank you. it's works now but i want it to ping. For example @ Falxee Det er vk i c! Join VK C nu! it writes that but i don't get pinged. Why?

#

and yes it's not a space between @ and F in the code

heady patio
#

I need someone to help me

haughty nova
#

with what

heady patio
#

I have been trying to make a discord bot with python I followed tutorials and have learned some from friends but they don't work out

haughty nova
#

just send the code and a picture of the errors

heady patio
#

Ok!

#

Hold on nvm I think I just found how to do it

haughty nova
#

Ok

slate swan
#

Its basically the same thing

#

Use the ctx one in a @bot.command()

#

my bad if I confused u now.
fu**

#

!d discord.Member.mention

unkempt canyonBOT
heavy shard
haughty nova
#

Okey thank you frey and rudolf

slate swan
haughty nova
#

๐Ÿ™‚

heavy shard
#

okay FreyFX Frey!

slate swan
#

@haughty nova u could implement it something like this

@bot.command
async def test(ctx)
    await ctx.send(f"{ctx.author.mention} is asking for this!")

I would assume thats how it works if not maybe Rudolf can correct me

slate swan
haughty nova
#

Ok thanks! ๐Ÿ™‚

#

but if i want it to tag everyone how do I do it then?

#

or should i say you

supple thorn
heavy shard
haughty nova
#

Thank you very much!

#

๐Ÿ™‚

#
from discord.ext import commands

TOKEN = 'token'

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

@bot.command()
async def vkc(ctx):
    await ctx.send("{ctx.guild.default_role.mention} Det er vk i c! Join VK C nu!")

bot.run(TOKEN)```

https://gyazo.com/b51aa0ceefe9a5051827d334afcf92b7
heavy shard
haughty nova
#

aahhh

dusky pine
#

await ctx.send(f"{ctx.guild.default_role.mention} Det er vk i c! Join VK C nu!")
^

haughty nova
#

Thank you very very much

#

Probably something very easy to fix...

dusky pine
#

wait actually, why not just do
await ctx.send("@everyone Det er vk i c! Join VK C nu!")

haughty nova
#

you don't get tagged

dusky pine
#

o

haughty nova
#

or maby

dusky pine
#

does the bot have permission to ping everyone

haughty nova
#

Yes

#

shit

#

await ctx.send(" @ everyone Det er vk i c! Join VK C nu!")

dusky pine
#

there are spaces

#

o

haughty nova
#

I know

#

but i tested before and it didn't work

#

but i cant send @ everyone here

#

because the message will be removed

dusky pine
#

try this?

allowed_mentions = discord.AllowedMentions(everyone = True)
await ctx.send("@everyone Det er vk i c! Join VK C nu!", allowed_mentions=allowed_mentions)
haughty nova
#

Yes! Thank you!

#

Thank you very very much

#

But one more question

#

Is there a way to make that the bot reacts to it's own message with differente reactions?

dusky pine
#

yep

#
msg = await ctx.send("hello")
await msg.react("๐Ÿ˜Ž")
await msg.react("๐Ÿ”ฅ")
#

@haughty nova

haughty nova
#

thank you

#

very much

steep drift
#

I need some help with a bot.

#

Basically I'm trying to make a polls bot, and I made a list with functions in it, the list then chooses a random function (which has a poll in it, each function being a different poll), I also add two different options for the person to react to, sadly this doesn't work.

#

Here is a snippet of my code.

ebon island
#

Helping my friend set up a basic bot and running into an error on inputting a command_prefix in Bot instantiation, I have checked his code and it is correct. We enabled message intent from within the Discord dev portal.

The following error is returned on startup:

MessageContentPrefixWarning: Message Content intent is not enabled and a prefix is configured. This may cause limited functionality for prefix commands. If you want prefix commands, pass an intents object with message_content set to True. If you don't need any prefix functionality, consider using InteractionBot instead. Alternatively, set prefix to disnake.ext.commands.when_mentioned to silence this warning.
steep drift
# steep drift Here is a snippet of my code.
@client.event
async def on_message(message):
  if message.author == client.user:
    return

  if message.content.startswith("!poll"):
    poll_list = [poll_1, poll_2, poll_3, poll_4, poll_5, poll_6, poll_7, poll_8, poll_9, poll_10]
    poll_choice = random.choice(poll_list)
    await message.channel.send(poll_choice)```
#

Also, each poll function is like this.

unkempt canyonBOT
#
Huh? No.

No documentation found for the requested symbol.

steep drift
stone beacon
#

Heh say less

supple thorn
unkempt canyonBOT
#

class disnake.ext.commands.InteractionBot(*, sync_commands=True, sync_commands_debug=False, sync_commands_on_cog_unload=True, test_guilds=None, **options)```
Represents a discord bot for application commands only.

This class is a subclass of [`disnake.Client`](https://docs.disnake.dev/en/latest/api.html#disnake.Client "disnake.Client") and as a result
anything that you can do with a [`disnake.Client`](https://docs.disnake.dev/en/latest/api.html#disnake.Client "disnake.Client") you can do with
this bot.

This class also subclasses InteractionBotBase to provide the functionality
to manage application commands.
stone beacon
#

Cool cool

#

I thought it was different than the others

heavy shard
#

poll_choice is set to a function, you want to call it
passing the arguments you need there

stone beacon
#

!d disnake.Intents

unkempt canyonBOT
#

class disnake.Intents(**kwargs)```
Wraps up a Discord gateway intent flag.

Similar to [`Permissions`](https://docs.disnake.dev/en/latest/api.html#disnake.Permissions "disnake.Permissions"), the properties provided are two way.
You can set and retrieve individual bits using the properties as if they
were regular bools.

To construct an object you can pass keyword arguments denoting the flags
to enable or disable...
steep drift
heavy shard
heavy shard
#

therefore, poll_choice will be a function (one of these), so you need to call it like normal function

heavy shard
#

almost... you need to pass some arguments because the function needs ctx to work
also, do you really need to pass text ?

ebon island
steep drift
heavy shard
#

ok so let me help you, the function inside needs context ( ctx ) so you need to pass it: poll_choice(ctx)
but the function has to use await ctx.send( .. ) so it has to be async function: async def poll_1(ctx):
then you call it with await poll_choice(ctx)

#

i assume all your functions poll_1 poll_2 poll_3 etc. look similar and don't use text argument inside

steep drift
heavy shard
#

ugh sorry, you want to pass message, i'm too used to bot commands

ebon island
#

Do you guys have any idea about the error posted above?

steep drift
stone beacon
#

intents = disnake.Intents()
intents.members = True
then pass intents as a kwarg to your bot when initializing it just like command prefix

#

probably

ebon island
#

we did that

#

and it's still not working

heavy shard
stone beacon
#

and they said what to do to remove the warning right there

#

prefix / command_prefix etc

#

try it

steep drift
heavy shard
#

do it for each poll_

steep drift
ebon island
steep drift
heavy shard
#

mhm, you want either poll = await message.reply( ... ) or poll = await message.channel.send( ... )

#

depends whether you want it a reply to command or just plain message

steep drift
#

k got it

ebon island
#

nor is it working with intents.members = True

stone beacon
#

Mind my blindness lol sorry

#

Go to the discord dev portal

#

Go to bot and there should be an option to enable message intents there

steep drift
#

poll.add_reaction(":red_circle:")

stone beacon
#

Idr if it's still there

ebon island
#

it is enabled

#

and is definitely saved

stone beacon
#

o0

heavy shard
stone beacon
#

Try intents.messages = True

stone beacon
#

nvm

#

idk what's the problem

#

If you're sure you got message intents enable in the dev portal and locally then idk

ebon island
#

yes

steep drift
heavy shard
heavy shard
stone beacon
#

!d disnake.Intents.message_content

unkempt canyonBOT
stone beacon
#

Bruv

#

!d nextcord.Intents.messages

unkempt canyonBOT
stone beacon
#

lmao.. my bad

steep drift
heavy shard
ebon island
#

it says that this shouldn't be enforced until the end of August either and only for servers with 100+ members

steep drift
heavy shard
#

but before, in .send, are you await-ing for send?

steep drift
#

so I put the await when the variable is defined, okay

steep drift
#

Wait, I'm going to remove the await for it.

steep drift
#

Weird.

#

How can I fix this.

heavy shard
#

one sec

glossy ruin
#

is it ok to put several version of one command inside a separate cog?

steep drift
#

Okay.

ebon island
#

they won't work separately

#

they will be overwritten if you mean the method definition, and I think if it is command declaration it will throw an error that the command is already registered

heavy shard
zealous jay
#

How do I skip servers when the bot doesn't have permissions on it?

#

This is the error btw
Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

#

I guess I could check if the bot has permissions but I don't know how to do that

heavy shard
zealous jay
#

thanks

#

I should create an error handler tho

heavy shard
echo wasp
#

Locking channels that command channel you do it in or all where to start

zealous jay
#

what does this means?
Forbidden: 403 Forbidden (error code: 60003): Two factor is required for this operation

echo wasp
zealous jay
#

Error here

#

and no

#

It prints some bans and then it gives that error

echo wasp
zealous jay
#

i think it's some weird with 2fa on servers

#

anyways I just used a try and except

#

so I skip that

steep drift
heavy shard
#

it should work now

steep drift
#

But there still isn't any reaction

heavy shard
#

your bot needs add_reaction permission

steep drift
#

Wait!

#

It works now!

heavy shard
#

ha!

steep drift
#

tysm

heavy shard
#

yvw

steep drift
heavy shard
#

go on

steep drift
#

How would I make it so that every other day (every 48 hours) it says a poll message in a text channel named something, and only if a channel is named that will it work like a channel named #cool-polls or #polls otherwise it wouldn't run.

heavy shard
#

you would need a background task

#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True)```
A decorator that schedules a task in the background for you with
optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/latest/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
echo wasp
#

How do I make my bot lock all channels in the server?

supple thorn
#

In every channel

echo wasp
supple thorn
unkempt canyonBOT
#

property text_channels```
A list of text channels that belongs to this guild.

This is sorted by the position and are in UI order from top to bottom.
supple thorn
#

Just loop through this

echo wasp
#

Looked at docs just how do I loop though

#

How?

supple thorn
#
for channel in ctx.guild.text_channels:
    ...
#

And just change the default role's perm in the channel

slate swan
#

Are buttons on discord py?

spring verge
#

I wanted to ask that if I should make a count down like timer which edits footer of embed by editing initial interaction (cuz its a slash command).. like I am unsure about the rate limits.. Or I had another idea for removing and re-adding a disabled button every second to show countdown but again will it be bad for rate limit?

echo wasp
steep drift
#

:)

echo wasp
#

@supple thorn

#

๐Ÿ˜ž someone help please

heavy shard
#

!d discord.Role.edit

unkempt canyonBOT
#

await edit(*, name=..., permissions=..., colour=..., color=..., hoist=..., display_icon=..., mentionable=..., position=..., reason=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Edits the role.

You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to
use this...
heavy shard
#

to get role by id, guild.get_role(ROLE_ID)

echo wasp
#

Ohhhh that is easier to lock down the server

#

Thanks

supple thorn
echo wasp
#

How would I do that

slate swan
#

Can bots not read messages in threads?

slate swan
unkempt canyonBOT
#

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

Sets the channel specific permission overwrites for a target in the
channel.

The `target` parameter should either be 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") that belongs to guild...
slate swan
#

loop on all the Guild.text_channels, and use this

supple thorn
#

I was typing out the example but that's probably all they need

slate swan
supple thorn
#

Oh yes sarth

slate swan
slate swan
#

Thanks mate.

alpine pewter
#

Does anyone know if you're able to automatically grab a message id sent from a bot, then use it to edit the message after in a loop?

slate swan
#

Context.send returns a message object so you can just use the id attribute the Message class has

#

!d discord.ext.commands.Context.send

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

Sends a message to the destination with the content given.

This works similarly to [`send()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for non-interaction contexts.

For interaction based contexts this does one of the following...
slate swan
unkempt canyonBOT
alpine pewter
#

Okay, let me check it.
Thank you ๐Ÿ™‚

#

Do you mind if you have time showing me an example?
I don't' quite understand fully with just that.

slate swan
#

Is buttons supported on d.py?

slate swan
slate swan
#

Oh is it possible to make a ticket bot tho?

#

yes.

alpine pewter
# slate swan ```py message = await ctx.send(...) print(message.id) ```
@tasks.loop(seconds=50)
async def playersOnline():
    async with aiohttp.ClientSession() as session:
        output_str_A = ""
        total_a = 0
        total_b = 0

        for id in SE_1_SERVICE_ID:
            channel = bot.get_channel(SE_1_CHANNEL_ID)
            message = await channel.fetch_message(SE_1_MSG_EDIT_ID)
            
            headers = {"Authorization" : key.nitrado_key}
            url = f"https://api.nitrado.net/services/{id}/gameservers/games/players"
            response = await ( await session.get(url, headers=headers)).json()
            #response = requests.get(url, headers=headers).json()

            for item in response["data"]["players"]:
                if item["online"] == True:
                    #print(item["name"])
                    output_str_A += "`๐ŸŸข` `>` `Player Online`\n`GT:` " + str(item["name"]) + "\n\n"


        embed = nextcord.Embed(title="`Nitrado Obelisk - Server Management`", description=output_str_A, color=3066993)
        #embed.add_field(name="Global Player Count", value=f"`๐ŸŒ` `({total_a}/{total_b})`", inline=True)
        embed.set_footer(text="Updates erver 300s (5m)")
        #await channel.send(embed=embed)
        await message.edit(embed=embed)

So, for something like this, how would I have it post a message, then get the ID and stop reposting it?
I manually shut it off, copy the ID, then put a # to cancel the await channel.send(...)

I just don't understand how you'd only have it send once then edit only after.

slate swan
#

Any tutorials?

alpine pewter
#

I'm sorry, I don't understand how that would work ๐Ÿ˜ญ
Can you show me? I'm still kinda newish.

maiden fable
#

๐Ÿ˜” why does PyLance hates me

keen talon
maiden fable
keen talon
maiden fable
#

Meh idc

slate swan
#

Why does my python bot keeps sending messages when I sent message that isn't even contains in message.content.lower?

#chat bot
@client.event
async def on_message(message):
    if message.author == client.user:
        return

    if 'hello' in message.content.lower():
        await message.channel.send(random.choice(greetings))
        time.sleep(1)
        await message.channel.send(random.choice(cq))

maiden fable
#

what r u sending in the chat

keen talon
abstract kindle
#

ayo, can you add select options to modals?

#

or is it just text inputs

keen talon
#

Idk man , didn't use disnake for months

abstract kindle
maiden fable
#

Bruh istg Motor sucks

slate swan
slate swan
maiden fable
slate swan
#

peter already corrected hunter๐Ÿ˜น๐Ÿ˜ผ

maiden fable
slate swan
#

what

slate swan
#

type hinting is the easiest(depending on your lib ofc)

maiden fable
slate swan
#

๐Ÿ—ฟ

maiden fable
slate swan
#

imagine using me instead of a self

maiden fable
#

Totally me

slate swan
#

smh

maiden fable
slate swan
#

even this might be acceptable but me

maiden fable
slate swan
maiden fable
#

I feel like I am using Vanilla JS since no typehints

slate swan
slate swan
#

weirded

slate swan
maiden fable
#

Ik lmao

slate swan
#

๐Ÿ˜น

maiden fable
slate swan
#

Linux folder in windows 11

maiden fable
#

Uh yea

slate swan
#

which i cant delete

maiden fable
#

Wait u updated to W11?

slate swan
slate swan
maiden fable
#

BTW tell me smth, if I want to update the whole MongoDB, should I delete everything from the db every 5 min and then upload new stuff or just update?

maiden fable
warped mirage
#

Hello

slate swan
slate swan
#

i know

maiden fable
#

Delete WSL

slate swan
#

i deleted wsl but the Linux folder is still vibin

maiden fable
#

Cool

warped mirage
#

So ye

maiden fable
slate swan
maiden fable
slate swan
warped mirage
#

Iโ€™m leaving warnsystem till last and not waste time tbf , work on other stuff till then

maiden fable
#

Cool

slate swan
maiden fable
#

I am fine ๐Ÿ˜”

slate swan
slate swan
abstract kindle
#

back ur shit up before u do this bro

slate swan
#

nvm im going to sleep

maiden fable
#

istg PyMongo docs are way better

abstract kindle
#

delete_many is dangerous

slate swan
#

๐Ÿ—ฟ just use sql~

maiden fable
slate swan
abstract kindle
#

why would you need to update the keys?

#

would a second column with another kind of id not work?

maiden fable
maiden fable
abstract kindle
#

and you want to update user_id?

maiden fable
#

Nope

#

I want to update the dict contained by the user_id key

abstract kindle
#

and update_one / update_many doesn't work because

maiden fable
#

Idrk tbh never tried it. Still new to Motor sooo

#

Wait there is nothing like update_many?

warped mirage
#

Damn

maiden fable
#

Nvm there is

warped mirage
maiden fable
warped mirage
#

Well mongo is easy for js, py is hard ig

maiden fable
#

Hard cz no typehints

warped mirage
#

Yh

#

I will need help with warn system maybe someday if u might be able to help

elfin island
#

solution: dont use mongodb :troll:

abstract kindle
#

Lol I'm using mongodb rn and its doin its job

#

I wonder why things like mongo exist if everyone seems to find SQL databases superior

maiden fable
elfin island
#

the first dict you pass to update_one should be a filter, to specify which document you want to update