#discord-bots

1 messages · Page 54 of 1

silk fulcrum
#

the stolen egg

cerulean shale
#

hehe

silk fulcrum
#

hi

cerulean shale
#

anyways, if you dont mind, would you once again tell me what to do to fix my issue? 🥺

silk fulcrum
#

im first to respong

cerulean shale
#

you are too fast master

torn sail
#

Yeah from a quick look at it I prefer aiohttp

cerulean shale
#

ight thx master69, i mean master 32

pulsar solstice
#

Master... Master how should I make that it added 5 cookies on every message?

silk fulcrum
pulsar solstice
cerulean shale
#

🍪

#

😋

silk fulcrum
cerulean shale
#

lmao

silk fulcrum
#

i like to answer with question mark

#

I can stop if that becomes confusing

pulsar solstice
cerulean shale
silk fulcrum
#

iirc syntax is cookies + 1

cerulean shale
#

master32 has a cult btw

#

you on drugs?

#

why you sending and deleting?

silk fulcrum
#

example: py await cursor.execute("UPDATE your_table SET (cookies) VALUES (cookies + 1)")

pulsar solstice
silk fulcrum
#

oops that's +1

cerulean shale
silk fulcrum
#

you need + 5

cerulean shale
#

weird

primal token
#

what is this

silk fulcrum
#

are you sure you're allowed to talk like that?

torn sail
cerulean shale
#

idk 😭

#

sorry ig

slate swan
pulsar solstice
silk fulcrum
pulsar solstice
torn sail
cerulean shale
#

kids addicted to devices at that age

slate swan
pulsar solstice
slate swan
#

lmao

cerulean shale
#

like seriously tho, ima shut up and go back to work

silk fulcrum
#

what the heck is confusing

slate swan
pulsar solstice
#

he updated that

silk fulcrum
#

he did right

#

i am dumb

#

he is genius

pulsar solstice
primal token
pulsar solstice
silk fulcrum
slate swan
#

hokker 💀

pulsar solstice
cerulean shale
slate swan
#

nice name

torn sail
#

There was an error in getting webhook

primal token
slate swan
#

guys I got massive error on the bot idk why its not working can anyone please help me to fix the bot?

cerulean shale
pulsar solstice
#

ye ye i call it rows

cerulean shale
#

i kill people there

silk fulcrum
torn sail
#

I would remove the try except to see what that error is

primal token
cerulean shale
#

🤦

slate swan
#

if anyone can help I would be very happy that the bot will finally be finished

torn sail
#

And consider not using a bare except

#

You can add it back later

slate swan
#

so can anyone please help?

#

error is like html error but I coded the thing on python

silk fulcrum
cerulean shale
primal token
slate swan
cerulean shale
sick birch
#

You’re probably being ratelimited

slate swan
torn sail
primal token
sick birch
#

Solution: don’t use replit

cerulean shale
#

replit moments

slate swan
#

cuz I'm coding the bot with my friend

cerulean shale
#

change to vsc like me

slate swan
silk fulcrum
cerulean shale
#

these people will help you

slate swan
#

Hello! I was trying to make a delete command for my discord. I want the user to type: !delete (amount) but how do i make that?
This is what i tried:

            await message.delete()```
sick birch
unkempt canyonBOT
#

Hey @slate swan!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

sick birch
slate swan
#

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

cerulean shale
silk fulcrum
slate swan
sick birch
#

@slate swan we know what the error is, you don’t have to send it

slate swan
primal token
slate swan
torn sail
#

discord.utils.utcnow and discord.utils.format_dt

sick birch
# slate swan ??

HTML errors with discordpy can only mean one thing: you’re using replit

sick birch
#

The solution is to ditch replit because it’s hot garbage

slate swan
#

Hello! I was trying to make a delete command for my discord. I want the user to type: !delete (amount) but how do i make that?
This is what i tried:

            await message.delete()```
sick birch
slate swan
#

I'll post the code in vs code

#

and see if there is any errors

sick birch
cerulean shale
# slate swan ??

ayo as an ex replit user, i can 100% tell you, its just how replit it, it aint good anymore try to shift over to vsc, and that error is annoying af thats why i have shifted

primal token
#

because an endpoint returns a body of HTML doesnt mean youre using replit, its just cloudfare returns that HTML content💀

sick birch
torn sail
slate swan
#

if you wanna code on a browser get github students plan and use github codespaces

slate swan
torn sail
#

!d discord.TextChannel.purge

unkempt canyonBOT
#

await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=None, bulk=True, reason=None)```
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/latest/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/latest/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission is also needed to retrieve message history.

Changed in version 2.0: The `reason` keyword-only parameter was added.

Examples

Deleting bot’s messages...
sick birch
cerulean shale
slate swan
#

you need to call utcnow

cerulean shale
#

they will help you as i am still in training

worn onyx
#

how to make buttons in bot?

slate swan
unkempt canyonBOT
#

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

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

New in version 2.0.
sick birch
cerulean shale
torn sail
#

You can get rhe current time with discord.utils.utcnow() then pass it into discord.utils.format_dt then u got the time stamp

slate swan
cerulean shale
#

ayo people help the guy ;-;

sick birch
cerulean shale
pulsar solstice
#

from sqlite3 import Cursor
import discord
from discord.ext import commands
import aiosqlite
import random

bot = commands.Bot(command_prefix='>', intents=discord.Intents.all())


async def open_account(member: discord.Member):
    db = await aiosqlite.connect("jar.db")
    cursor = db.cursor()
    cursor = await db.execute(f'SELECT * FROM jar WHERE member_id = {member.id}')
    result = await cursor.fetchone()
    
    if result:
        return
    if not result:
        await cursor.execute(f"INSERT INTO jar(member_id, cookies) VALUES(?, ?)", (member.id, 0))  

    await db.commit()
    await cursor.close()
    await db.close()


@bot.event
async def on_message(message):
    db = await aiosqlite.connect("jar.db")
    cursor = db.cursor()
    await cursor.execute(f"""UPDATE table
    SET cookies = cookies + 1
    WHERE user_id = {message.author.id}""")



bot.run("<token>")

slate swan
pulsar solstice
#

I did this

sick birch
#

I think “how to use VSC” might be too broad in scope to be answered in such a way that it’s of any help

pulsar solstice
#

and error

slate swan
pulsar solstice
#
2022-08-24 10:03:53 INFO     discord.client logging in using static token
2022-08-24 10:03:58 INFO     discord.gateway Shard ID None has sent the IDENTIFY payload.
2022-08-24 10:03:58 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: 9efecfbe9d7b3d0af94dfbbbbe6723a6).
2022-08-24 10:04:30 ERROR    discord.client Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\8ster\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 466, in _run_event
    await coro(*args, **kwargs)
  File "c:\Users\8ster\OneDrive\Desktop\projects\Discord Bots\Novicookies\main.py", line 31, in on_message
    await cursor.execute(f"""UPDATE table
AttributeError: 'Result' object has no attribute 'execute'
C:\Users\8ster\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py:471: RuntimeWarning: coroutine 'Connection.cursor' was 
never awaited
  await self.on_error(event_name, *args, **kwargs)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback```
worn onyx
cerulean shale
slate swan
#

don't see an issue there? if you mean the split screen, close one of the tabs

#

yeah.. I'm downloading pycharm again..

sick birch
worn onyx
cerulean shale
#

idk whats wrong in helping a guy trying to make a discord bot tho 🤷‍♂️

pulsar solstice
#

why???

cerulean shale
#

WHY?

#

anyways, bye people

pulsar solstice
#

WHY?

sick birch
#

Why downgrade

silk fulcrum
#

im interested how long will it be when i put it on my host

cerulean shale
#

bye master

pulsar solstice
silk fulcrum
silk fulcrum
worn onyx
pulsar solstice
torn sail
worn onyx
silk fulcrum
silk fulcrum
pulsar solstice
#

to host

silk fulcrum
#

NEVER

torn sail
silk fulcrum
#

NEVER EVER EVER EVER IN MY LIFE

#

i'd rather delete my whole code than use repl.it

pulsar solstice
torn sail
pulsar solstice
silk fulcrum
# torn sail Yeah tell us the host

i dont know myself, it's my dad's host, it gives me smth like a VM with Ubuntu terminal and I can do whatever I want, I can host anything there

torn sail
#

Here

pulsar solstice
torn sail
#

Idk

silk fulcrum
#

unless when I'll run out of memory

slate swan
#

heroku is good if its an interaction based bot, which is not possible if you're using discord.py :p

pulsar solstice
pulsar solstice
torn sail
#

Wait no forgot about gateway

#

Nvm what I said

sick birch
#

@slate swan were you part of CJ?

slate swan
#

yeah Gateway is the issue, heroku is meant for websites and webservers etc

slate swan
sick birch
#

Ah alright. Could swear you were 😆 I’m just losing my marbles

slate swan
# silk fulcrum restcord 💀

besides that theres a library called discord-interactions or something which worked with flask, it was nice too
hikari and some other libs have rest only support as well

slate swan
#

ehm guys how to open new tab?

silk fulcrum
#

ctrl + t

#

i didnt even think

slate swan
#

doesn't work

silk fulcrum
#

sad

#

i thought im able to not think

slate swan
#

nvm I think I got it

winged coral
#

what kinda theme is that ☹️☹️

slate swan
#

how to fix this

silk fulcrum
slate swan
silk fulcrum
#

show quick fixes of that problem

slate swan
#

oh I see my problem

slate swan
#

ik I fixed it

#

but now it shows this

#

and idk how to fix

#

whenever I use ban cmd it shows this

#

and cmd doesn't work

#

It’s “url” not link

silk fulcrum
#

did u try alt + enter again?

slate swan
silk fulcrum
#

well it probably wouldn't have told you that there is url kwarg

slate swan
#

how do I fix the thing

silk fulcrum
#

change link to url

slate swan
#

how do I fix??

slate swan
vale wing
slate swan
#

It looks so fucking ugly

silk fulcrum
slate swan
#

ugh now unban error

slate swan
slate swan
#

Or we can’t help you

#

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

paper sluice
slate swan
vale wing
#

Oh hell

slate swan
#

there I didn't paste the ticket

slate swan
#

We didn’t need your full code

vale wing
#

I have standard theme with some modified highlight colors

slate swan
#

Just full traceback and a little snippet of the code that’s causing the error

#

anyways that's the full code

#

how to fix it now?

#

Give the error???

#
Traceback (most recent call last):
  File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\core.py", line 190, in wrapped
    ret = await coro(*args, **kwargs)
  File "C:\Users\hp\PycharmProjects\Dragon_Bot\main.py", line 176, in unban
TypeError: object async_generator can't be used in 'await' expression

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

Traceback (most recent call last):
  File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\bot.py", line 1347, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\core.py", line 986, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\core.py", line 199, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: object async_generator can't be used in 'await' expression```
#

@slate swan

#

async generator can’t be used in await

vale wing
#

You need to async for x in ...

#

And await thing().flatten() might work as well

zealous jay
#

^

slate swan
#

so how do I fix??

#

ctx.guild.bans is a async generator

vale wing
#

You take it and fix

slate swan
#

Don’t await it

zealous jay
#

delete the await

slate swan
slate swan
#

now lemme test

#

!d discord.Guild.bans

unkempt canyonBOT
#

async for ... in bans(*, limit=1000, before=..., after=...)```
Retrieves an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator "(in Python v3.10)") of the users that are banned from the guild as a [`BanEntry`](https://discordpy.readthedocs.io/en/latest/api.html#discord.BanEntry "discord.BanEntry").

You must have the [`ban_members`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.ban_members "discord.Permissions.ban_members") permission to get this information.

Changed in version 2.0: Due to a breaking change in Discord’s API, this now returns a paginated iterator instead of a list.

Examples

Usage...
vale wing
#

Now python lost async support since he deleted await 💀

slate swan
#

still an error

#
[2022-08-24 21:51:42] [INFO    ] discord.client: logging in using static token
[2022-08-24 21:51:46] [INFO    ] discord.gateway: Shard ID None has connected to Gateway (Session ID: 45c9806c50a867f9c09d0cdbcf27ff9b).
Dragon Bot is ready to fly in Discord Life
[2022-08-24 21:51:56] [ERROR   ] discord.ext.commands.bot: Ignoring exception in command unban
Traceback (most recent call last):
  File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\core.py", line 190, in wrapped
    ret = await coro(*args, **kwargs)
  File "C:\Users\hp\PycharmProjects\Dragon_Bot\main.py", line 177, in unban
    for ban in bannedUsers:
TypeError: 'async_generator' object is not iterable

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

Traceback (most recent call last):
  File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\bot.py", line 1347, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\core.py", line 986, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "C:\Users\hp\PycharmProjects\Dragon_Bot\venv\lib\site-packages\discord\ext\commands\core.py", line 199, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'async_generator' object is not iterable
slate swan
#

so how do I fix

zealous jay
#

...

slate swan
vale wing
#

That is the method I use

slate swan
#

async for item in async_iterable

#

usually I used to write code and my friend fix all the errors but now am kinda alone

vale wing
#

I am my friend

#

Be your friend

#

And fix the errors

slate swan
#

Learn python?!?

slate swan
slate swan
slate swan
#

..

zealous jay
slate swan
#

so how to fix it which line I change

#

It needs to be async for not just for

#

async for ban in bannedUsers

#

right? @slate swan

vale wing
#

You are getting closer

slate swan
slate swan
#

plz lets do fast I have few minutes left

zealous jay
#

btw you could just async for bans in ctx.guild.bans():

slate swan
zealous jay
#

but its the same

paper sluice
#

bannedUsers 💀

slate swan
#

OK WORKED

#

Great job

#

Who’s that

#

!pep 8

unkempt canyonBOT
#
**PEP 8 - Style Guide for Python Code**
Status

Active

Created

05-Jul-2001

Type

Process

slate swan
#

Are they okay??

paper sluice
#

lol

zealous jay
#

no

slate swan
#

Why not

vale wing
zealous jay
#

It had to be done

paper sluice
vale wing
#

Yeah I will

slate swan
#

damn unwarn doesn't work

#

idk why

#

no errors it just doesn't work

slate swan
vale wing
#

Unwarn wtf

slate swan
#

like 2?warn, 2?warnings and 2?unwarn

#

Consider learning how to debug code

#

Learning python is also helpful

#

Relying on your friend tk fix code isn’t good practice

#

And this channel is really last resort

#
@commands.has_role("🍀Helper | Trial Mod")
async def unwarn(ctx, member: discord.Member):
    guild_name = await bot.fetch_guild(986712675562188871)

    try:

        file_name = 'reports.json'

        with open(file_name, 'r', encoding='utf-8') as f:
            my_list = json.load(f)

            print(my_list)

        user_short = member.name

        for idx, obj in enumerate(my_list):
            if obj["name"] == user_short:
                my_list.pop(idx)

        new_file_name = 'reportdumps.json'

        with open(new_file_name, 'w', encoding='utf-8') as f:
            f.write(json.dumps(my_list, indent=user_short))

    except Exception as e:
        print(e)
        await ctx.send(f"```There was a problem with resetting {user_short}'s warns in {guild_name}```")
        return

    try:
        unwarnEmbed = discord.Embed(
            title=f"⛔ {user_short}'s warns in {guild_name} have been reset",
            color=0xf1c40f
        )

        await ctx.send(embed=unwarnEmbed)

    except Exception as e:
        print(e)
zealous jay
#

bruh

slate swan
#

how do I fix this..

#

I feel dumb today amma be honest lmao

#

get some sleep then

#

nah

#

I gotta finish this, tommorow is school

#

so please guyss

#
string indices must be integers
{'users': [{'name': 'Pengu', 'reasons': ['a']}]}
string indices must be integers
#

it only shows this

#

@slate swan

vale wing
#

F to people who have school in summer

tawdry tendon
#

hello

#

my on_message is interfering with my commands

#
@client.event
async def on_message(message):
  if message.author == client.user:
    return
  if message.content.lower() == "hello":
    await message.channel.send("Hello:wave:")
  

class MyView(discord.ui.View):
  @discord.ui.select(
    placeholder = "What do you need help with?",
      min_values = 1,
      max_values = 1,
        options = [
          discord.SelectOption(
            label="Math Command",
            description="View math commands",
            value="value1"
          )
        ]
      )
  async def select_callback(self, interaction, select):
    if select.values[0] == "value1":
      await interaction.response.send_message("Math Commands:\n\n Addition command:\n.add adds two numbers together, eg: .add 2 2 will output 4")

@client.command()
async def helpcommands(ctx):
  await ctx.send("Select a help command", view=MyView())```
primal token
slate swan
#

ughh I guess I'll fix tommorow

vale wing
zealous jay
primal token
vale wing
#

*other countries

tawdry tendon
#

we start in september in the uk

primal token
#

when do you guys end?

#

april?

tawdry tendon
#

mo

vale wing
#

May

tawdry tendon
#

no

vale wing
#

Sometimes June

primal token
#

L

tawdry tendon
#

july LOL

tawdry tendon
cold sonnet
#

we end around 29th july start in september 15th

vale wing
tawdry tendon
cold sonnet
#

don't move there

tawdry tendon
#

LOOOOL

vale wing
#

Russia is a good country to live in trust

tawdry tendon
#

ye 100%

primal token
tawdry tendon
#

me too

primal token
tawdry tendon
#

want to meet?

cold sonnet
#

in

primal token
tawdry tendon
#

southeast co ordinates are 234, -324

primal token
#

alright, im coming

tawdry tendon
#

ight

#

how long?

vale wing
#

What latency is there on mars

tawdry tendon
#

-100 m/s

#

@primal token why is your tag 6900 😭

vale wing
#

The real question is why the hell my ID ends with 666

tawdry tendon
#

why does it start in 69 too 😭

#

how you doing this LOOOOOL

vale wing
#

Nitro sucks

primal token
tawdry tendon
#

damn

#

lemme try LOL

primal token
#

youre my enemy now😳

vale wing
#

😈

tawdry tendon
#

shit

#

look at my name now lol

vale wing
#

How could a conversation about discord bots go to the eternal fight with good and evil

tawdry tendon
#

lolllllll

tawdry tendon
primal token
tawdry tendon
#

too long

#

im going to sleep 😴

primal token
#

😔

tawdry tendon
#

maybe tommorow

#

anyways

#

enough of mars

slate swan
#

Why does my bot, after using slash command, give an error first, and then the result?

vale wing
#

What error

#

"interaction took too long to respond"?

#

Defer the response

#

await inter.response.defer()

slate swan
#

do that stuff in setup_hook, not on_ready

vale wing
#

on_message might get called before on_ready so do as @slate swan said

#

Ok then override start method

#

What

slate swan
#

@vale wing

vale wing
slate swan
#

well, make the setup_hook or whatever you want to call it function and call it manually ```py

bot = MyBot()
async def main():
await bot.setup_hook()
await bot.start()

asyncio.run(main())```

oblique peak
#

anyone know why await channel.send("Hello @sly mirage") doesnt ping the user anymore and just sends "<@id>"?

slate swan
# vale wing <@456226577798135808> yes use this
Traceback (most recent call last):
  File "C:\Users\ToxicPenguin\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 113, in wrapped
    ret = await coro(arg)
  File "C:\Users\ToxicPenguin\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 762, in _invoke
    await self.callback(self.cog, ctx, **kwargs)
  File "c:\Users\ToxicPenguin\Desktop\проекты на Python\disocrd bot python\cogs\slash.py", line 33, in _ping_
    await interaction.response.defer(f'**{interaction.author.mention}** {hug} **{member.mention}**', embed=embed)
TypeError: defer() got an unexpected keyword argument 'embed'

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

Traceback (most recent call last):
  File "C:\Users\ToxicPenguin\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\bot.py", line 755, in process_application_commands
    await ctx.command.invoke(ctx)
  File "C:\Users\ToxicPenguin\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 312, in invoke
    await injected(ctx)
  File "C:\Users\ToxicPenguin\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\commands\core.py", line 119, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.commands.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: defer() got an unexpected keyword argument 'embed'```
slate swan
#

now just a mistake

#

you didn't make a setup_hook tho?

#

create it and move the connection code inside it

#

@vale wing Probably because I use embed, this one doesn't work

#

slash commands with embed cannot send messages containing gif ?

#

they can

#

@slate swan it just works strangely for me. The way they tell me it doesn't work at all. And the way it's done works for me, but with an error. That is, an error is issued first, and then the result that is needed

#

defer doesn't take any args

#

@slate swan I need this line await inter.response.defer() Should I insert after embed or before ?

#

that shouldn't matter

#

also, you can just inter.response.create_response

#

okay weird

#

@slate swan my code

    @commands.slash_command(name = 'ping', description="Обнять участника сервера")
    async def _ping_(self, interaction: discord.Interaction, * , member: discord.Member = None):
        if member is None:
            embed = discord.Embed(description = 'Укажите ID пользователя или его линк через @', colour=0xF1C40F)
            await interaction.send(embed=embed)
            return
        if member.bot == True:
            embed = discord.Embed(description = 'Вы не можете обнять бота', colour=0xF1C40F)
            await interaction.send(embed=embed)
            return
        if member == interaction.author:
            embed = discord.Embed(description = 'Вы не можете обнять самого себя', colour=0xF1C40F)
            await interaction.send(embed=embed)
            return


        hug = (random.choice(["обнял","крепко обнял","прижал к себе","приобнял"]))
        embed = discord.Embed(colour=0xF1C40F)
        embed.set_image(url =random.choice(['link']))
        await interaction.send(f'**{interaction.author.mention}** {hug} **{member.mention}**', embed=embed)```
#

is that pycord?

#

interaction.send isn't really a thing from what i remember

slate swan
#

@slate swan I know that when using slash, you need to output messages the wrong way. But when I write await interaction.response I just get an error and that's it

#

how to output ``TypeError: 'Interaction Response' object is not callable" ?

shrewd apex
#

interaction.response.sens_message()

#

send*

shrewd apex
slate swan
#

@shrewd apex no. Error Application Command raised an exception: TypeError: 'coroutine' object is not callable

shrewd apex
#

how did u use it show

slate swan
#
    @commands.slash_command(name = 'ping')
    async def _ping_(self, interaction: discord.Interaction, * , member: discord.Member = None):
        if member is None:
            embed = discord.Embed(description = 'Укажите ID пользователя или его линк через @', colour=0xF1C40F)
            await interaction.send(embed=embed)
            return
        if member.bot == True:
            embed = discord.Embed(description = 'Вы не можете обнять бота', colour=0xF1C40F)
            await interaction.send(embed=embed)
            return
        if member == interaction.author:
            embed = discord.Embed(description = 'Вы не можете обнять самого себя', colour=0xF1C40F)
            await interaction.send(embed=embed)
            return


        hug = (random.choice(["обнял","крепко обнял","прижал к себе","приобнял"]))
        embed = discord.Embed(colour=0xF1C40F)
        embed.set_image(url =random.choice(['link']))
        await interaction.response.send_message()(f'**{interaction.author.mention}** {hug} **{member.mention}**', embed=embed)```
cold oyster
#

ow do i make ma bot send a msg to a different cannel, (wit canel id)

shrewd apex
#

...

cold oyster
#

@shrewd apex sp

shrewd apex
shrewd apex
slate swan
shrewd apex
#

!d discord.TextChannel.send

cold oyster
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.

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/latest/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.10)") of [`File`](https://discordpy.readthedocs.io/en/latest/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/latest/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.10)") of [`Embed`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
cold oyster
#

tx

slate swan
shrewd apex
#

!d discord.ext.commands.Bot.get_channel

unkempt canyonBOT
slate swan
#

I didn't notice the extra brackets...

cold oyster
#

kk

shrewd apex
slate swan
#

Jesus Christ I am bad at seige now

#

I had a 2 week break

#

😭

#

how to fix it?

shrewd apex
#

what's a seige

slate swan
#

its a game

shrewd apex
cold sonnet
slate swan
#

rainbow 6 seige or something if im not getting it wrong

primal token
#

just call it r6 lol

slate swan
shrewd apex
slate swan
slate swan
cold sonnet
slate swan
slate swan
slate swan
slate swan
#

i use it

#

Of military or smth idk

silk fulcrum
#

hey @shrewd apex im back from minecraft, was harvs nice?

slate swan
#

Read the book

shrewd apex
#

yes he was explaining r6 to me

silk fulcrum
#

gud

cold sonnet
#

replace channel.guild with guild

#

make it make sense

cold sonnet
#

or is that another guild

cold oyster
#

@shrewd apex Is it client.get_channel(id)?

shrewd apex
#

yes

cold oyster
#

k

silk fulcrum
slate swan
cold oyster
silk fulcrum
primal token
cold oyster
unkempt canyonBOT
silk fulcrum
slate swan
#

Pretty shitty song then

silk fulcrum
silk fulcrum
cold oyster
cold sonnet
#

no 👉👈

slate swan
shrewd apex
#

song worth hearing if album cover is good enough pithink

silk fulcrum
slate swan
slate swan
silk fulcrum
shrewd apex
#

puberty tada

slate swan
cold sonnet
#

could be

silk fulcrum
#

and in the middle of all that sad songs i can easily listen to something like "Cherry Gum"

slate swan
#

🗿i have only 2 song moods, metal or soothing

cold sonnet
#

ew

primal token
#

guys i know why master is a horrible human

#

!e

(__import__("ctypes").c_char*7).from_address(id('Java')+48).value = b'master\0';print(f'Java' + "er")
unkempt canyonBOT
#

@primal token :white_check_mark: Your 3.11 eval job has completed with return code 0.

master
shrewd apex
#

👀

silk fulcrum
cold sonnet
#

I don't understand shit from that code but I wanna try something

shrewd apex
#

why use f string if u are not even using it ;-;

cold sonnet
#

!e

(__import__("ctypes").c_char*7).from_address(id('Java')+48).value = b'noid\0';print(f'Java' + "er")
unkempt canyonBOT
#

@cold sonnet :white_check_mark: Your 3.11 eval job has completed with return code 0.

noider
slate swan
#

!e float.from_adress

cold sonnet
#

what

slate swan
#

Small flex

primal token
silk fulcrum
slate swan
silk fulcrum
#

that should be anomaly or record at least

slate swan
#

Now I codespongey_sad

cold sonnet
#

!e

(__import__("ctypes").c_char*5).from_address(id('Java')+48).value = b'noid\0';print(f'Java' + "er")
unkempt canyonBOT
#

@cold sonnet :white_check_mark: Your 3.11 eval job has completed with return code 0.

noider
silk fulcrum
shrewd apex
cold sonnet
#

it don't make sense

slate swan
#

That’s sad

shrewd apex
#

ikr ;-;

primal token
#

ive segfaulted 3 times already

silk fulcrum
slate swan
#

I might stop playing r6 and coding because I’m embarrassed of how shit I am

#

I used to be tucking on point as I played it every day

shrewd apex
#
According to Urban Dictionary, 'rizz' refers to someone's ability to attract a love interest.
cold sonnet
silk fulcrum
#

try ip of the server

cold sonnet
#

I'm going to start tagging how to get help

silk fulcrum
#

or 127.0.0.1 could also be

primal token
#

because the vps local host isnt serving a MySQL server

silk fulcrum
novel apexBOT
#

This is not a Modmail thread.

slate swan
#

🗿 someone knows how to mention slash commands?

cold sonnet
silk fulcrum
#

that was a joke

#

and i think i was too much there its a habit already

#

from the moment i started till 1 year ago

shrewd apex
silk fulcrum
#

i only was at dpy server

slate swan
#

I guess I HAVE to code now

silk fulcrum
slate swan
#

I’m gonna put up the Xbox light I won from the arcade

silk fulcrum
#

almost worked

primal token
#

seems like data corruption to me kek

cold sonnet
#

what the

#

@/shrug

cold sonnet
#

no

silk fulcrum
#

you dont have access to this link

shrewd apex
#

!d discord.app_commands.AppCommand.mention

unkempt canyonBOT
silk fulcrum
#

what!

slate swan
#

imagine not being in discord developers server

silk fulcrum
cold sonnet
# unkempt canyon

await ctx.send(f"\{app_command.mention}")
would probably result in showing us the string

slate swan
cold sonnet
#

we could do that too

slate swan
#

yea

shrewd apex
#

by deleting the data

slate swan
#

Ok what should I code

cold sonnet
slate swan
cold sonnet
#

jesus

slate swan
cold sonnet
#

yes

#

code an AI human

shrewd apex
#

i saw u were using MySQL and u used it in a discord bot u prolly corrupted it by trying to write in the db async

slate swan
#

What discord bot should I code joobisweat

shrewd apex
slate swan
#

yeah cuz im unable to sleep

shrewd apex
slate swan
#

yea

shrewd apex
#

wrote multiple stuff at once

#

write*

slate swan
primal token
#

my mobile client updated and now it looks weird, better/different fonts and better crisp ui and a notification tab

cold sonnet
torn sail
#

yes

cold sonnet
#

I don't think that's possible

primal token
#

also the file viewer ui looks different

slate swan
slate swan
silk fulcrum
shrewd apex
slate swan
slate swan
primal token
slate swan
shrewd apex
#

how are u compressing?

slate swan
slate swan
slate swan
shrewd apex
#

actually just make an embed designer

#

stuff which shows embed designs

slate swan
primal token
slate swan
#

which works with dictionaries

shrewd apex
slate swan
#

another weird idea

silk fulcrum
shrewd apex
slate swan
slate swan
#

or atleast people dont do that

zealous jay
#

how can I check if a variable is a banEntry?

#
if x == discord.banEntry:
  do stuff

wouldn't work, right?

slate swan
#

depends on wym by banEntry

silk fulcrum
zealous jay
#

oh

slate swan
#

or type(x) == discord.BanEntry

zealous jay
#

thanks

silk fulcrum
#

im so unorganised

junior verge
#

Anyone that can help me with a big problem with my VPS or where can I ask for help for it?

slate swan
silk fulcrum
#

i already built a graphic, what more do I need?

#

why cant I just follow it

slate swan
#

I had to restart my pc

#

average windows user

#

breh that logo

#

Lucas moment

#

the bot logo

#

I think I might if came a little from pycharms ui

#

sorry i can't zoom enough in the image, gimme a moment

#

wrong quotes

#

one should use " or ', not `

echo wasp
#
  File "/home/maskuhpq/status/cogs/misc.py", line 52, in Misc
    async def config(interaction: discord.Interaction, user: discord.User):
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 2008, in decorator
    return Command(
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 677, in __init__
    self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 408, in _extract_parameters_from_callback
    _populate_descriptions(result, descriptions)
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 296, in _populate_descriptions
    raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: user```
code: 
```async def config(interaction: discord.Interaction, user: discord.User):```
slate swan
#

select * from "table name" ig

echo wasp
#

thx updating to 2.0

slate swan
#

or even Select * from table name should work ig

slate swan
#

Why is my pc so slow

junior verge
#

anyone any clue? After like 2-3 hours my terminal in my vps just gets killed sadge

primal token
slate swan
#

are you writing from python code or that website

#

if its code, then make sure you commit after writing

slate swan
#

use linux :p

#

No

#

Tbh I might

junior verge
slate swan
#

To embrace that femboy lifestyle Sad

slate swan
junior verge
slate swan
#

doesn't sound like a issue related to saving data, do you commit?

primal token
slate swan
#

linux distro

primal token
slate swan
#

there are like 20 popular ones

#

when you write into a database using python you need to commit in the database everytime

primal token
slate swan
#

what library are you using

slate swan
#

16mb ;p

#

for MySQL

primal token
echo wasp
#
 File "/home/maskuhpq/status/cogs/misc.py", line 52, in Misc
    async def config(interaction: discord.Interaction, Member: discord.Member):
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 2008, in decorator
    return Command(
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 677, in __init__
    self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 408, in _extract_parameters_from_callback
    _populate_descriptions(result, descriptions)
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 296, in _populate_descriptions
    raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: user```
code:
```py
async def config(interaction: discord.Interaction, Member: discord.Member):```
torn sail
echo wasp
#

i changed it but i forgot to change the line in discord

zealous jay
#

Would recommend to change user to member

slate swan
zealous jay
#

Because for discord user is not the same as a member

#

I mean changing the variable name

echo wasp
whole sparrow
#

Im sending a button with an embed to a specific channel

#

How do I disable the button after it has been pressed?

primal token
slate swan
#

I need someone to sit inbetween my thighs while I code 😭😭

primal token
#

bro what

echo wasp
#
  File "/home/maskuhpq/status/bot.py", line 12, in <module>
    from cogs.misc import Misc
  File "/home/maskuhpq/status/cogs/misc.py", line 11, in <module>
    class Misc(app_commands.Group):
  File "/home/maskuhpq/status/cogs/misc.py", line 52, in Misc
    async def config(interaction: discord.Interaction, Member: discord.Member):
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 2008, in decorator
    return Command(
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 677, in __init__
    self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 408, in _extract_parameters_from_callback
    _populate_descriptions(result, descriptions)
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 296, in _populate_descriptions
    raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: user```
code```py
@app_commands.describe(user="The user to get the down message for")
    async def config(interaction: discord.Interaction, Member: discord.Member):
        user = bot.get_user(Member.id)
        try:
            results = collection.find()
            for result in results:

                if str(result["_id"]) != str(user.id):
                    await interaction.responce.send("Hm I can't find that bot in my database!")
                    pass
                else:
                    for query in result:
                        if str(query) == "_id":
                            pass
                        else:```
slate swan
primal token
#

No, but the statement wasn't written correctly.

slate swan
#

I need someone to sit in between my thighs, while I code.

echo wasp
#

confused???

#

can someone help fix my problem using slash commands

whole sparrow
#
        overwrites = {
            guild.default_role: disnake.PermissionOverwrite(read_messages = False),
            support: disnake.PermissionOverwrite(read_messages = True),
            inter.author: disnake.PermissionOverwrite(read_messages=True)
        }

        channel = await guild.create_text_channel(f"Ticket | {inter.author.id}", overwrites=overwrites)

Im using this code to make a private channel but as a user I cannot see the text channel when it's created

primal token
#

my cat does all the coding

slate swan
slate swan
primal token
#

get your motherducky_beer

indigo skiff
#

no

slate swan
#

I want a person I am unrelated 2

#

And also is male 😭

indigo skiff
#

...

primal token
#

your step uncle herbert

slate swan
primal token
echo wasp
#
  File "/home/maskuhpq/status/bot.py", line 12, in <module>
    from cogs.misc import Misc
  File "/home/maskuhpq/status/cogs/misc.py", line 11, in <module>
    class Misc(app_commands.Group):
  File "/home/maskuhpq/status/cogs/misc.py", line 52, in Misc
    async def config(interaction: discord.Interaction, Member: discord.Member):
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 2008, in decorator
    return Command(
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 677, in __init__
    self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 408, in _extract_parameters_from_callback
    _populate_descriptions(result, descriptions)
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 296, in _populate_descriptions
    raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: user```
code```py
@app_commands.describe(user="The user to get the down message for")
    async def config(interaction: discord.Interaction, Member: discord.Member):
        user = bot.get_user(Member.id)
        try:
            results = collection.find()
            for result in results:

                if str(result["_id"]) != str(user.id):
                    await interaction.responce.send("Hm I can't find that bot in my database!")
                    pass
                else:
                    for query in result:
                        if str(query) == "_id":
                            pass
                        else:```
slate swan
primal token
#

ok lets stop joking around lol

slate swan
#

I wasn’t joking but ok

primal token
slate swan
#

One day Sad

slate swan
#

Prob cause it uses wierd characters

silk fulcrum
#

probably env doesnt recognise them

#

encoding is utf8 by default iirc

silk fulcrum
echo wasp
silk fulcrum
#

user="nggyp"

echo wasp
echo wasp
# silk fulcrum but `@app_commands.describe` says
Traceback (most recent call last):
  File "/home/maskuhpq/status/bot.py", line 12, in <module>
    from cogs.misc import Misc
  File "/home/maskuhpq/status/cogs/misc.py", line 11, in <module>
    class Misc(app_commands.Group):
  File "/home/maskuhpq/status/cogs/misc.py", line 52, in Misc
    async def config(Member: discord.Member, interaction: discord.Interaction):
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 2008, in decorator
    return Command(
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 677, in __init__
    self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 408, in _extract_parameters_from_callback
    _populate_descriptions(result, descriptions)
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 296, in _populate_descriptions
    raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: Member```
silk fulcrum
#

you really shouldn't name an argument like that, it could lead to shadowing

#

better name it lowercase

echo wasp
#

ok

silk fulcrum
#

member

#

and bot.get_user() takes an ID, not a Member object

silk fulcrum
#

and why would you even need to get the user

#

isn't that member object enough

#

and why did you put member argument first? interaction should always be first

echo wasp
silk fulcrum
#

do all I said

#

and try

echo wasp
#
Traceback (most recent call last):
  File "/home/maskuhpq/status/bot.py", line 12, in <module>
    from cogs.misc import Misc
  File "/home/maskuhpq/status/cogs/misc.py", line 11, in <module>
    class Misc(app_commands.Group):
  File "/home/maskuhpq/status/cogs/misc.py", line 52, in Misc
    async def config(interaction: discord.Interaction, member: discord.Member):
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 2008, in decorator
    return Command(
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 677, in __init__
    self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 408, in _extract_parameters_from_callback
    _populate_descriptions(result, descriptions)
  File "/home/maskuhpq/.local/lib/python3.9/site-packages/discord/app_commands/commands.py", line 296, in _populate_descriptions
    raise TypeError(f'unknown parameter given: {first}')
TypeError: unknown parameter given: member```
#

@silk fulcrum

silk fulcrum
#

uhm... wait... is that a cog?

primal token
#

im going to be honest i dislike the new mobile client ui

silk fulcrum
#

ok

primal token
junior verge
primal token
#

the emojis dont even get highlighted kek

silk fulcrum
#

wdym dont get hightlighted

junior verge
silk fulcrum
#

oh i see

junior verge
#

oh

primal token
junior verge
#

thank god

primal token
echo wasp
junior verge
#

anyone

echo wasp
#

yes it is

primal token
slate swan
#

how to make discord 0auth2 token not expire

sick birch
#

it's a security flaw

slate swan
tawdry tendon
#

I have a discord bot
what i want to do with it:
take users input(which will be their channel id)
and then add a welcome message in that channel everytime someone joins
can anyone help me do this?

tawdry tendon
#

hi

#

can you help me?

#

ive been struggling for so long

#

yes

#

yes

#

damn

#

i dont know how to do that 😦

#

ok thanks

#

i thought it would be short tutorials lol

#

because im turning of my pc soon

void flax
# echo wasp

if it's a cog, does that mean this is a method in a class?

echo wasp
void flax
#

is this function inside of a class?

echo wasp
#

yes

#

a command

void flax
#

I would expect there to be a self argument

echo wasp
void flax
#

as the very first argument

lone lichen
#

First argument

#

!resource python

#

!resources python

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.

echo wasp
#
@app_commands.command(description="Get the down message for your bot")
    @app_commands.describe(member="The user to get the down message for")
    async def config(interaction: discord.Interaction, member: discord.Member):
        user = bot.get_user(member.id)
        try:
            results = collection.find()
            for result in results:

                if str(result["_id"]) != str(user.id):
                    await interaction.responce.send("Hm I can't find that bot in my database!")
                    pass
                else:
                    for query in result:
                        if str(query) == "_id":
                            pass
                        else:
                            server = result[query]
                            channel = bot.get_channel(server[0])
                            down_message = server[2]
                            auto_publish = server[3]
                            lock = server[5]
                            embed=discord.Embed(title="Config", description="Shows the config of the selected user")
                            embed.add_field(name="Down Message", value="{down_message}", inline=True)
                            embed.add_field(name="Channel set", value="<#{channel.id}>")
                            embed.add_field(name="Auto Publish", value="Auto Publish is set to {auto_publish}", inline=False)
                            embed.add_field(name="Lock", value="Locking the server is set to {lock}", inline=True)
                            await interaction.response.send_message(embed=embed)
        except Exception as e:
            print(e)
            pass```
void flax
#

config(self, interaction: discord.Interaction, member: discord.Member):

echo wasp
lone lichen
void flax
#

it's fine

echo wasp
lone lichen
echo wasp
lone lichen
echo wasp
void flax
#

snippets?

lone lichen
echo wasp
void flax
#

in any case, does that fix it

lone lichen
primal token
#

@slate swan because of our linux discussion i am now currently dual bootingducky_party

echo wasp
#

how do you get the author id of the person who did the slash command?

drifting arrow
#

If I have a message id, how can I get it and delete the original message?
I am using interactions so interaction.guild.fetch_message doesnt work

#

is it get_message instead?

drifting arrow
#

Figured it out. Solution was just to call the channel the message was in and delete it..

sick birch
echo wasp
#

Thx

#

Thx

unreal shuttle
#

What's up, I haven't coded in like a year so i forgot almost everything about it. I don't remember if anything is paid to run a bot and idk if python's code has changed since then

#

I have a github linked if yall wanna check that out

sick birch
drowsy prairie
#

How do I run the command separately in each file?

unreal shuttle
#

plus Im not sure if my code is outdated & python changed

slate swan
#

We're on 2.0 now

unreal shuttle
#

I have a github if you wanna check it out

slate swan
#

Send the link

unreal shuttle
#

thought it was on my profile, hold on

unreal shuttle
#

oh shit nvm, it was 2 years ago

#

damn been a whilee

slate swan
#

I don't remember which version that was probably 1.7.0

unreal shuttle
#

I remember seeing a number like that on the version yeah

slate swan
#

if you're on the same PC you can do pip list

unreal shuttle
#

dude I gotta relearn everything

#

you run "pip list" through a coding app right

slate swan
#

when i run my script in visual studio it dosent run

unreal shuttle
#

thats what it is, visual studio

unreal shuttle
#

you run "pip list" through visual studio right? @slate swan

slate swan
unreal shuttle
slate swan
slate swan
unreal shuttle
#

yup

slate swan
unreal shuttle
#

Ima just watch the video tutorials I watched before

#

thanks bro

slate swan
#

Press the play button on the top right and it should open a terminal & run

#

i did

#

What's your code?

#

What's your code

#

import discord
from discord.ext import commands

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

slate swan
#

thx

#

bro

#

Make sure to check your indentations 😺

#

they matter!

#

yea

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

slate swan
#

In the future send your code like that ^

#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

slate swan
#





print("hello")
#

dint work

#

send it like that

#
print("hello")
#

okay thx

#

Np

#

om am i dum or like

#

?

sonic flax
#

what does AttributeError: 'Bot' object has no attribute 'edit_server' mean

slate swan
#
import discord
from discord.ext import commands

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

@client.event
async def on_message(message):
    if message.author == client.user:
        return
    if message.content.startswith("HELLO")
    await message.channel.send("!HELLO")




client.run("TOKEN")
#

is there any errorrrrrrrrrrrrrr

sonic flax
slate swan
slate swan
#

and this kid

slate swan
#

said that i have to right it

#

wdym

#

I mean you can only have one on_message

#

one what

#
@client.event
async def on_message(): # this is your on_message event
#

so do i put no message in the ()
\

#
@client.listen('on_message')
async def some_name() -> None:
    # your code here
#

replace one of your on message events with that ^

#

It looks like you're too much of a beginner to begin learning discord bots. Discord bots are not a beginner friendly thing to make. @slate swan

#

!resources

unkempt canyonBOT
#
Resources

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

slate swan
#

alr

sonic flax
#
    elif person1 == ('aaa'):
      with open('aaa.png', 'rb') as f:
        icon = f.read()
        await bot.edit_server(icon=icon)
        await ctx.guild.name.edit("test server")```
sonic flax
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'edit_server'

upbeat gust
#

yeah that doesnt exist

slate swan
upbeat gust
#

!d discord.Guild.edit

unkempt canyonBOT
#
await edit(*, reason=..., name=..., description=..., icon=..., banner=..., splash=..., discovery_splash=..., community=..., afk_channel=..., owner=..., afk_timeout=..., ...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Edits the guild.

You must have the [`manage_guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_guild "discord.Permissions.manage_guild") permission to edit the guild.

Changed in version 1.4: The `rules_channel` and `public_updates_channel` keyword parameters were added.

Changed in version 2.0: The `discovery_splash` and community keyword parameters were added.

Changed in version 2.0: The newly updated guild is returned...
upbeat gust
#

the on_message event gets a discord.Message, not commands.Context

slate swan
upbeat gust
#

yeah that code is years old

sonic flax
upbeat gust
#

just look at the documentation

#

you djust use ctx.guild.edit(...)

torn sail
jovial dock
#

does import discord not exist anymore?

fresh iron
#

people still make discord bots?

upbeat gust
jovial dock
#

why's it not importing?

upbeat gust
jovial dock
#

nvm, had it in restricted mode for some reason

rapid jetty
#

I just have a 3500 lines bot

#

and get money doing this

#

but no one does bots

fresh iron
#

an useless

#

how bout english

rapid jetty
#

I'm not even american bro

daring olive
fresh iron
#

hi mina

#

i was curious if people still make discord bots before getting attacked

daring olive
#

i don't think they were questioning your english.

#

but yeh people still make discord bots

daring olive
#

do you think people have moved on to something else?

fresh iron
#

yeah that's pretty much it

fresh iron
# rapid jetty He was

i wasn't but i'd like to question your geography for thinking only americans speak it

daring olive
#

please only discuss discord bots here

rapid jetty
fresh iron
daring olive
#

last warning for both of you

fresh iron
# slate swan ```py import discord from discord.ext import commands client = commands.Bot(com...

there's no error but you probably should change the prefix to something easier

import discord
from discord.ext import commands

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

@client.event
async def on_message(message):
    if message.author == client.user:
        return
    if message.content.startswith("HELLO")
    await message.channel.send("!HELLO")




client.run("TOKEN")

like this

primal token
#

it would raise a syntax error

fresh iron
#

no?

primal token
#

either way your indentations arent correct and the code can be better, should also recommend to use slash commands to avoid prefix clashing

primal token
#

if youre going to spoonfeed atleast do a good job at it, if you call it bare bones atleast make it bare good kekducky_party

fresh iron
#

jesus christ people here are so salty for no meaningful reason

primal token
#

im not salty lol, thats just how i am, ask regulars lol

daring olive
#

condescending, etc. etc

primal token
#

alright ill be more constructive ducky_beer

daring olive
#

thx

rapid jetty
primal token
fresh iron
#

innit the second thing is unnecessary

primal token
#

yeah i would agree, it can make your code look very unpythonic and some people also do actions if the bot is itself so it would depend aswell

slate swan
#

if you already installed it you can change the desktop environment to xfce by installing it thru apt