#discord-bots

1 messages · Page 897 of 1

drifting swift
#

ohh ok

silent ermine
#

oh ok, I just did a try and except

sick birch
#

Big regexes are written by people a lot smarter than I who know what they're doing

silent ermine
#

should I keep the try or do the else?

sick birch
#

We call this LBYL vs EAFP

silent ermine
sick birch
#

Look before you leap, LBYL, if/else before doing something
Easier to ask for forgiveness than permission, EAFP, try/except, do something, if something happens, oops, do something else

#

In this case it doesn't matter all that much

#

But it's something to think about other times you run into a similar issue

#

What you have right now is EAFP, assume the message has a link, and find the group. If an error happens (message doesn't have a link) then catch the error. Other approach would be first match a string, then check if you have any matches. if you do, then find what the match actually was. If you don't, then do something else

lofty dagger
#

!e

  async def nitro(self,ctx) :
    
    embed=discord.Embed(title='You have been gifted a subscription',description="You have been gifted **Discord Nitro** for **3 months**\nExpires in **24 hours**\nClaim before Expiration\n**[Disclaimer](https://www.google.com/UniqueCord&DiscordBot=UniqueCord)**",color=Colour.dark_red())
    embed.set_image(url="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRfkUVViOwesXss5S9jGpNWNAKpkAt7FkyEfcnOTE5ZK5vSdYonJMGLUIz7QCnUor2VSaM&usqp=CAU")
    s=str(ctx.author)
    k=s[:(len(s)-5)]
    embed.timestamp = datetime.datetime.utcnow()
    embed.set_author(name=f"Congratulations! {k}",icon_url=ctx.author.avatar.url)
    embed.set_thumbnail(url="https://repository-images.githubusercontent.com/336227331/08ca6fc4-80b3-482e-ba9d-0e13b1fc3288")
    embed.set_footer(text=f'\u200bRequested by {k}',icon_url=ctx.author.avatar.url)
    await ctx.reply(embed=embed,view=self.nitr(ctx),mention_author=False)```
unkempt canyonBOT
#

@lofty dagger :x: Your eval job has completed with return code 1.

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

What are you trying to do with that code?

#

ctx.send(...) returns the message the bot sent

#

nah easier solution

#
await ctx.send(..., delete_after=10)

would delete after 10 seconds

#

Can save a bit of space and lines that way

#
  • keep it readable so I don't see why you wouldn't
pliant gulch
#

SelfBot 👁️ 👁️

#

🤔

#

Confused as to why the bot uses input, kind of sus

#

Or at least it would freeze your bot

#

🤔

sick birch
#

An exe bot?

#

Python probably isn't the best language if you want to compile your bot to an executable

modest plover
#

As in the code runs when you open the .exe?
I'm confused

alpine furnace
#

Just pyinstaller it 🤷‍♂️

sick birch
#

Are you using pyinstaller?

pliant gulch
#

Making an EXE bot that uses input everytime you run it in order to setup is pretty suspect imo, only useful for selfbots, your message before you edited your message it also mentions SelfBot directly

#

Regular bot's would've used a config file

sick birch
#

Ehhhh pyinstaller

alpine furnace
#

No decompiler tool supports 3.9+ atm

#

Iirc

sick birch
#

Who said that

#

The dude who told you make the exe file

#

nah just curious

#

Sounds pretty weird someone would ask you to do that

pliant gulch
#

Your old message shows the same inputs you were using before, you're still talking about the same code 🤔

sick birch
#

Especially with an interpreted language

slate swan
#

no escaping when you got andy and robin interrogating you

sick birch
slate swan
#

Robin is good cop and andy is bad cop

pliant gulch
#

I cba to look through your old messages, but just saying, sus as hell when you have input and something to do with bans, also suspect even more when you edited your message after being told it had SelfBot ¯_(ツ)_/¯

sick birch
#

should probably write it in rust or C/C++ and compile it to exe that way but alr

low latch
#

don't use that word as an insult please

sick birch
#

you do you ¯_(ツ)_/¯

#

Pyinstaller does its job alright i guess

#

You'll probably want to run input() before you run bot.run()

#

doing it anywhere else would probably block your code

#

hmm I guess that works

#

As long as it's not in any commands or anything

somber sky
sick birch
#

Missing a closing )

pliant gulch
#

And a colon ^

sick birch
#

that too

somber sky
#

OH LOL

supple thorn
#

you did?

slate swan
#

!d discord.Message.add_reaction

unkempt canyonBOT
#

await add_reaction(emoji, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Add a reaction to the message.

The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/master/api.html#discord.Emoji "discord.Emoji").

You must have the [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission to use this. If nobody else has reacted to the message using this emoji, the [`add_reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.add_reactions "discord.Permissions.add_reactions") permission is required.

Changed in version 2.0: `emoji` parameter is now positional-only.

Changed in version 2.0: This function no-longer raises `InvalidArgument` instead raising [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)").
sick birch
#
m = await ctx.send(...)
await m.add_reaction(...)
heavy hound
#

!d add_reaction

unkempt canyonBOT
#
NEGATORY.

No documentation found for the requested symbol.

heavy hound
#

bruh what

#

wake up wake up r danny bot is better than you

#

bro atleast search the docs

#

!d docs

sick birch
#

!d discord.ext.commands.Context.send

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

Sends a message to the destination with the content given.

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

!d discord.Message.add_reaction

unkempt canyonBOT
#

await add_reaction(emoji, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Add a reaction to the message.

The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/master/api.html#discord.Emoji "discord.Emoji").

You must have the [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission to use this. If nobody else has reacted to the message using this emoji, the [`add_reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.add_reactions "discord.Permissions.add_reactions") permission is required.

Changed in version 2.0: `emoji` parameter is now positional-only.

Changed in version 2.0: This function no-longer raises `InvalidArgument` instead raising [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)").
slate swan
#

fair enough

slate swan
#

you can use unicode lol

#

\✅

#

\❌

#

just copy paste them

#

\emoji to make them unicode

#

well it wasnt closed?

slate swan
#

bro

sick birch
#

It needs to be in a string

torn sail
sick birch
#
await m.add_reaction('✅')

works out

final iron
#

!d discord.Message.add_reaction

unkempt canyonBOT
#

await add_reaction(emoji, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Add a reaction to the message.

The emoji may be a unicode emoji or a custom guild [`Emoji`](https://discordpy.readthedocs.io/en/master/api.html#discord.Emoji "discord.Emoji").

You must have the [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission to use this. If nobody else has reacted to the message using this emoji, the [`add_reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.add_reactions "discord.Permissions.add_reactions") permission is required.

Changed in version 2.0: `emoji` parameter is now positional-only.

Changed in version 2.0: This function no-longer raises `InvalidArgument` instead raising [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)").
somber sky
#

anyone know how to make a list of people in a role command like -members Admin i cant find anyone neither a video of how to do it

stiff lagoon
#

I use a large spreadsheet for work, and I would like to learn how to code with python. So why not learn and make my life easier at the same time.

The only issue I have is I have no idea what is even possible in my case. The excel file I use is retail pricing on a category of goods, it has multiple spreadsheets, each spreadsheet is a different region, and each region has 5-7 stores, and each store has 8-25 items, and I use this to track pricing.

I would like to automate the editing that is done and a tool to automate creating a separate spreadsheet to compare similar products.

VBA, Vlookup, & Power query are maybe possible, but I have yet to find a way. Mostly because of inconsistent rows and columns & the amount of data that is pinned to a product.
Any advice is helpful!

supple thorn
#

this is the discord bots channel

heavy hound
#

what is the raw unicode for ✅

slate swan
heavy hound
#

ok

stiff lagoon
# supple thorn what

Sorry dude, This seem to be the only place with active people. just need some help

somber sky
#

is anyone elses bot not working

#

my bot is just dead out of no where

cold oyster
#

Hmm

slate swan
cold oyster
slate swan
#

mhm

cold oyster
#

It does not say anything

slate swan
cold oyster
slate swan
#

....

#

code?

cold oyster
# slate swan ....
@client.command()
@commands.has_role(950040612625842186)
async def add_money(ctx, user: discord.Member, amount=None):
    if amount == None:
        await ctx.reply("**__INVALID AMOUNT__**, Please use `ayo add_money [user] [amount]`")
        return
    else:
        users = await get_bank_data()
        users[str(user.id)]["wallet"] += amount

        with open("mainbank.json",'w') as f:
            json.dump(users,f)
        await ctx.reply(f"Successfully added {amount} to {user.name}'s wallet")```
#

No errors.

#

Hmmm

slate swan
cold oyster
#

Let me use the good o'l print trick

slate swan
# cold oyster Hmmm

amount is probably an str, you need to convert it to an int or just typehint it

slate swan
cold oyster
slate swan
cold oyster
slate swan
slate swan
#

!pypi aiosqlite

unkempt canyonBOT
slate swan
#

if you need anything else ping me

cold oyster
slate swan
#

did the command work though?

cold oyster
#

Literally He wrote the whole code

cold oyster
slate swan
#

huh

cold oyster
#

Got a problem now-

slate swan
#

smh

#

and ash what is this? nice argument naming

cold oyster
cold oyster
slate swan
#

int: float is what youre doing

cold oyster
#

A DOGGO-

slate swan
cold oyster
cold oyster
#

Idk if its a she or he tbh

slate swan
#

im the same person lol

#

smh

cold oyster
#

Man what do I do

#

I am earning in this project

#

I don't understand!

slate swan
#

a db is what you need lol

cold oyster
#

This problem made me work at 9 am

cold oyster
cold oyster
#

1 guy decided to help me but he stole my code

cold oyster
slate swan
#

i ment i dont use heroku but i ment that as well wtf

slate swan
#

im speaking with my brain only

cold oyster
slate swan
green bluff
#

1 question does aiosqlite have the same syntax as sqlite

slate swan
#

my point is not to use it if youre gonna host a bot

cold oyster
slate swan
slate swan
cold oyster
#

AFK

slate swan
#

a vps lol

green bluff
#

Is aiosqlite a built in library

slate swan
green bluff
#

ah

#

What do i pip install?

slate swan
slate swan
slate swan
cold oyster
cold oyster
slate swan
#

okimii is a she lmao

#

why expose me lol

slate swan
cold oyster
#

No need to expose ;-;

cold oyster
slate swan
green bluff
#

how do u know

green bluff
#

Are u pfpist

cold oyster
green bluff
#

lmao

cold oyster
#

Her behaviour got me

slate swan
#

what about my behaviour

green bluff
#

I dont see a behaviour

slate swan
#

!rule 7 okimii is an uwu girl, now move to another channel

unkempt canyonBOT
#

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

cold oyster
sick birch
#

What's going on here

cold oyster
cosmic agate
#

guys error

    if interaction.user != self.ctx.author:
AttributeError: 'helpView' object has no attribute 'ctx'
``` and this code
```py
class helpView(View):
    @nextcord.ui.button(label="Page 1", style=nextcord.ButtonStyle.blurple)
    async def page1(self, button, interaction):
        await interaction.response.edit_message(embed=hembed)
    @nextcord.ui.button(label="Page 2", style=nextcord.ButtonStyle.blurple)
    async def page2(self, button, interaction): 
        await interaction.response.edit_message(embed=hembed2)
    @nextcord.ui.button(label="Page 3", style=nextcord.ButtonStyle.blurple)
    async def page3(self, button, interaction):
        await interaction.response.edit_message(embed=hembed3)
    @nextcord.ui.button(label="Page 4", style=nextcord.ButtonStyle.blurple)
    async def page4(self, button, interaction): 
        await interaction.response.edit_message(embed=hembed4)

        
    async def interaction_check(self, interaction) -> bool:
      if interaction.user != self.ctx.author:
        await interaction.response.send_message("bro, as the Green Goblin says, To each his own. If you want to have a look, type ?help!", ephemeral= True)
        return False 
      else:
        return True
slate swan
slate swan
hushed galleon
#

View classes arent automatically given ctx, so you need to write a custom constructor that accepts ctx as an argument

slate swan
#

^

slate swan
cosmic agate
#

ohok

cold oyster
#

Ahhh wait

#

@slate swan Do I need to use update bank function too?

cold oyster
slate swan
cold oyster
#

Like it doesn't update the baks

slate swan
slim ibex
slate swan
cold oyster
slim ibex
#

/?

cold oyster
slim ibex
#

oh ye

cold oyster
#

Ok new method

#

Oh wait

#

I am so stupid

#

I am transferring the money to someone who doesn't have an account

slate swan
slate swan
cosmic agate
#

like in the command or in the class

slate swan
#

on the command where youre sending the view

cosmic agate
#

hmm

#

error

cold oyster
cold oyster
slate swan
cosmic agate
#
    await ctx.send(embed=hembed, view=view(ctx))
TypeError: 'helpView' object is not callable
``` @slate swan
#

?????

#

whats init?

quick gust
#

I'd suggest you first learn basic OOP, would be helpful in making a discord bot

cosmic agate
#

oooo

#

hmm

slate swan
cosmic agate
cosmic agate
cosmic agate
hushed galleon
cosmic agate
#

oh ok

cosmic agate
hushed galleon
#

as for your command you're essentially writing helpView()(ctx) which doesn't make sense

cosmic agate
#
TypeError: __init__() missing 1 required positional argument: 'ctx
hushed galleon
#

the first pair of parentheses should take ctx, and the second pair shouldn't exist

cosmic agate
#

hmmm

#

so helpview should take ctx

hushed galleon
#

since helpView is the class yes

cosmic agate
#

oh ok

#

error

    if interaction.user != self.ctx.author:
AttributeError: 'helpView' object has no attribute 'ctx'
#

@hushed galleon

hushed galleon
#

you want to store that ctx

cosmic agate
#

?

hushed galleon
#

that means assigning it to self as an attribute

#

self.ctx = ctx

#

this is all OOP stuff

cosmic agate
#

so i should put this

#

as a variable or inside the class

hushed galleon
#

...?

#

inside the class as an instance attribute

cosmic agate
#

like should i put this variable into the class or outside

hushed galleon
#

well if you put it outside, then you'd have no idea who the context is for when two people use the help command

cosmic agate
#

oh ok

#

pls read my about me

hushed galleon
cosmic agate
#

hmmm ok

wicked lily
#

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

drifting arrow
#

Hey everybody. When will slash commands be forced onto python bots?

slate nymph
#
  embed.add_field(name="Server owner",value=f"**{guild.owner.name}**",inline=True)
AttributeError: 'NoneType' object has no attribute 'name'```
slate swan
#

the guild doesnt have an owner

drifting arrow
#

Chaos and anarchy

slate swan
#

lol

sick birch
drifting arrow
slate swan
unkempt canyonBOT
#

Using intents in discord.py

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

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

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

from discord import Intents
from discord.ext import commands

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

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

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

green veldt
#

WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.

formal basin
#

!d object member

#

!d class member

slate swan
slate swan
unkempt canyonBOT
#

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

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

x == y Checks if two members are equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.

x != y Checks if two members are not equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.

hash(x) Returns the member’s hash.

str(x) Returns the member’s name with the discriminator.
maiden fable
slate swan
#

Can be suppressed using debug arg in .run iirc

maiden fable
#

Yea

#

😔 Why is the channel dead

slate swan
#

Hello so I have a txt of loads of user ids that I want to have acess to bot commands what’s best way of doing it

astral hazel
#

how do I fix this Im so confused

slate swan
#

Ok thanks

astral hazel
formal basin
#

Guys how do I make an event when a member joins with the default avatar

slate swan
#
@client.event
async def on_message(ctx):


    if ctx.content.lowercase() == "4l, 4c":
      await ctx.channel.send("ok")
      await client.process_commands(ctx)

I want bot to reply in lower case

supple thorn
unkempt canyonBOT
#

await reply(content=None, **kwargs)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

A shortcut method to [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") to reply to the [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message").

New in version 1.6.

Changed in version 2.0: This function no-longer raises `InvalidArgument` instead raising [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.10)") or [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.10)") in various cases.
slate swan
#

As in I want bot to read in lowercase will the current code work

#

Also I have put 2 message contents but they aren’t working

visual island
#

in your case, ctx.content.lower()

astral hazel
#

!d help

unkempt canyonBOT
#

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

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

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

like this

formal basin
#

So when someone joins the bot checks if the member has a default pfp or a normal pfp

astral hazel
#

?

formal basin
#

e.g my pfp is not the discord logo

#

It’s a Z

astral hazel
#

are you talking about the server profile and the main profile

formal basin
slate swan
#

@naive fiber has default pfp

glass apex
#

tip for the guy who is dumb but still want to code python?

formal basin
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.

formal basin
#

Oh.

#

Could you do: the user has never changed their profile

slate swan
formal basin
#

Bruh

astral hazel
#

anyone know how to make a command to send people messages

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

and use a tuple

#

or any iterable

astral hazel
#

also why is this not working
@client.command(name="shutdown") async def shutdown(ctx): await ctx.send("Shutting Down....") db.commit() client.scheduler.shutdown() await client.logout()

#

it keep saying no attribute

slate swan
slate swan
#

Since you already defined it on 2nd line

astral hazel
#

ok

slate swan
astral hazel
#

so how do I make the error go away

#

How do you make it where you use a command and the bot dm you message cause Im thinking using await discord.user.send(' ')

honest shoal
#

!d discord.User.create_dm

unkempt canyonBOT
#

await create_dm()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Creates a [`DMChannel`](https://discordpy.readthedocs.io/en/master/api.html#discord.DMChannel "discord.DMChannel") with this user.

This should be rarely called, as this is done transparently for most people.
astral hazel
#

@honest shoal

#

create dm wasnt a variable

slate swan
#

What seems to be error

latent anchor
#

there's a error in this code

@bot.event
async def on_message(message):
      await message2.delete()
if 'hi' in message.content:
      time. sleep(0.5) 
      await message.delete()
      message2 = await message.channel.send('hello')

can anyone help me to fix it

#

the error says await is outside function

slate swan
honest shoal
honest shoal
slate swan
quick gust
slate swan
#

I think they want it so you do command it dms the author

quick gust
slate swan
#

O mb

honest shoal
quick gust
#

member also has a send attribute as cirno said

honest shoal
#

o

quick gust
slate swan
#

That’s what I said

honest shoal
#

oh, I never tried it I think

slate swan
#

It’s ok

#

Author.send works too I think

#

if ctx.content.lower() == "4l":```
I want it so if 4L is in any sentence it sends not just on its own
#

Use the python in statement

#

if "your string" in message.content:
...

#

Ok

#

@slate swan LMFAO it flooded the server with same response

#

How do I execute command after 1 response XD

#

@client.event
async def on_message(ctx):

    if "4l" in ctx.content.lower():
      await ctx.channel.send(f"hello {ctx.author.mention}")
      await client.process_commands(ctx)```
#

It spams help

modest plover
#

Hi, I have a really bad internet connection rn but uhh my bot doesn't load the icon url.
It should load said icon url but it's a black square

#
            ).set_footer(
                text = "Made by Player1041 with <3",
                icon_url = "https://imgur.com/a/JA7SnCH"
            )
supple thorn
#

Does it load the text

modest plover
#

The ).set_footer?

supple thorn
#

Yeah

modest plover
#
creditsEmbed = disnake.Embed(
            title = "Disarray - A Project by Player1041",
            description = "Disarray is a personal project created by Player1041.",
            colour = disnake.Colour.random()
            ).add_field(
                name = "Libraries",
                value = f"""Main Bot Library: [Disnake](https://github.com/DisnakeDev/disnake)"""
            ).set_footer(
                text = "Made by Player1041 with <3",
                icon_url = "https://imgur.com/a/JA7SnCH"
            )
#

Assuming you mean the ).set_footer()

supple thorn
modest plover
#

Yea

slate swan
modest plover
#

Instead of discord?

drowsy thunder
#

Is it allowed to use music beat files instead of using youtube apis or is it agains tos?

small igloo
#

this[0:len(this)] = [''.join(this[0:len[this]])] why 'builtin_function_or_method' object is not subscriptable :V

fossil cosmos
#

!e
chr(99)

unkempt canyonBOT
#

@fossil cosmos :warning: Your eval job has completed with return code 0.

[No output]
fossil cosmos
#

!e
ord(99)

unkempt canyonBOT
#

@fossil cosmos :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: ord() expected string of length 1, but int found
supple thorn
wicked lily
#

!e print("Hahaha")

unkempt canyonBOT
#

@wicked lily :white_check_mark: Your eval job has completed with return code 0.

Hahaha
wicked lily
#

!e print("Ha aha")

unkempt canyonBOT
#

@wicked lily :white_check_mark: Your eval job has completed with return code 0.

Ha aha
cunning ice
#

why is it mentioning like this ?

wicked lily
#

@cunning ice could you try using that command again

cunning ice
cunning ice
wicked lily
#

u need to use member.mention()

#

try that

cunning ice
#

ok just a sec

cunning ice
#

its showing an error

wicked lily
#

could you show the rest of the code

supple thorn
cunning ice
buoyant quail
#

not a function

#

it's property

cunning ice
#

@wicked lily

supple thorn
cunning ice
#

and i specified

member = discord.Member

wicked lily
#

you didn't assign member

supple thorn
#

Thats why

cunning ice
#

i assigned

supple thorn
#

It should be message.author.mention

wicked lily
#

that is why

supple thorn
#

Also use

cunning ice
supple thorn
#

Commands

wicked lily
#

why not try discord.Member.mention()?

buoyant quail
#

because it is not function?

wicked lily
#

ok

#

i haved used

cunning ice
supple thorn
cunning ice
#

yes

wicked lily
#

yes what

buoyant quail
#

!d discord.Member.mention

unkempt canyonBOT
supple thorn
#

Why do you keep trying giving out wrong answers

buoyant quail
#

xd

wicked lily
#

i think yuo ment

#

xp

#

xP

#

or XD

cunning ice
#

all kinda same

wicked lily
#

@cunning ice did it work

cunning ice
#

no

wicked lily
#

ok

buoyant quail
#

and member.mention

cunning ice
wicked lily
#

no he/she is mentioning the author

buoyant quail
#

it's the author

wicked lily
#

this should work

#

sorry my bad

small igloo
small igloo
buoyant quail
#

len is function

#

len(this)

small igloo
#

yes?

buoyant quail
cunning ice
small igloo
buoyant quail
#

but it would be better

#

to use commands instead of on message

cunning ice
buoyant quail
#

with that you can much easier work with single commands

supple thorn
#

🗿

small igloo
buoyant quail
#

cause make all code in one func is trash

supple thorn
#

This conversation

small igloo
buoyant quail
small igloo
small igloo
cunning ice
slate swan
#

frog_sip what even is happening here

supple thorn
#

The second one wouldn't give them what they want

supple thorn
slate swan
#

smh

small igloo
cunning ice
#

my braincells are hurting

supple thorn
#

Yes

#

As i have fucking said

small igloo
supple thorn
#

I have been ignored from the beginning

#

While 2 other people throw ideas at the question

slate swan
#

why don't you people just give the answer related to the question and not go out of the way wigglewiggle_pensive

supple thorn
#

🗿

cosmic agate
#

hey guys
how to make command so it will make a private channel?

small igloo
small igloo
supple thorn
buoyant quail
#

oh

#

i didn't understand right

small igloo
buoyant quail
#

!d discord.Guild.create_text_channel

unkempt canyonBOT
#

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

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

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

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

Note

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

and add overwrites

supple thorn
#

He ignored me

small igloo
cunning ice
#

actually me pinging one so its tq for everyone whotried

small igloo
small igloo
dull terrace
#

someone motivate me to work on bot pls

buoyant quail
#

ehh, i can't

#

i have same problem too _)

small igloo
slate swan
#

@client.event
async def on_message(ctx):
  if "4l" in ctx.content.lower():
    for i in range(1):
      await ctx.channel.send(f"hello {ctx.author.mention} i sell 4L/cs search alexlol2fast on tiktok 4c 1€ 4L 5€")


      await client.process_commands(ctx)     ```
TELL THIS MF TO STOP SPAMMING CHANNELS
slate swan
small igloo
slate swan
buoyant quail
#

commands

small igloo
slate swan
#

Ewww no

#

It’s for when messag detected

small igloo
small igloo
final iron
buoyant quail
#

it just renames variable

#

but ye

final iron
#

I'm aware

small igloo
slate swan
#

@client.event
async def on_message(message):
  if "4l" in message.content.lower():
    for i in range(1):
      await message.channel.send(f"hello {ctx.author.mention}")


      await client.process_commands(message)  ```
#

@final iron better?

final iron
#

Yes

#

You should do what salvare said

#

Your bot will just end up replying to itself

buoyant quail
small igloo
supple thorn
maiden fable
#

Gonna send the command twice

supple thorn
#

In the f-string

slate swan
supple thorn
small igloo
supple thorn
#

🗿

final iron
#

Don't do this

slate swan
#

bro

final iron
#

It will get you ratelimited

honest vessel
#

Friday joke

slate swan
#

ratelimits and the code is horrible

slate swan
#

What can I say

small igloo
#

:v

boreal ravine
slate swan
#
@client.event
async def on_message(ctx):
   # So our bot doesn't reply to itself

    if ctx.author.id == client.user.id:
        return

    if "4ls" in ctx.content.lower():
      await ctx.channel.send(f"hello {ctx.author.mention}")


      await client.process_commands(ctx)``` when i use 2  of these commands it stops working any tips
slate swan
boreal ravine
supple thorn
#

Bad naming convention

slate swan
#

y

#

im use to ctx so it doesnt to me

boreal ravine
#

here we go again with the pep8 shit

supple thorn
#

🗿

tight mica
#

on_message needs a Message, not a Context

supple thorn
#

It just confusing

#

It's like wanting to be a command

#

But it's an impostor

boreal ravine
tight mica
#

it doesnt even takes Context

#

sift u not banned yet, pog

slate swan
boreal ravine
honest shoal
#

message context lmao

slim ibex
boreal ravine
supple thorn
#

See now you're getting fun of

tight mica
supple thorn
#

This is why

supple thorn
#

🗿

slate swan
tight mica
#

yes

slate swan
#

kk

boreal ravine
supple thorn
tight mica
#

it only processes the message if it is 4ls

#

that means it just pretends to not check any other message

slate swan
ivory cave
#

@slate swan ayo did u fix the problem ?

slate swan
#
@client.event
async def on_message(ctx):
   # So our bot doesn't reply to itself

    if ctx.author.id == client.user.id:
        return

    if "4ls" in ctx.content.lower():
      await ctx.channel.send(f"hello {ctx.author.mention})
      await client.process_commands(ctx)

@client.command()
async def lol(ctx):
    await ctx.reply("lol22")``` the second command and first break when i add it
tight mica
#

you know you are missing a "

slate swan
boreal ravine
muted fable
#

Is there a way to check multiple discord servers i'm in for keywords in messages being sent, and then give those values to a discord bot i only have in my own server?

I imagine its pretty easy to do a bot that just checks keywords for a server that it's in, but could i check for the keywords with my own script and then give those values to a bot thats only in my own server

#

this is mainly just to have something to do and figure out on my own but i first want to know if its even possible

#

so basically if anyone says a certain keyword in any of the servers i choose, a bot in my own server will tell me that that word was mentioned and where

drowsy thunder
#

Help me

slate swan
#

its just installing packages

boreal ravine
left crater
slate swan
#

bruh my bot poo poo

#
@client.event
async def on_message(ctx):
   # bot reply none


    if ctx.author.id == client.user.id:
        return

    if "4ls" in ctx.content.lower():
      await ctx.channel.send(f"hello {ctx.author.mention}")


@client.command()
async def lol(ctx):
    await ctx.send("lol22")```
drowsy thunder
drowsy thunder
#

Help meee

slate swan
tight mica
tight mica
slate swan
slate swan
flat solstice
#

anyone got any examples for using dpy's webhooks? I've found this https://discordpy.readthedocs.io/en/latest/api.html?highlight=webhook#discord.AsyncWebhookAdapter, Is thi the correct way to use it?```py

services.py

# Inside my AutoShardedClient subclass
self.session = aiohttp.ClientSession(loop=self.loop)

# main.py
embed = discord.Embed(title=f"Shard {shard} Ready", colour=discord.Colour.green(), 
timestamp=datetime.datetime.utcnow(),)
weby = discord.AsyncWebhookAdapter(client.session)
request = await weby.request(verb, url=webhook_url, payload=embed, multipart=None, *, files=None, reason=None)```
tight mica
drowsy thunder
hushed galleon
tight mica
slate swan
drowsy thunder
slate swan
drowsy thunder
#

Ok

slate swan
ivory cave
#

on the other hand i finally made my dc bot able to send out emails

#

works like a charm 😻

#

💀 😭

slate swan
hushed galleon
slate swan
hushed galleon
#

preferably you avoid manipulating the adapter itself

ivory cave
slate swan
flat solstice
# slate swan https://pypi.org/project/discord-webhook/

yeah I tried that (and it mostly worked) but for some reason I couldn't get timestamps in my embeds and some colours wouldn't display correctly from a hex value and wouldn't show at all using discord.Colour.xyzeven ttho (at least from what I could see in d.py's code) the discord.Colour.xyz is supposed to return a hex value

tight mica
#

and you have to call a function

drowsy thunder
#

@slate swan

slate swan
tight mica
#

hope you know how to

slate swan
tight mica
slate swan
#

it takes a message obj so why the name

slate swan
drowsy thunder
ivory cave
#

or thats just the name of ur bot

tight mica
nova flame
#

where can i get help for use and install python?

slate swan
slate swan
drowsy thunder
ivory cave
slate swan
hushed galleon
ivory cave
#

tf ?

tight mica
tight mica
ivory cave
#

is a selfbot hard to make ?

slate swan
drowsy thunder
ivory cave
slate swan
slate swan
tight mica
ivory cave
flat solstice
slate swan
#

we cant help you with that tho

ivory cave
#

i seeee, rlly interesting tbh

slate swan
slate swan
slate swan
ivory cave
#

but i can see it being used really violently, like, in a dangerous way

tight mica
drowsy thunder
# tight mica what do you want to do with the `client` variable

Wdym I copy pasted it from google

', 'queue', 'que'])
async def play(ctx):
    guild = ctx.guild@bot.command(aliases=['paly', 'queue', 'que'])
async def play(ctx):
    guild = ctx.guild
    voice_client
    voice_client: discord.VoiceClient = discord.utils.get(bot.voice_clients, guild=guild)
    audio_source = discord.FFmpegPCMAudio('vuvuzela.mp3')
    if not voice_client.is_playing():
        voice_client.play(audio_source, after=None)
ivory cave
#

its just interesting nontheless

tight mica
#

i hope you are familier with the nitro scams, those are done by selfbots

slate swan
tight mica
flat solstice
ivory cave
tight mica
#

now we dont discuss more about it

#

you can google it more if you want

slate swan
drowsy thunder
drowsy thunder
slate swan
#

what is even happening bruh

hushed galleon
slate swan
drowsy thunder
#

Just help me in the debug!!!!!!

ivory cave
#

what is not happening

#

in this channel 😭

slate swan
#

can i tell u the bot im making isnt a bot

ivory cave
#

then what is it 😭

#

might as well announce it to the whole server 💀

slate swan
#

not maliciously

drowsy thunder
#

@slate swan help me in this error pls
Debug this code

@bot.command(aliases=['paly', 'queue', 'que'])
async def play(ctx):
    guild = ctx.guild
    voice_client: discord.VoiceClient = discord.utils.get(bot.voice_clients, guild=guild)
    audio_source = discord.FFmpegPCMAudio('vuvuzela.mp3')
    if not voice_client.is_playing():
        voice_client.play(audio_source, after=None)client: discord.VoiceClient = discord.utils.get(bot.voice_clients, guild=guild)
    audio_source = discord.FFmpegPCMAudio('vuvuzela.mp3')
    if not voice_client.is_playing():
        voice_client.play(audio_source, after=None)
ivory cave
#

💀

slate swan
#

dont care if its not malicious you stand by discords tos or you dont use the app that easy

#

ive been using them for months without knowing 💀

flat solstice
slate swan
#

i did make them

#

can you guys stop?

ivory cave
slate swan
#

like actually stop with this bs

#

Btw how can i check if a array is empty? Since the first cell is 0

slate swan
drowsy thunder
#

I tried,couldnt do it ohfuck

slate swan
#

it kinda is

drowsy thunder
#

Check the image

slate swan
#

o na

small igloo
#
@bot.command()
async def huntpet(ctx):
    name = ctx.author.id
    p = await database.check_prestige(name)
    if p >= 1:
        if name == 828182019841327115:
            z = True
        else:
            z = random.randint(1, 21) == 11
        if z:
            z = random.choices(pet_type, weights = pet_probability)
            q = pet_type_name[z]
            s = random.randint(0, len(q))
            get = random.choice(q[s])
            await database.add_pet(name, 1, get)
            await ctx.send(f"congrats! u caught a [an] {get}!")
    else:
        await ctx.send("u need at least prestige 1 to access this command :V")```

pet_type_name={
"common":["blue cat"],
"attack":["pet skeleton", "pet spider", "pet zombie"]
}

pet_type=["common", "attack"]
pet_probability=[10, 3]``` is there i did something wrong?

slate swan
slate swan
#

keep your opinions to yourself

drowsy thunder
#

May I know how

slate swan
drowsy thunder
#

No,I do

slate swan
#

no need to say to someone to stop coding because theyre a beginner?

small igloo
slate swan
slate swan
#

idc i do know it is but you dont say that to someone period.

small igloo
slate swan
drowsy thunder
small igloo
hushed galleon
drowsy thunder
#

No,There are many tutorial and the word says that
every pro was once a beginner

slate swan
small igloo
flat solstice
slate swan
#

i started dpy without even knowing python and did i end bad? no

small igloo
drowsy thunder
#

Mobile

small igloo
#

are you everyone?

slate swan
#

i can ping all generals here besides me theyll tell you the same.

small igloo
slate swan
drowsy thunder
#

Be right back

slate swan
#

dpy is an advance library yes but you dont say stop coding try to actually help and suggest them a tutorial on oop etc.

drowsy thunder
#

Brb,Ima giev link

hushed galleon
#

its like choosing your difficulty, if you are willing to tackle a large library then feel free

#

just know what you signed up for

slate swan
slate swan
#

im not?

drowsy thunder
slate swan
#

then you should think about your actions before criticizing a beginner

drowsy thunder
small igloo
#

not pinned ig

#

lol

slate swan
drowsy thunder
small igloo
drowsy thunder
#

This place

slate swan
#

hes mobile so return

small igloo
slate swan
#

not enter

drowsy thunder
small igloo
flat solstice
# slate swan i started dpy without even knowing python and did i end bad? no

I started d.py with a very basic understanding of python, didn't understand a lot of it (and subsequently pissed off a lot of ppl in the d.py server) so went away and did a codecademy course on python and then came back to dpy with a better understanding of python. there's still stuff I don't know or mix up especially in dpy as I often confuse builtin functions, classes and attributes

small igloo
slate swan
slate swan
drowsy thunder
#

Guys,so what to do basically(im on tablet)

small igloo
slate swan
small igloo
#

advertizing

drowsy thunder
muted fable
#

ive tried making 3 bots now and it never gives me a token, the first time i ever click on the bot page i get this. i can't have viewed it when i just made the bot and its the first time i've checked the page. + my backup codes dont work so i cant reset

small igloo
#

lol

slate swan
#

not very good advice when you say to someone to stop coding because they dont know enough its just not right.

small igloo
muted fable
slate swan
#

chax

small igloo
#

chax

slate swan
#

scroll up

small igloo
slate swan
#

still isnt correct more like you should learn oop so you can tackle dpy better etc

#

ConnectionRefusedError: [WinError 1225] The remote computer refused the network connection

muted fable
#

i dont know what that even means

small igloo
small igloo
slate swan
#

everyone takes a different approach to things just understand that

#

advice isnt telling someone to quit 💀

small igloo
#

👏 judge a fish by its ability to climb a tree, when they failed, ask them to stay in land, good

slate swan
#

ok

drowsy thunder
#

Shit not again

small igloo
small igloo
slate swan
small igloo
slate swan
#

is there specific age for coding?

small igloo
drowsy thunder
#

I must indent it?

slate swan
small igloo
slate swan
#

fair

unkempt canyonBOT
#

Indentation

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

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

Example

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

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

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

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

drowsy thunder
small igloo
slate swan
#

you do know others dont think the same way as you right?

flat solstice
# slate swan i skidded loads of codes tried reading getting understanding and watched yt

oh yes the 'wonders' of YT discord bot so called Tutorials. Out of the hundreds if not thousands of discord bot tutorials on YT I have only found 3 or 4 channels that (in my opinion) are actually good. Also there's loads of 'tutoials' who don't say which language they are for so you can find yourself watching a vid of JS bots even tho you searched for python discord bots

small igloo
slate swan
#

am i the only lazy one who indents by back spacing line to line above and press enter

#

just copy and paste it : )

small igloo
#

hes nitro booster btw :V if u bad at 'em they'll probably unboost this server

#

not u, @drowsy thunder

slate swan
#

same

drowsy thunder
small igloo
slate swan
#

no i mean same i aint boosting

small igloo
#

then wtf are those things lol

drowsy thunder
slate swan
small igloo
drowsy thunder
flat solstice
#

yeah that's defiantly good advice, I just like to actually have a purpose for something that I code and most into code projects are good at teaching concepts but ultimately (in my opinion) don't have a purpose once you finish that tutorial or course so I find those kinds of tutorials difficult to stick with

heavy folio
small igloo
heavy folio
slate swan
honest vessel
#

what is going on here :S

slate swan
#

i think he means guild = guild is

small igloo
drowsy thunder
#

Then what

slate swan
#

ik

#

nvm

#

if im not mistake u just copy server id and guild = sereverid @drowsy thunder

#

.

drowsy thunder
#

Ok

#

I want it public...

small igloo
slate swan
#

yes

drowsy thunder
#

Then may I get a public version?

slate swan
#

vouch

drowsy thunder
flat solstice
# unkempt canyon

indentation is the bane of my coding life, the amount of times I've had to rewrite something bc of a indentation error which I just couldn't find. take this function (t's inside a class) for example, if I have the self.start at the bottom of all the commented out sections then I get a ident error and I can't see whypy async def start_bot(self): await self.start(token) #await self.connect_redis() #await self.connect_postgres() #await self.connect_prometheus() #for extension in self.config.initial_extensions: #try: #self.load_extension(extension) #except Exception: #log.error(f"Failed to load extension {extension}.", file=sys.stderr) #log.error(traceback.print_exc())

slate swan
#

@drowsy thunder just do this on your server and click copy id

drowsy thunder
#

Be right back

sage otter
#

members

slate swan
brave moth
#

how do i make my bot auto delete a msg in a specific channel?

slate swan
#

that works too

brave moth
#

ik but it has to target specific channels

small igloo
#

wut

unkempt canyonBOT
#

get_channel(channel_id, /)```
Returns a channel with the given ID.

Note

This does *not* search for threads.

Changed in version 2.0: `channel_id` parameter is now positional-only.
brave moth
#

yes if someone says a word thats not allowed in those channels, the bot detects it then deletes it in that channel but not in other channels

#

alright, will giv it a try

#

thx it worked

#

now i can proceed to write the rest of the code

slate swan
#

ngl @slate swan is my fav member here

#

why do i always come here at wrong moments

slate swan
#

weird

light violet
#

hey i have made command btw still getting no commands found whyyyy

slate swan
#

code?

light violet
#

Ss

slate swan
#

code

flat solstice
#

So I've been following this https://discordpy.readthedocs.io/en/latest/api.html#discord.Webhook on getting a webhook to work but I seem to be getting a import errorpy Traceback (most recent call last): File "C:\Users\Teagan\Documents\Coding\Zupie\bot\main.py", line 12, in <module> from discord import Activity, app_commands, Webhook, AsyncWebhookAdapter ImportError: cannot import name 'AsyncWebhookAdapter' from 'discord' (C:\Users\Teagan\Documents\Coding\Zupie\env\lib\site-packages\discord\__init__.py)

light violet
# slate swan show command


@client.command(name = 'ss')
async def ss(ctx, site):
    embed=discord.Embed(colour = discord.Colour.orange(), timestamp=ctx.message.created_at)
    embed.set_image(url=(f"https://image.thum.io/get/width/1920/crop/675/maxAge/1/noanimate/{site}"))
    await ctx.send(embed=embed)```
#

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

slate swan
unkempt canyonBOT
#

Hey @light violet!

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

#

Hey @light violet!

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

slate swan
light violet
#

client = commands.Bot(command_prefix=commands.when_mentioned_or(">"), case_insensitive=True, intents=intents)
client.remove_command("help")
client.add_cog(Antinuke(client))
client.run(token,reconnect=True)

@client.event
async def on_ready():
print("I'm in")
print(client.user)

@client.event
async def on_command_error(ctx, error):#

  if isinstance(error, commands.MissingPermissions):
       embed=discord.Embed(description=f'{ctx.author.mention} You are missing **{"".join(error.missing_perms)}** permissions to run this command')
       await ctx.send(embed=embed)
  elif isinstance(error, commands.CommandOnCooldown):
       embed1=discord.Embed(description=f'{ctx.author.mention} You are on cooldown.Try again in {round(error.retry_after)} s')
       await ctx.send(embed=embed1)
  elif isinstance(error, commands.CommandNotFound):
       embed2=discord.Embed(description=f'{ctx.author.mention} Invalid command, do >help to see commands')
       await ctx.send(embed=embed2)
  elif isinstance(error, commands.CommandOnCooldown):
        embed3=discord.Embed(description=f"{ctx.author.mention} It seems that i am missing the **{''.join(error.missing_perms)}** ")
        await ctx.send(embed=embed3)

@client.command(name = 'ss')
async def ss(ctx, site):
embed=discord.Embed(colour = discord.Colour.orange(), timestamp=ctx.message.created_at)
embed.set_image(url=(f"https://image.thum.io/get/width/1920/crop/675/maxAge/1/noanimate/{site}"))
await ctx.send(embed=embed)

#

this is my code

slate swan
#

!paste use pastebin plez

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.

slate swan
#

@light violet it clearly says make pastebin

#

v

slate swan
slate swan
#

run creates an endless loop

flat solstice
slate swan
#

STOP USE PASTEBIN SMH

small igloo
slate swan
slate swan
slate swan
small igloo
#

why stop use pastebin :v

slate swan
#

nvm, I dont wanna start a fight lmao

#

same

#

v2

#

LOL

small igloo
small igloo
slate swan
#

what

#

bc its tired

small igloo
slate swan
small igloo
#

lol

slate swan
#

top tier

small igloo
#

LOL

slate swan
#

errors: im tired of this shit im out

small igloo
#

is emblem getting error or what? what is the pink thing

slate swan
#

boosting

unkempt canyonBOT
small igloo
slate swan
small igloo
#

u says not boosting this server :v but why the emblem shows up

small igloo
slate swan
#

cz why not

slate swan
#

since 7 april bruhh

small igloo
# slate swan

yes

  1. he says not boost this server
  2. where nitro boost role
slate swan
unkempt canyonBOT
#

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

slate swan
small igloo
#

no :V

slate swan
#

me no english

small igloo
#

lazy :D gimme motivation to move

paper sluice
#

how do u get bot-owner name?

slate swan
slate swan
slate swan
small igloo
paper sluice
#

aight

slate swan
#

#relatable

paper sluice
slate swan
paper sluice
#

i can set it as in attr right?

slate swan
paper sluice
#

like bot.owner?

#

k

slate swan