#discord-bots

1 messages · Page 567 of 1

slate swan
#

Why what can I do with that?

#

I can host anything I want on it?

#

even sites?

#

sites too?

#

which one do I buy?

#

the one for 120 dollars?

hasty iron
#

buy the one with the specs that you need

#

but it’s better to go for a vps

slate swan
#

I don't understand anything when it comes to raspberry pi

#

if you are ONLY going to do discord bots, dont go for the raspberry pi

#

I don't like amazon

#

yup

#

btw, how can I check if a guild has a role by its name

#

bruh are you really going to buy a pi4 only for a discord bot

simple fractal
#

hey any help guys

slate swan
#

should do the trick but idk if it's the best approach

simple fractal
#

?

slate swan
#

it doesn't find muted in roles

slate swan
#

Rpi 4 is good

slate swan
#

try printing the roles list

#
[<Role id=902282029171867729 name='ModMail'>, <Role id=901121411639296090 name='Owners'>, <Role id=902177890932756510 name='Admins'>, etc...
#

well there you go

#

I got it working like this instead:

[role.name for role in ctx.guild.roles[:0:-1]]
#

yeah

#

For a discord bot just no a vps is better and cheaper

brave ravine
#

i am having trouble renaming files - my code renames all the files in the directory the same thing instead of the one that just was downloaded

for file in os.listdir("./"):
                name = file
                print(f"Renamed File: {file}\n")
                os.rename(file, fileName + ".txt")```
slate swan
slate swan
# slate swan yeah
    async def mute(self, ctx, member: Member):
        await ctx.message.delete()
        guild_roles = [role.name for role in ctx.guild.roles[:0:-1]]

        if not member:
            await ctx.send(":x: You need to mention a member or provide an ID to execute this command!", delete_after=3)

Now this wont work 😦 it doesn't send the message

slate swan
#

how do i add a picture onto an embed?
e.g.

@bot.command(aliases=["embed", "embeds"]) 
async def embed(ctx):  
 embed=discord.Embed(title="embeds", description="This demonstrates how embeds are made", + url = *urlofpic*, color = 0xEEAA41)  
 embed.set_author(name="BOT NAME")
#

@slate swan do yk?

#

set_thumbnail

brave ravine
#
@bot.command()
async def help(ctx):    
    helpme = discord.Embed(title="",
                        color=0x5865F2)
    helpme.set_thumbnail(url='...')

    await ctx.send(embed=helpme)```
slate swan
#

not thumbnail, just a picture below

#

oh

candid ore
#
        profile = self.bot.profile
        profile["_id"] = ctx.author.id
        profile["name"] = f"{ctx.author.name}#{ctx.author.discriminator}"
        inv = self.bot.inv
        inv["_id"] = ctx.author.id
        island = self.bot.island
        island["_id"] = ctx.author.id
        invmats["_id"] = ctx.author.id
        invmats = self.bot.invmats
        invbox["_id"] = ctx.author.id
        invbox = self.bot.invbox

File "/home/container/.local/lib/python3.8/site-packages/discord/client.py", line 351, in _run_event
await coro(args, kwargs)
File "/home/container/cogs/bot/events.py", line 26, in on_command_error
raise error
File "/home/container/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 167, in wrapped
ret = await coro(args, kwargs)
File "/home/container/cogs/players/play.py", line 24, in start
invmats["_id"] = ctx.author.id
TypeError: 'AsyncIOMotorCollection' object does not support item assignment

#

Anyone?

slate swan
slate swan
#

doesnt it have batteries?

#

No it doesnt have batteries it goes directly to the wall

#

I think some do but idk

slate swan
forest blade
#

Still would have to buy batteries if it did

tribal torrent
#

how come i defined a data variable in the global scope but it isnt being detected?


global data
data = json.load(open("data.json"))

@bot.listen('on_message')
async def on_message(message):
    await bot.wait_until_ready()
    if message.channel.id == data['channel']:

the error is UnboundLocalError: local variable 'data' referenced before assignment

slate swan
#

So dont

kindred epoch
#

raspberry pi is good for small server bots/personal bots

slate swan
#
@bot.command(aliases = ["AVATAR","Avatar"])
@commands.cooldown(1, 3, commands.BucketType.user)
async def avatar(ctx, member : discord.Member = None):
    async with ctx.typing():
        await asyncio.sleep(0.4)
        if member == None:
            member = ctx.author
        if ctx.channel.id != 835236006713098304:

            emb = discord.Embed(color=0x2f3136)
            emb.add_field(name="Вызивать команды допускатеся здесь [#835236006713098304](/guild/267624335836053506/channel/835236006713098304/)", inline=True)
            await ctx.send(embed=emb)
            return

why doesn't the bot write anything?

kindred epoch
slate swan
#

i wanted the picture to be where it said ```embed = discord.Embed(title='STATEMENT', color = 0x000000

#

can someone help me with that?

kindred epoch
#

huh?

slate swan
#

i'm so confused

slate swan
steady flume
#

guys, how to make the bot output that number of characters (like !) how much will fall out in random.randint ??

kindred epoch
steady flume
#

random.randit(a, b)

dense swallow
#

For that u can also use random.choice()

steady flume
dense swallow
#

For numericals randint is fine

steady flume
#

then how to make the bot output that number of characters ?

#

which will fall in randit

dense swallow
#

By making a list and then sending a random amount? Is that what u mean?

steady flume
#

didnt understan

slate swan
#

You explained it like he said

velvet relic
kindred epoch
dense swallow
#
import random

x = ['!', '!!','!!!', '!!!!', '!!!!!', '!!!!!!']
print(random.choice(x))
#

This is one example

steady flume
#

hmhmhmhm

#

okey, ty bro!

dense swallow
#

Np 👍

thick sigil
#

I think he meant he inputs the number of time he wants the bot to send the character

dense swallow
#

Oh so u need input

steady flume
thick sigil
#

then randint

dense swallow
#

it just sends, u don't want it to send the amount that ur specifying?

kindred epoch
steady flume
#

DTS alreade helped

unkempt canyonBOT
#

Hey @slate swan!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

kindred epoch
#

ok

thick sigil
slate swan
#

bruhhhhhhhhhh

thick sigil
#
"!" * random.randint(1,20)```
slate swan
# slate swan Explain

the picture that is sent as a thumbnail, i want it where it says embed = discord.Embed(title='STATEMENT', color = 0x000000

unkempt canyonBOT
#

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

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

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

How can I edit the channel perms for a specific role?

#
await ctx.guild.create_role(name="muted", permissions=Permissions(send_messages=False, read_messages=True), mentionable=False)
await ctx.channel.set_permissions(name="muted", permissions=Permissions(send_messages=False, read_messages=True))
#

I tried this, but it wont add the "muted" role perms to the channel

#

I followed the docs

kindred epoch
#

hm

#

replacfe name="muted" to target

slate swan
#

alright

#

Nope, it doesn't add the muted role to the channel perms

hard trail
#

How do I put in my Discord application key into my code?

slate swan
#

Would anyone know how i can convert hex into a embed colour?

kindred epoch
slate swan
slate swan
thick sigil
hard trail
slate swan
hard trail
slate swan
#

Dont know why you need the application key tbh

hard trail
slate swan
#

Is "developer application key" even a thing never heard of it

violet nymph
#

He probably means the bot token

kindred epoch
#

theres application id and then theres public key

kindred epoch
slate swan
hard trail
#

Application id

kindred epoch
slate swan
slate swan
kindred epoch
hard trail
#

Wait hold on isn't an Api key = application id

slate swan
kindred epoch
#

what part are you stuck on? just tell me that and ill guide u from there

hard trail
#

Basically from the start. I need an api key for my bot

violet nymph
#

What are you trying to make?

slate swan
kindred epoch
hard trail
slate swan
#
@bot.command()
async def embed(ctx):

    embed = discord.Embed(title="Thi", color=0x5865F2)
    embed.set_image(url = "img/number.png")
    await ctx.send(embed=embed)

?

hard trail
#

Yes it's bot.run('my token')

slate swan
#

You dont need the application id or api key and i dont think you can get a api key

violet nymph
kindred epoch
#

3 people helping at the same time wont help him

hard trail
kindred epoch
hard trail
#

look hold on

kindred epoch
slate swan
kindred epoch
unkempt canyonBOT
#

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

Note

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

Yeah its by url or a file

#

Cant think of another way

#

!d discord.Embed

unkempt canyonBOT
#

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

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

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

New in version 2.0.

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

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

dave

slate swan
slate swan
slate swan
slate swan
#

I ment him by @slate swan

#

oh ye, that as in i needed directions

slate swan
slate swan
#

imagine not adding me back

#

couldn't be me

slate swan
slate swan
kindred epoch
slate swan
kindred epoch
slate swan
kindred epoch
#

and as i always do it, i rejected it 🙂

slate swan
untold haven
#

help....

slate swan
kindred epoch
slate swan
kindred epoch
slate swan
kindred epoch
untold haven
kindred epoch
untold haven
#

ok

slate swan
slate swan
# untold haven

In imports you can just do

from discord.ext import commands

dont need to import discord.ext

untold haven
#

thank you :)

slate swan
kindred epoch
untold haven
slate swan
kindred epoch
#

ye

slate swan
#

youtube isn't always going to be accurate

#

i'm using replit cause vscode messes up for me

#
role_list = []
        if "muted" in [role.name for role in ctx.guild.roles[:0:-1]]:
            for m_role in ctx.guild.roles[:0:-1]:
                if m_role.name == "muted":
                    role_list.append(m_role.name)
                    role_list.append(str(m_role.id))
                    break
        else:
            await ctx.guild.create_role(name="muted", permissions=Permissions(send_messages=False, read_messages=True))
            print("test2")
            for new_role in ctx.guild.roles[:0:-1]:
                if new_role == "muted":
                    role_list.append(new_role.name)
                    role_list.append(str(new_role.id))

            print("test3")
            print(str(role_list[1]))
            await ctx.channel.set_permissions(ctx.guild.get_role(str(role_list[1])), send_messages=False, read_messages=True)

        print("test4")
        print(role_list)

I've been stuck on this one for a while, the code that starts from test3 all the way down to the print(role_list) isn't working, how come?

slate swan
slate swan
slate swan
slate swan
slate swan
#

lemme show you

echo wasp
#

hi, i want to create some more commands for my bot but i don't know how to well

slate swan
slate swan
slate swan
echo wasp
slate swan
kindred epoch
slate swan
slate swan
echo wasp
kindred epoch
#

ah ok

slate swan
kindred epoch
#

lmfao, im tired of saying that so i just dont say it

slate swan
#

Dont know much havent done it before

slate swan
#

mhm?

slate swan
#

My grammar is so bad

kindred epoch
# slate swan mhm?

you're checking a role object with the name, not the roles name with the name

slate swan
kindred epoch
slate swan
kindred epoch
#

!e
something = ["hi","hi2","hi3"]
for x in something:
if x == "hi":
print("worked")
else:
print("didnt work")

#

huh

#

ok nvm then

echo wasp
slate swan
unkempt canyonBOT
#

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

001 | muted
002 | not_muted
kindred epoch
#

ok wait, im not wrong

slate swan
#

lmao, yes the second print got printed because of the second iteration

#

u are, on the second iteration the else statement becomes true, that's why it printed it

kindred epoch
#

if you look at this, its checking if the role name is "Owner", but the owner role is the third role in the role hierarchy

echo wasp
#

Can someone help me with creating commands I don't really understand how to make commands like purge or anything on those lines i just know how to send text back or give me a link to documentation

slate swan
#

it checks for the each role in the guild (it removes the everyone role).
and if any of the iterations meets the if condition, it appends the role name and role id to my list.

kindred epoch
slate swan
#

but the thing is, it never happens

#

ahh

#

oh

#

bruh

kindred epoch
#

lol

slate swan
#

i'm fkn dumb

#

ty

kindred epoch
#

np

steady flume
#

guys, i made code with cooldown, but bot doesnt change anything in db
here code:

@commands.command(
        name="daily",
        aliases=["Daily"]

    )
    async def user_daily(self, ctx):
        place_datetime = datetime.datetime.now()
        local_collection = collection['coins']
        data = local_collection.find_one({'id': ctx.author.id})

        if not data:
            data = {}
        data['datetime'] = data.get('datetime', place_datetime - datetime.timedelta(days=1, seconds=60))
        if (place_datetime - data['datetime']).days < 1:
            await ctx.send(
                f"You can only collect the reward once every 1 day! Come via `{int((place_datetime - data['datetime']).seconds / 3600)}` часов")
        else:
            local_collection.update_one({'id': ctx.author.id},
                                        {'$inc': {'balance': 50}, '$set': {'datetime': place_datetime}})
            await ctx.send(f"You took 50 coins! Come back in a day and pick up more!")
echo wasp
kindred epoch
unkempt canyonBOT
#

await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Purges a list of messages that meet the criteria given by the predicate `check`. If a `check` is not provided then all messages are deleted without discrimination.

You must have the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission to delete messages even if they are your own. The [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission is also needed to retrieve message history.

Examples

Deleting bot’s messages...
kindred epoch
#

!d discord.ext.commands.Bot.command

unkempt canyonBOT
#

@command(*args, **kwargs)```
A shortcut decorator that invokes [`command()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.command "discord.ext.commands.command") and adds it to the internal command list via [`add_command()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin.add_command "discord.ext.commands.GroupMixin.add_command").
echo wasp
slate swan
kindred epoch
kindred epoch
unkempt canyonBOT
#

await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Purges a list of messages that meet the criteria given by the predicate `check`. If a `check` is not provided then all messages are deleted without discrimination.

You must have the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission to delete messages even if they are your own. The [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission is also needed to retrieve message history.

Examples

Deleting bot’s messages...
kindred epoch
# unkempt canyon

if you click the title of this embed it will redirect u to the docs @echo wasp

echo wasp
kindred epoch
#

do you mean more command ideas?

echo wasp
slate swan
#
await ctx.guild.create_role(name="muted", permissions=Permissions(send_messages=False, read_messages=True))
            for new_role in ctx.guild.roles[:0:-1]:
                if new_role.name == "muted":
                    role_list.append(new_role.name)
                    role_list.append(str(new_role.id))

            print(str(role_list[1]))
            await ctx.channel.set_permissions(ctx.guild.get_role(str(role_list[1])), send_messages=False, read_messages=True)
            print("test")

        print(role_list)

the prinst("test") and print(role_list) isn't ran, but the print above the await ctx.channel.set_permissions is. What might the issue be? Because it isn't setting any permissions in the channel either

kindred epoch
# echo wasp yes

reminder, welcome message, leave message, poll, verification system, ticket system

kindred epoch
#

you need to use stuff to make it

echo wasp
kindred epoch
#

ok

kindred epoch
slate swan
#

yup

#
903745924457726002
``` is what its returning
kindred epoch
#

try adding target= in front of that

#

cuz it worked for it

echo wasp
# kindred epoch ok

umm for the command name do you just say purge for it or do you need to put a number?

kindred epoch
#

ok nvm

slate swan
#

d! embed

kindred epoch
#

that wont matter

slate swan
#

target parameter must be either Member or Role

#

ah?

#

got this error now

kindred epoch
kindred epoch
unkempt canyonBOT
#

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

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

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

New in version 2.0.

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

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

ye

#

!d discord.Guild.get_role

unkempt canyonBOT
slate swan
#

dumb docs not telling me 😦

kindred epoch
#

role_id (int) – The ID to search for.

#

hm told me its supposed to be an int

slate swan
#

it worked

#

nice 🙂

slate swan
kindred epoch
slate swan
#
@client.event
async def on_message(message):
    for 10 in message.mentions:
        if(10==client.user):
            embed = discord.Embed(description="command prefix: `,`\nfor help, use: `,help`\ninvite alone: `,invite`", color=color)
            await message.channel.send(embed=embed)
    else:
        await client.process_commands(message)```

how could i make this not send the embed if the message has anything but mention
echo wasp
hasty iron
#

for 10 in … is this even valid syntax?

slate swan
#

it works

kindred epoch
slate swan
#

¯_(ツ)_/¯

#

!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/master/api.html#discord.Role "discord.Role")s.

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

can u help me with this one sasuke

hasty iron
slate swan
#

*roles is this a role id, role name, or what is it?

kindred epoch
slate swan
kindred epoch
#

bruv

hasty iron
kindred epoch
#

i just check

if message.content in [f'<@!{client.user.id}>', f'<@{client.user.id}>']:
``` it works and it ignores the everyone ping
#

@slate swan

hasty iron
slate swan
hasty iron
#

the docs literally tell you that

slate swan
#

I didn't know if it wanted a role.id or something else, I didn't understand what it "told" me

hasty iron
#

what? it literally said it takes in a Role object

#

*roles (abc.Snowflake) – An argument list of abc.Snowflake representing a Role to give to the member. oh i wonder what it takes

echo wasp
# kindred epoch thats the docs for how to use `.purge`

yup so it should come out like so ```py
@bot.command(name='purge')
async def purge(ctx):
await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=False, bulk=True)
await ctx.channel.send('(numbers of messages) have been cleared')

kindred epoch
echo wasp
slate swan
hasty iron
#

man

manic timber
#

hi

hasty iron
#

you don’t have to

#

did you even read the whole sentence

kindred epoch
slate swan
# hasty iron man

I did read the doc, I didn't understand what it wanted me to enter as arguments, which mean there is something I need to learn right? Now I'll go read about that so for next time I wont have to ask, why are you complaining?

hasty iron
#

because the docs are clear enough

slate swan
#

some or not for me

#

remember i'm still new and not as experienced as you are

#

end of discussion? Thanks for the help

slate swan
#

Oh my god

#

When it clearly tells you what it needs

slate swan
# unkempt canyon

In what line does it clearly says what I need? *roles? I said I didn't understand what that meant, I said I'll have to learn about it then, why are you all complaining???? 😩

#

The command description only shows a part of what's actually in the docs, if you would've clicked the link you would've seen that it's telling you what that is

hasty iron
#

oh, you didn’t understand what list of Role meant?

slate swan
#

😂

slate swan
slate swan
#

It's basically a list of Role objects

hasty iron
#

"representing a Role", imaginary 3 words

slate swan
#

Jesus christ

#

<@&831776746206265384>

#

Ping just one of them not all 😟

blissful lagoon
#

no, pinging the role is what we want you to do

slate swan
#

yup everyone is against me today

#

i'm done

#

¯\_(ツ)_/¯

kindred epoch
#

no he means pinging the role is correct lmao

slate swan
#

Oh

urban ivy
blissful lagoon
#

!mute 488127753745596436 🔎

unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied mute to @urban ivy until <t:1635545305:f> (59 minutes and 58 seconds).

kindred epoch
#

lmao

slate swan
#

Usually i saw just one being pinged instead of the role because I thought it'd be annoying for the mods to get all pinged but alr thinkmon

kindred epoch
#

manz joined and got muted

slate swan
#

😂 😂

kindred epoch
#

really used an alt for saying that

vocal magnet
slate swan
#

Oh i see

#

Makes sense

vocal magnet
#

mods signed up for the pings 😄 We get far more pings from our bot that from users reporting things

slate swan
#

¯\_(ツ)_/¯

kindred epoch
#

oof

#

still chose to say "eat my ass"

manic wing
slate swan
kindred epoch
manic wing
#

no

#

not if its in dm's

kindred epoch
#

ye

#

i did do it once, and the guy got banned

slate swan
#

Just block him or disable dms from server members

manic wing
#

just block, its not that deep

kindred epoch
#

did

kindred epoch
slim whale
#

it was user.nickname or user.nick?

#

to print the nickname of the server

kindred epoch
#

what

#

servers have nicknames now?

slim whale
#

u know??? im from spain, dont know how to say it

kindred epoch
#

thats a whole user bruv

slim whale
#

what xd

#

i want like the user.something

kindred epoch
#

its nick

slim whale
#

tnxxx

kindred epoch
#

user.nick

slim whale
#

tnx

#

@kindred epoch

#

doing this, how i can make the id and the nickname in the same line and the join position etc in another line?

#

with inlines but idk how to use them correctly

dapper cobalt
#

Don't set inline to False.

#

Just don't set inline. It's True by default.

slim whale
dapper cobalt
#

Set nickname field's inline to True and joined field's inline to False.

dapper cobalt
#

Well, that's what you want?

slim whale
#

no, i want joined, join postion and registered in same line

#

and id nickname in another

#

and roles in another line

reef shell
#

then use only one field for those 3 lines

#

ez

slim whale
#

like the name=

#

if its with one field

reef shell
#

i mean a new field for only a single line looks bad

slim whale
#

yes but can i make like name="a", value="b", name="a"

#

no no?¿

reef shell
#

no

slim whale
#

but it can be more than one value?

reef shell
#

no

#

let me show you

slim whale
kindred epoch
#

they used 4 fields, and used \n in the value

slim whale
#

/n ?

reef shell
#

value = f"Joined: {ur_joined_var}\nJoin position:{join_pos_var}"

#

ez

kindred epoch
#

and >>> to get the black line before it

#

Hi

slim whale
#

ohhhh

reef shell
#

Hi

slim whale
#

so \n its to make like another line?

reef shell
#

yes

kindred epoch
slim whale
#

ohhh

reef shell
#

you didn't know that

kindred epoch
#

!e
print("\nHi")

unkempt canyonBOT
#

@kindred epoch :white_check_mark: Your eval job has completed with return code 0.

001 | 
002 | Hi
slim whale
#

nop

reef shell
#

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

reef shell
#

to help you out Kek

slim whale
#

XD

reef shell
#

you need to learn basic python

slim whale
#

and the name of the things

reef shell
#

that's bad

slim whale
#

learned this a couple years ago

#

but i dont remember many things

#

need to learn again :C

reef shell
#

o ic

#

it's not that hard

dapper cobalt
slim whale
#

😋

dapper cobalt
#

Also, ngl that looks super clean. And it seems that I'm definitely going to copy some of it.

slim whale
#

@reef shell @kindred epoch now it looks like this, thanks!

slate swan
#

Wow

#

Looks good

kindred epoch
#

nice

dapper cobalt
dapper cobalt
#

Make sure there's a space between the arrow and the text.

slate swan
#

>>> Hello
Hi
Will be:

Hello
Hi

west escarp
#

.

#

For those of you curious of the possible formatting options

#

In addition
\_ \_ will create a "blank space" that is not absorbed by discord formatting (except in certain rare embed cases)

#

Eg

#

_ _

kindred epoch
#

_

#

oh ye i knew about that

sick birch
#

_ _ also works

slate swan
#

How would I get a list of all the permission a user has

#

how do you make a welcome command

slate swan
slate swan
slate swan
# slate swan On member join i think idk
@bot.event
async def on_member_join(member):
    channel = bot.get_channel(903708574138658837) 
    embed = discord.Embed(title="Welcome, dear user.", color = 0x5865f2)
    embed.add_field(name=f"{user}, we welcome you with warm hands.", value="read the rules!", inline=True)
    embed.set_footer(text="Cursex")

    await channel.send(embed=embed)
``` i wrote random things
slate swan
slate swan
slate swan
slate swan
slate swan
#

Any error

slate swan
slate swan
lunar helm
#

how are commands on my bot working if i have message intents off

final iron
cloud dawn
lunar helm
#

but how are they even working without it

pliant gulch
#

Message intents aren't even rolled out yet

final iron
cloud dawn
#

Verified bots can do as much as normal bots.

outer violet
#

Is it possible to make a command that edits an already sent embed?

hollow hemlock
#

How do i edit an already existed webhook object using it's URL so i can rename it, change it's avatar, etc.

sacred cargo
#

i need help, the bad word wont get removed from the json list

@client.command(aliases=["rbw", "removebw"], description="Add a bad word to the bad word list.")
@commands.has_permissions(manage_messages=True)
async def removebadword(ctx, badword):
    with open("custom_word_list.json", 'r') as f:
        rbw = json.load(f)

    removebadwordlist = rbw[str(ctx.guild.id)]
    removebadwordlist.pop(badword)

    with open("custom_word_list.json", "w") as f:
        json.dump(rbw, f, indent=4)
slate swan
#

error?

slate swan
#

if you have intents

#

not sure where your pulling user from if on member join takes member

sacred cargo
slate swan
#

should be an error

#

unless it does it

slate swan
#

hey guys, is it possible to detect a bot kick/ban? im having some sort of db preferences for each servers, so im just trying to remove it whenever the bot isnt in the server anymore. helps much appreciated, thanks!

kindred epoch
slate swan
kindred epoch
#

That's not the thing its on_guild_remove

kindred epoch
#

Ye it is

slate swan
#

oh, then i have it implemented already

#

on_guild_remove

kindred epoch
#

Ye

patent surge
#

Can I Dm a user who is not in mutual server of the bot ?

outer violet
#

What’s the difference between SQLite and aiosqlite? Like which ones better

boreal ravine
outer violet
boreal ravine
#

for dpy?

outer violet
#

Yeah

boreal ravine
#

yes then

latent dragon
#

how do u make a verify cmd?

boreal ravine
#

Depends on how you want it to be

#

¯_(ツ)_/¯

latent dragon
#

i want them to do !verify

#

and it gives them a role

#

and the bot responds with @amber beacon has been verify

boreal ravine
#

!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/master/api.html#discord.Role "discord.Role")s.

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

well you can add the roles when the user did the command

latent dragon
#

ok

worthy wagon
#

Anyway to make this work and snipe images?

boreal ravine
#

!d discord.Message.attachments

unkempt canyonBOT
worthy wagon
#

yes dude

#

I've been through that 300,000 times

#

I'm not quite understanding it, and I've been at it for nearly 2 hours, ready to smash my keyboard lmao

boreal ravine
#

you managed to snipe a message

#

but not an attachment

worthy wagon
#

correct

boreal ravine
#

show me what you did for that

#

whats snipe_message_content supposed to be

slate swan
#

wont this always make the list None?

boreal ravine
#

yes

#

he didn't append anything to it

worthy wagon
boreal ravine
#

What basic snipe command

worthy wagon
#

Not basic, original, poor choice of wording on my part.

boreal ravine
#

well

#

your snipe command right now is gonna snipe the message content of the command

worthy wagon
#

my snipe command works fine.

#

But the images one isn't currently working

boreal ravine
#

like I said

#

!d discord.Message.attachments

unkempt canyonBOT
boreal ravine
#

It's an attr of message

slate swan
#

👀 you would be saving the image

boreal ravine
#

yes

hollow palm
#
msg = await ctx.channel.send(f"`Now playing: {var3}` \n{url}")
await msg.add_reaction(u"\u23F8")
await msg.add_reaction(u"\uE23A")

try:
     reaction, user = await client.wait_for("reaction_add", check=lambda reaction, user: user == ctx.author and reaction.emoji in [u"\u23F8", u"\uE23A"], timeout=90.0)
        
except asyncio.TimeoutError:
     return await msg.clear_reactions()
        
else:
     if reaction.emoji == u"\u23F8":     
          await ctx.voice_client.pause()
     elif reaction.emoji == u"\uE23A":
          await ctx.voice_client.resume()

When trying to run this I get many problems, first, only the first emoji is added to msg, second when a user adds a reaction nothing happens. Any help is appreciated.

maiden fable
#

Are there any error(s)?

hollow palm
#

no

maiden fable
#

do u have an error handler?

#

!charinfo uE23A

unkempt canyonBOT
maiden fable
#

Hmm. Can I see the second emoji?

#

Also, can u try using the unicode version?

#

Like \👍

hollow palm
#

This website lists it as u"\uE23A"

maiden fable
#

:play:

#

Breh wait

#

\⏯️ U can use this

#

I think discord doesn't support the other play button emoji

hollow palm
#

maiden fable
#

\▶️

#

Copy paste this then

hollow palm
#

Ok that part works but that still doesnt explain why I'm not getting a response to a reaction from the user

maiden fable
#

Same thing

#

Don't use unicodes

#

reaction.emoji == "▶️"

hollow palm
#

How do I get one for pause

maiden fable
#

Just do \:emoji_name:

hollow palm
final iron
#

leaked

maiden fable
#

Yups

final iron
#

change it

hollow palm
#

Yeah i will

final iron
#

Do it now

maiden fable
#

Also, it is discord.Client not discord.client in the main file

hollow palm
#

This error didnt come up previously

#

i dont think its a problem with charachters thats causing no response to a reaction

urban star
#

What is

#

Shard?

#

Anyone?

boreal ravine
# urban star Anyone?

Well if your referring to shard as in sharding its a way to make your bot multi threaded (iirc)

primal fox
#

you use a task from the library or just a loop that calls asyncio.sleep()

maiden fable
#

U gotta check for response of the API and try seeing the status code....?

#

I mean, it totally depends on the API how it acts whenever it goes down tbh

latent dragon
slate swan
#

hoow to make a prefix change command

#

@deep sorrel hoow to make a prefix change command

#

@deep sorrel hoow to make a prefix change command

boreal ravine
unkempt canyonBOT
#

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

Sends a message to the destination with the content given.

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

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

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

my webhook keeps adding the embed of the previous update(PS webhook is connected to my own application)
code

from discord_webhook import DiscordWebhook, DiscordEmbed
import os
web_url = os.environ['durl']
webhook = DiscordWebhook(url=web_url)

# create embed object for webhook
# you can set the color as a decimal (color=242424) or hex (color='03b2f8') number
def send(app, action):
  embed = DiscordEmbed(title=app, description=action, color='03b2f8')
  webhook.add_embed(embed)
  webhook.execute()
slate swan
#

@boreal ravine hoow to make a prefix change command

#

@boreal ravine hoow to make a prefix change command

#

how can i get a bot to list flags and device+status like this?

tardy lagoon
#

is dispy ded?

slate swan
#

no

tardy lagoon
#

nextcord is the new thing now?

#

?

#

help

bronze remnant
#

hi

tardy lagoon
slate swan
maiden fable
unkempt canyonBOT
#

property public_flags```
Equivalent to [`User.public_flags`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.public_flags "discord.User.public_flags")
maiden fable
#

!d discord.Member.status

unkempt canyonBOT
#

property status: discord.enums.Status```
The member’s overall status. If the value is unknown, then it will be a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") instead.
slate swan
#

ty

blazing beacon
#

@maiden fable nvm

blazing beacon
#

i realized its against rules 😭

blazing beacon
boreal ravine
#

👍

distant tinsel
#

hi

neon oyster
#

What happens if i do this and it doesnt find anything in the checks? py UPDATE levels SET experience = ?,level = ? WHERE guild = 1 AND user = 2 (10, 1)

tardy lagoon
#

so
dispy is really discontinued?

neon oyster
slate swan
tardy lagoon
#

ok

#

I'll just use nextcord
it's same structure easy to migrate

slate swan
#

Mhm

#

Just change discord.Embed to nextcord.Embed

tardy lagoon
#

ye

slate swan
#

And other stuff like that

#

hey guys

#

how do we make time in discord

#

like 4 years ago

bright palm
#

<t:1501251200:R>

slate swan
#

help me please @tardy lagoon

slate swan
bright palm
#

<t:1501251200:R>

slate swan
#

<t:1501251200:R>

#

and how to do custom time

#

??

bright palm
slate swan
#

<t:11111111111111111:R>

#

t:1618953630:d

#

<t:1618953630:d>

#

<t:1953630:d>

#

omg

#

4 years ago

#

lol

#

how to caluclate numbers!

tawdry perch
latent dragon
tardy lagoon
#

yo

latent dragon
tardy lagoon
#

how to do menus fiscord

latent dragon
#

i need help

boreal ravine
latent dragon
boreal ravine
#

that isnt full

latent dragon
boreal ravine
#

hm

#

u tried to index some out of range

#

ur gawtime maybe

latent dragon
#

hmm

boreal ravine
tardy lagoon
#

ye

#

discord menus

latent dragon
#

so what do i fix?

boreal ravine
slate swan
#

The correct question is why are you using that theme, makes my eyes water

covert igloo
#

^^^^

boreal ravine
#

gaw?

slate swan
#

¯\_(ツ)_/¯

covert igloo
#

Godawful

latent dragon
#

ur opinion, idm

boreal ravine
slate swan
#

You can index a string like you do with a list

latent dragon
#

i was just typing that

boreal ravine
#

ah

boreal ravine
latent dragon
#

yes

slate swan
#

!e ```py
string = "1m"
print(string[-1])

unkempt canyonBOT
#

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

m
boreal ravine
#

xD

#

welp Idk how to solve that problem

slate swan
#

Try printing users

#

See what that prints

#

Because I'm pretty sure you have more than 1 awaitable in there

#

@latent dragon

latent dragon
#

ok

slate swan
#

Ok nvm

#

I just tested it out and it works fine for me

#

Must be a random (the module) issue

latent dragon
#

so u want me to print users?

#

still

slate swan
#

No

slate swan
# latent dragon

Anyways, you could try a workaround by using randing and getting a random number from 0 to the len(users) - 1, and then index at that random number

latent dragon
#

ok

#

i forgot to import random too

#

there

#

let me see if it works now

slate swan
#

Oh 😂

latent dragon
#

lmao it still has the same error

slate swan
#

That's weird

slate swan
#

If you still get it then just print the users and len(users)

#

Do you have some global variable named users in your file

latent dragon
#

winner = random.choice len(users)

#

?

slate swan
#

No

slate swan
#

winner = users[random.randint(0, len(users) - 1)]

latent dragon
#

alr imma try it

#

same error

slate swan
#

Print the users

latent dragon
#

how? i know little in py i specialize in js

slate swan
#

print(users)

#

Printing is the first thing you learn

latent dragon
#

len print(users)?

slate swan
#

No

#

Just print(users)

latent dragon
#

ok

slate swan
#

Why are you making a discord bot if you don't know the basics wtf

boreal ravine
slate swan
#

Knowing how to print is the first thing you learn in any language

slate swan
boreal ravine
#

discord.js has more features xD

slate swan
#

It does?

latent dragon
#

@slate swan winner = users[random.randint(0, print(users) - 1)]?

slate swan
slate swan
#

Just print(users), nothing more

boreal ravine
#

you cant print something like that

slate swan
#

Here I'll give you an example in js, maybe it'll make it more clear

console.log(users);

Is exactly the same as

print(users)
latent dragon
#

ohhhhhhh

#

lmao

slate swan
#

🤦‍♂️

boreal ravine
#

!e

class con:
  def log(self, value):
    print(value)
console = con()
console.log("users xD")
unkempt canyonBOT
#

@boreal ravine :white_check_mark: Your eval job has completed with return code 0.

users xD
latent dragon
#

so lmk if this is right

slate swan
#

Pyscript 😎

latent dragon
#

winner = print(users)

slate swan
#

Javathon 😎

latent dragon
#

?

slate swan
#

Stop assigning it to a variable

latent dragon
#

alr

slate swan
#

You don't assign console.log to a variable in Javascript do you

boreal ravine
latent dragon
#

no

slate swan
#

Then why are you doing it now

boreal ravine
#

imagine someone made a javascript IDE inside of python

latent dragon
#

who tf would do that

boreal ravine
#

you

slate swan
latent dragon
boreal ravine
#

just print user

#

did u print it?

latent dragon
#

ok but i have this

#

await ctx.send(f"Congratulations! {winner.mention} has won the giveaway for **{prize}**")

slate swan
#

Comment it out

#

Select it and press ctrl + /

boreal ravine
#

thats javascript

slate swan
#

If you're using vsc

boreal ravine
#

oh

slate swan
#

I use it whenever I have to comment a lot of lines out

boreal ravine
#

oh

#

why not just shift + "

slate swan
#

So instead of commenting each one individually I just select them and use ctrl+/ and it auto comments all of them

latent dragon
#

its not a error im saying the {winner.mention} is assigned to the winner = random.choice(users)

slate swan
boreal ravine
#

but """"still works"""

slate swan
slate swan
#

¯\_(ツ)_/¯

latent dragon
#

its not in my terminal

slate swan
#

How is it not

#

Show the code

latent dragon
#
@client.command()
@commands.has_permissions(administrator=True)
async def giveaway(ctx, time=None, *, prize=None):
    if time == None:
        return await ctx.send('Please include a timer!')
    elif prize == None:
        return await ctx.send('Please include a prize!')
    embed = discord.Embed(title='New Giveaway!', description=f'{ctx.author.mention} is giving away **{prize}**')
    time_convert = {"s":1, "m":60, "h":3600, "d":86400} 
    gawtime = int(time[0]) * time_convert[time[-1]]
    embed.set_footer(text=f'Giveaway ends is {time}')
    gaw_msg = await ctx.send(embed = embed)

    await gaw_msg.add_reaction("🎉")      
    await asyncio.sleep(gawtime)

    new_gaw_msg = await ctx.channel.fetch_message(gaw_msg.id)

    users = await new_gaw_msg.reactions[0].users().flatten()
    users.pop(users.index(client.user))

   print(users)

    await ctx.send(f"Congratulations! {winner.mention} has won the giveaway for **{prize}**")```
slate swan
#

Properly use codeblocks reading this is awful

#

Also how did you not get an indentation error, because unless discord fucked up your indentation, your print is two spaces behind the actual indent

slate swan
#

Are you invoking the command then

latent dragon
#

i got a new error

boreal ravine
#

define winner

slate swan
#

Yes because I told you to comment it out

latent dragon
#

shift + /

#

right?

slate swan
#

Anyways it seems like the users print just fine as a list, which is weird because for some reason you get the index error when using random

slate swan
#

Or just add a # at the start of it

latent dragon
#

k

#

it printed []

boreal ravine
#

append smth to the list

#

obv it has no values

slate swan
#

Alr found your error, managed to reproduce it

latent dragon
#

alr

boreal ravine
#

reproduce 😳

slate swan
#

You get that error because the list is empty, so when using random.choice and it tries to index, it raises the IndexError

#

So after you pop the bot user from the users list, check if the len(users) is 0, if it is that means the list is empty and just return because there's no winner, no one reacted

slate swan
latent dragon
#

its 0

slate swan
#

Ik

#

So by using an if statement, after checking that it's 0, add a return, since no one reacted (you could also send a message announcing that there's no winner and then add the return)

latent dragon
#

so like a if len(users) = 0 return await ctx.send('there is no winner')?

slate swan
#

It's ==, also don't forget your indent, not all in one line

#

Also a : after the 0

latent dragon
#

ok

#

do i go back to winners = random.choice(users)

#

or winner = users[random.randint(0, (users) - 1)]

slate swan
#

First

latent dragon
#

the first one?

slate swan
#

Yes

latent dragon
#

k

#

winners = random.choice(users)
if (users) == 0:
return await ctx.send('There is no winner')

#

?

slate swan
#

No

#

You're gonna get the same error again

#

Put winners = ... below

#

Also it's len(users)

latent dragon
#
    if (users) == 0:
        return await ctx.send('There is no winner')
        winners = random.choice len(users)```?
slate swan
#

@boreal ravine you take it from here I'm done, going back to sleep 🚶‍♂️

#

Because it seems that I'm not making myself clear of what he's supposed to do 🤦‍♂️

latent dragon
#

im confused can u just type it?

#

so i can paste it?

slate swan
#

"so i can paste it?" no, would be better if you'd learn some python, your knowledge of it is clearly 0

latent dragon
#

i need to see what ur telling me so i can see it

slate swan
#

You also needed to see how to print something?? Really? 😂

boreal ravine
slate swan
#

Atp this is just basic python 😂

slate swan
latent dragon
#

i started py two days ago chill tf out

#

i already told u i do js

slate swan
#

And ur into a discord bot with that amount of basically no knowledge 🤡

latent dragon
#

this is the whole reason im in this server

slate swan
latent dragon
#

to learn more py

slate swan
slate swan
slate swan
latent dragon
slate swan
#

hes using basic terminology you should be able to follow

#

If you would've done any kind of coding before this would've been a lot easier than it was

#

Its true what their saying

#

Tbh

latent dragon
#

i learn by seeing stuff with my eyes thats all im asking

slate swan
latent dragon
#

u typing it out so i can see it would help me learn

slate swan
#

You wanna learn more python? Sure, but don't go into projects that require you to already know a good amount of python, also, even when I told you how to print and even gave you an equivalent to what print() looks like in js, you still did it completely wrong, showing that you don't know js either

latent dragon
#

ik js lmao

slate swan
#

You mean you know what ctrl+c and ctrl+v does? Good for you 😂

boreal ravine
#

👀

latent dragon
#

i just still dont understand print() cause it prints in terminal

latent dragon
slate swan
#

And where does console.log output it? Somewhere else??

#

deadass lol

#

You said you've made discord bots in js, if you run your bot and have a console.log, where does it output the value?? Not in the console like print does? 😂

latent dragon
#

ik that

slate swan
boreal ravine
#

I learnt js a month ago and I know how to print things 😎

slate swan
slate swan
#

Actually probably 2 weeks ago

latent dragon
#

pritn in js is console.log

slate swan
#

Yes

latent dragon
#

print*

slate swan
latent dragon
#

like when u do node main.js

slate swan
#

whats your point

slate swan
latent dragon
#

it runs off of client.once('ready', () => {
console.log('Akairo is online!');

slate swan
boreal ravine
slate swan
steep estuary
#

how to disable create threads permissions

slate swan
#

You clearly don't know anything of js either

latent dragon
slate swan
maiden fable
boreal ravine
slate swan
latent dragon
latent dragon
boreal ravine
slate swan
#

@latent dragon just say your a rookie theres nothing bad being a rookie 🤷‍♂️

steep estuary
boreal ravine
unkempt canyonBOT
#

await edit(*, name=..., permissions=..., colour=..., color=..., hoist=..., 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/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this.

All fields are optional.

Changed in version 1.4: Can now pass `int` to `colour` keyword-only parameter.

Changed in version 2.0: Edits are no longer in-place, the newly edited role is returned instead.
boreal ravine
#

^

latent dragon
#

i have over 30 working bots in js

steep estuary
#

what is for threads ?

#

i didn't got it in docs

slate swan
boreal ravine
latent dragon
#

thats why i wanted to learn some py

steep estuary
#

create_threads=False

boreal ravine
#

ig

steep estuary
#

?

slate swan
boreal ravine
#

lol

tough wagon
#

!d discord.Permissions

unkempt canyonBOT
#

class discord.Permissions(permissions=0, **kwargs)```
Wraps up the Discord permission value.

The properties provided are two way. You can set and retrieve individual bits using the properties as if they were regular bools. This allows you to edit permissions.

Changed in version 1.3: You can now use keyword arguments to initialize [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions") similar to [`update()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.update "discord.Permissions.update").
slate swan
#

Unless you copy-pasted all their code, I doubt they'd be able to do anything else 😂😂

latent dragon
#

yeah totally

slate swan
#

Just like you did right now with the giveaway command 🤡

tough wagon
#

@steep estuary

latent dragon
#

i bet u cant even do embed in js lmao

boreal ravine
#

do embed?

slate swan
#

Because I don't even need to

#

Also, embed isn't js related, it's djs related lmao

latent dragon
#

obv

steep estuary
slate swan
latent dragon
#

im saying u dont know how to code a embed in djs

tough wagon
boreal ravine
steep estuary
slate swan
tough wagon
#

pls stop?

boreal ravine
#

camelCasing funny

boreal ravine
slate swan
#

Me rn: 😮 🍿

tough wagon
boreal ravine
#

U attached an image

#

what was it for

tough wagon
#

yes

slate swan
tough wagon
slate swan
#

Because I'll agree, all this fight is very Off-topic

boreal ravine
slate swan
#

Do you need member intents for on_member_join ?

tough wagon
#

yes

slate swan
#

No right

#

Oh

slate swan
#

Is it possible or a way to make the bot read the messages in a log channel and see if something specific has been sent in the channel?

slate swan
slate swan
tough wagon
#

@slate swan

slate swan
#

Thx

slate swan
# boreal ravine `on_message` ig

on_message will trigger when someone types, I have a mute command, my bot sends information to the logs channel, and I want to make a new command that checks the users history and then the bot needs to go through everymessage the bot sent in the logs and get that information

#

Use channel.history

boreal ravine
#

ah

slate swan
#

okay ty

tough wagon
#

or save in database

boreal ravine
#

!d discord.TextChannel.history

unkempt canyonBOT
#

async for ... in history(*, limit=100, before=None, after=None, around=None, oldest_first=None)```
Returns an [`AsyncIterator`](https://discordpy.readthedocs.io/en/master/api.html#discord.AsyncIterator "discord.AsyncIterator") that enables receiving the destination’s message history.

You must have [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permissions to use this.

Examples

Usage...
slate swan
#

It's gonna be very slow at some point tho, discord limitation, so better save it in a database instead