#discord-bots

1 messages · Page 845 of 1

slate swan
#

if you subclass the bot class just make a run method that connects to the db and inherits the run method from the Bot class so it only gets triggered once as you have only ran the bot once, and just run that method which runs your bot and the other method

slim ibex
#

i also have an overridden run method that loads the cogs

slate swan
#

that as well can also be done

slim ibex
#

you are saying I should move the db connection to run?

slate swan
#

no no

#
async def run(token: str) -> None:
    await connection()
    cog_setup_method()
    super().run(token, reconnect=bool)
#
async def botrun() -> None:
    await SubclassName().run("token")

if __name__ == "__main__":
    asyncio.run(botrun())
supple crescent
#

how would i make it so when the bot sees !help, it would paste text, ex: for help, contact the owner!

slate swan
slim ibex
#

all good, thanks for the help. I'll try it when I wake up tomorrow.

slate swan
#

anytime

slim ibex
#

sometimes the helpers need the help🗿

slate swan
#

😌

slate swan
supple crescent
#

oh cool thx

#

ill take a look

slate swan
#

no problem!

tidal hawk
#

Why 5 people out of 100, cant see my slash commands?

sick birch
#

so perhaps those are in a server that hasn't gotten the slash command yet

tidal hawk
#

So new members need to wait like 1 hour until they get slash commands?

sick birch
#

you mean the embed shows 1?

#

are you counting the amount of bots?

tidal hawk
#

Why can't users see slash commands in certain channels? if these are global channels, these should pop out from every channel, correct?

sick birch
#

You can just do if member.bot: count += 1 just to simplify things

#

Can we see your intents?

#

both

#

ah

#

that would explain it

#

on the ddp yeah

#

and on discord use .all() for testing

#

Can i see the updated intents?

#

and in the code?

#

!d discord.Intents

unkempt canyonBOT
#

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

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

To construct an object you can pass keyword arguments denoting the flags to enable or disable.

This is used to disable certain gateway features that are unnecessary to run your bot. To make use of this, it is passed to the `intents` keyword argument of [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client").

New in version 1.5...
sick birch
#
bot = commands.Bot(..., intents=discord.Intents.all(), ...)
#

there you are

#

🤷

#

doubtful

final iron
#

Def no

#

Why would they

slate swan
#

Obviously they do, it's just not available to the public

#

Unless you mess around with session cookies and perform tomfoolery with the help of requests

sick birch
#

Lot of bots employ the use of a private API, mine included

#

i personally find it easier to do seperation of concerns, such as have interact with a database using an api rather than messing with connectors

final iron
#

Their API is not public

#

A wrapper is just something that makes it easier to work with an api

#

If an API isn't public there will not be a wrapper

#

Link me that

slate swan
#

Yikes is that even allowed?

#

Then don't do it.

final iron
#

I don't see any trickery going on in the package

#

I don't see why it wouldn't be allowed

#

Mee6's website is mee6.xyz right

#

So they do have a public api

sick birch
#

i don't think they do but perhaps someone managed to find the endpoints?

slate swan
#

Their API is not public.

sick birch
#

yet there are these "wrappers"? curious

final iron
#

I'm looking at the GitHub right now

slate swan
#

GitHub for the...?

leaden dragon
final iron
#

What tells you the API isn't public

slate swan
#

Exactly, the wrapper. Please point me to where the API is publicly documented and the usage of it is encouraged.

final iron
#

Just because the API isn't documented doesnt mean it's not public

#

If it wasnt public they would require some sort of verification header

slate swan
#

That's not hard to figure out, you can just head over to /levels/... and check Network tab

leaden dragon
slate swan
#

How is that so hard to understand?

final iron
#

Because if it was meant to be private they would require some sort of verification

#

It's quite simple

sick birch
#

I mean it's undocumented and they haven't said they even have one so yeah it's not really public

slate swan
final iron
#

If they didn't want it to be used they would just add a verification header. Extremely simple

slate swan
#

This isn't an argument, you don't need to defend your claims.

final iron
#

I'm seeing it as such

slate swan
#

Then I'm not continuing this conversation.

sick birch
#

at least that's what i'm gathering from looking at these wrappers

final iron
#

Maybe they just don't want a lot of traffic

slate swan
#

Especially on mobile.

final iron
#

How about someone just contacts them

leaden dragon
#

😔

stiff anvil
#

Is there a way to turn on 2 bots, With one python file?

#

And how do I print {client} is now online

#

And instead of client, It should show the bot name

#

anyone?

#

ping me please...

sick birch
#

you're looking for on_ready

stiff anvil
sage otter
stiff anvil
#

Is it hard? And are you sure it's gonna work on discord bots?

#

I'm tryna cheat my Hosting Service and run 2 bots at the same timey

upbeat vigil
#

hey, my bot wont start and i dont understand the console error

sage otter
#

The concept itself isn’t that complex but I’ve used it before to start multiple processes at the same time and it works fine. I wouldn’t imagine it being different with discord bots since they're basically processes.

upbeat vigil
#

oh

upbeat vigil
stiff anvil
alpine furnace
#

And then gather them at the end, when you want to block

stiff anvil
#

I've never used asyncios

upbeat vigil
alpine furnace
#

Well, you should learn it, because the library you are using is async-enabled 😃

alpine furnace
#

Np

stiff anvil
#

with full screen please

#

or just copy it and send it as a code block

#

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

upbeat vigil
#

oh sorry

stiff anvil
#

no?

#

Send it...

upbeat vigil
#
--> python3 -m poetry add discord humanize imutils opencv-python aiohttp replit scikit-image portolan flask html2text art psutil
Using version ^1.7.3 for discord
Using version ^4.0.0 for humanize
Using version ^0.5.4 for imutils
Using version ^4.5.5 for opencv-python
Using version ^3.8.1 for aiohttp
Using version ^3.2.4 for replit
Using version ^0.19.2 for scikit-image
Using version ^1.0.1 for portolan
Using version ^2.0.3 for Flask
Using version ^2020.1.16 for html2text
Using version ^5.4 for art
Using version ^5.9.0 for psutil

Updating dependencies
Resolving dependencies...

  SolverProblemError

  Because no versions of discord match >1.7.3,<2.0.0
   and discord (1.7.3) depends on discord.py (>=1.7.3), discord (>=1.7.3,<2.0.0) requires discord.py (>=1.7.3).
  Because discord.py (1.7.3) depends on aiohttp (>=3.6.0,<3.8.0)
   and no versions of discord.py match >1.7.3, discord.py (>=1.7.3) requires aiohttp (>=3.6.0,<3.8.0).
  Thus, discord (>=1.7.3,<2.0.0) requires aiohttp (>=3.6.0,<3.8.0).
  So, because python-template depends on both discord (^1.7.3) and aiohttp (^3.8.1), version solving failed.

  at venv/lib/python3.8/site-packages/poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│ 
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes
/home/runner/SOL/venv/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
exit status 1```
stiff anvil
#

ty

slate swan
#

@stiff anvil why do you want to run it with one python file?

stiff anvil
#

do you have a requirements.txt ?

upbeat vigil
#

i do not

stiff anvil
stiff anvil
final iron
#

So apparently the MEE6 endpoints are not for public use and apparently there is a verification system

alpine furnace
stiff anvil
slate swan
#

That's a pretty terrible solution.

stiff anvil
upbeat vigil
slate swan
#

@stiff anvil You should run each process as a daemon with a process manager, try out pm2

alpine furnace
#

Oh, I see, I recently found a deal for a 90c per month 768mb vps but you have to pay yearly

#

Infinitely better than random services

#

And what's up @slate swan

stiff anvil
slate swan
stiff anvil
#

idk, I just do it everytime

slate swan
#

They're the same thing..

final iron
#

Can you make requests with the python bot?

stiff anvil
#

yeah, I just do it

slate swan
stiff anvil
slate swan
#

or really any asynchronous library of your choice

slate swan
#

What do you mean "with the bot"?

slate swan
#

Oh

#

My bad

final iron
#

I don't have access to my computer and I'm too lazy to make a repl.it account

slate swan
#

Don't you guys add Jishaku to your bots

final iron
#

I don't develop bots anymore

slate swan
#

ah

#

I don't understand people that use Jishaku, just code your own Cog

stiff anvil
#

How do I print {client} is now online? So it shows the bot's name

final iron
#

Has a ton of useful features apparently

slate swan
#

client.user.name (might also want to include client.user.discriminator)

stiff anvil
#

ty :)

slate swan
#

Pep nightmare

alpine furnace
final iron
#

I'll verify if mee6's endpoints actually have a verification system tomorrow

slate swan
#

They do

final iron
#

You tested it?

slate swan
#

I checked, you need some form of authentication (Probably a session cookie)

#

That's poetry

alpine furnace
#

Well, shit

#

I usually just fork it if it's on github, change the dependencies and then pull from that

stiff anvil
#

@upbeat vigil is it working?

final iron
#

So do all the wrappers just not work?

slate swan
#

Probably not anymore, though that's just from what I know.

slate swan
stiff anvil
#

Any challengers?

slate swan
stiff anvil
slate swan
#

Literally all of that is simple Python.

slate swan
stiff anvil
alpine furnace
stiff anvil
slate swan
#

No, the library returns them to you in seconds

stiff anvil
#
@client.command()
async def ping(ctx):
    await ctx.send(f'Pong! I response in {round(client.latency, 2)} milliseconds!')
    

So this whole time I've been thinking I was cool?

#

fuck man

alpine furnace
stiff anvil
#

:"(

#

?take_an_easy_way_out << GTA

slate swan
alpine furnace
#

Hey, 30ms ping isn't bad either way

stiff anvil
slate swan
#

True,on replit

stiff anvil
#

!ping

unkempt canyonBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

slate swan
#

But not a Python beginner, for sure.

#

Um

stiff anvil
#

That's sad

slate swan
#

I didn't mean as a python developer, someone who just began with discord.py library

alpine furnace
#

Come on, when you waste hours upon hours on Discord every day, 100ms isn't much kekw

stiff anvil
#

30ms is cooler tho :)

slate swan
#

Replit is bad lol

#

very weak machines

stiff anvil
#

It's free, That's why...

alpine furnace
#

I mean, they're on datacenters, so their networking is very strong either way

slate swan
#

As for the python bot . The bot is already dealing with like 2-3 eval and more than 10 commands per second in a server with 315k members, so more than the latency things like cache and memory matters

stiff anvil
#

!eval

unkempt canyonBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

stiff anvil
#

!evel print("I'm gae")

#

?

slate swan
#

evel huh?

stiff anvil
#

!evel print("Im gae")

#

!eval print("Im gae")

unkempt canyonBOT
#

@stiff anvil :white_check_mark: Your eval job has completed with return code 0.

Im gae
slate swan
#

eval

stiff anvil
#

oh

#

i'm blind, It's okay

slate swan
# slate swan Custom evals , debugging, the eval hides your token automatically, helpful with ...

A custom eval is as simple as doing eval() on some greedy string command argument with a bit of magic using the io module to capture stdout
Eval hiding your token automatically... I mean just use ''.replace(bot.http.token, '') and that's good enough.
Terminal commands.. Just use subprocess.run()
Source command is simple too, just use inspect.getsourcelines() and then create a link to GitHub page with line highlighting

slate swan
hasty axle
#

hey guys so i want to make a command that takes the args in replies. Whenever someone calls the command the bot says smth and whatever the person says next is taken as an arg. Any idea how that can be done?

calm temple
slate swan
#

Not sure why you would want to do that

#

!d discord.Client.wait_for

unkempt canyonBOT
#

wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
slate swan
#

use this to wait for a message

stiff anvil
#

How can I make an uptime command

#

I searched google and none of them work

vocal snow
#

you can use time.time/perf_counter if you just want it in seconds, otherwise check out the datetime package

slate swan
#

what option type i should use here?

stiff anvil
#
@client.command()
async def uptime(ctx):
    uptime = starttime - datetime.datetime.now()
    await ctx.send(uptime)
#
@client.event
async def on_ready():
    global starttime
    starttime = datetime.datetime.now()
#
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'starttime' is not defined

I get this error

#

@vocal snow

vocal snow
stiff anvil
#

and?

vocal snow
#

?

#

and use it?

stiff anvil
#

okay wait

#
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/container/setup.py", line 29, in uptime
    uptime = starttime - datetime.datetime.now()
NameError: name 'starttime' is not defined
#

should I add client.starttime here too?

#

@vocal snow

#

'Bot' object has no attribute 'starttime'

#

urgh

vocal snow
#

that means that the command is being invoked before the on_ready callback

stiff anvil
#

How do I fix it?

vocal snow
#

set client.starttime somewhere else i guess

stiff anvil
#

okay...

royal oar
#

Can Someone pls help me? When i use this code here right it shows the status of those using spotify what song and what not but the code is only working for certain people and not all people when they are not using spotify the only to work was the try and except. But that doesnt work for everyone.

    @commands.command()
    async def spotify(self, ctx, user:nextcord.Member = None):
        try:
            if user == None:
                user = ctx.author
                pass
            if user.activities:
                for activity in user.activities:
                    if isinstance(activity, Spotify):
                        embed = nextcord.Embed(title = f"{user.name}'s Spotify", description = "Listening to {}".format(activity.title), color = 0xC902FF)
                        embed.set_thumbnail(url=activity.album_cover_url)
                        embed.add_field(name="Artist", value=activity.artist)
                        embed.add_field(name="Album", value=activity.album)
                        embed.set_footer(text="Song started at {}".format(activity.created_at.strftime("%H:%M")))
                        await ctx.send(embed=embed)
                        return
                    if user.activity is not Spotify:
                        await ctx.send("Hello")
                    if user.mention.activity is not Spotify:
                        await ctx.send("Hello")
        except:
            em = nextcord.Embed(title = f"{user.name} isnt using spotify thou?", description = "They are currently using a different application <3", color = 0xC902FF)
            await ctx.send(embed=em)
            return

It may look like its not indented properly but it is.
the suppose output is meant to be:
https://gyazo.com/d75959b7de37a17383170eee27569798

slate swan
#

Make sure you have presence intents

#

I changed the hex color to an int but it didnt work, i dont know y

#

oh , that just doesn't work as expected

royal oar
#

It has all intents enabled

slate swan
#

That would be faster, and easier to handle

slate swan
#

Instead of a try/expect

vivid marsh
#
@commands.command(aliases=['Ban'])
    @commands.has_permissions(ban_members=True, administrator=True)
    async def ban(self, ctx, member: discord.Member, *, reason=None):
        if reason==None:
            reason="No reason provided"
        await ctx.guild.ban(member)
        await ctx.send(f'{member.mention} has been Banned from the server for: {reason}')
        if self.user.dm_channel == None:
            await self.user.create_dm()
            await self.user.dm_channel.send(
            content=f"You have been banned from {ctx.guild} by {ctx.message.author}\nReason: {reason} ")```

For some reason it’s not dming the user when they are banned am I missing something?
slate swan
#

Send the message first

#

Then ban the user

vivid marsh
vivid marsh
slate swan
#

What's the error

#

Ah

slate swan
#

Move your last sentence outside the if

#

And you an just await user.send

slate swan
#

Also, it's not self.user

vivid marsh
#

Is it not correct with self?

slate swan
#

No

vivid marsh
#

If I keep it as just user I get the user is not defined so would it be ctx.user?

slate swan
#

Why do you use user when in the function you have a member?

vivid marsh
#

Would it work if member i thought it would be like the member who made the action? And the user affected

#

I got it fixed thanks

small igloo
#

ok, is there any way to make my bot shows all the commands cooldown at once

heavy harbor
#

Guys I need

#

Help

#

Can you tell the basic code for a discord bot

#

Pls

heavy harbor
#

I just started coding a discord bot

#

so I need help

small igloo
heavy harbor
#

Oh ok

#

I'm actually new to coding discord bots

small igloo
heavy harbor
#

So I want the basic code to make it coem

#

Online

small igloo
#

1st tip: dont use replit

heavy harbor
#

Idk what's that

small igloo
#

better not know

heavy harbor
#

Why

small igloo
#
  1. it suck
  2. fking visible to everyone with ur link
heavy harbor
#

Oh ok

#

Just tell the basic code please

umbral night
#

is it possible to make a bot add a slowmode to a channel that is less than 5 seconds?

#

or is 5 seconds the lowest.

small igloo
small igloo
# heavy harbor Just tell the basic code please

import discord
from discord.ext import commands
bot = commands.Bot(command_prefix="prefix", help_command=None, case_insensitive=True)
@bot.command()
async def ping(ctx):
await ctx.send("pong")
bot.run("token")

heavy harbor
#

Oh ok thanks

small igloo
#

ok, np

placid skiff
small igloo
placid skiff
#

if you go to the github of the package you can find a lot of examples

placid skiff
small igloo
placid skiff
#

all the commands that are in cooldown?

small igloo
placid skiff
#

mhh

#

slash commands or normal commands?

small igloo
placid skiff
#

ok

rancid stump
#

how do i send a embedd text using discord bot ???

like text with image ?

placid skiff
umbral night
small igloo
small igloo
placid skiff
#

you have to get the list of your commands doing bot.commands)

umbral night
#

but i'd like to set it to one second

#

just to make sure noone can spam

small igloo
rancid stump
placid skiff
#

commands has a parameter to check if a command has a cooldown, which is command.cooldown_after_parsing

placid skiff
#

then you can use the method get_cooldown_retry_after which requires the context as argument to get the time remaining before the command can be invoked again

placid skiff
#

well there are many, you want to make something like an help menu?

small igloo
placid skiff
#

then you can try something like this:

async def get_cooldown(ctx: Context):
  message = ""
  for command in bot.commands:
    if command.cooldown_after_parsing:
      message += f"times before invoking {command.name}: {command.get_cooldown_retry_after()}\n"
  await ctx.send(message)
#

get_cooldown_retry_after return a float, probably is the time remains in seconds

#

and maybe you have to check if that value is greater than 0 too before adding it to the message

small igloo
#

ok, wait

small igloo
placid skiff
#

probably no commands are in cooldown

small igloo
maiden fable
#

Why doing this

#

Just do if command.get_cooldown_retry_after():

small igloo
#

doing what

placid skiff
small igloo
placid skiff
#

What bucket type has the cooldown?

small igloo
placid skiff
#

copy the @vale junco decorator function

small igloo
small igloo
placid skiff
#

lol it is written too, try to set it to None

small igloo
umbral night
small igloo
umbral night
#

no?

#

it doesnt have an option for 1 second.

small igloo
placid skiff
umbral night
small igloo
small igloo
umbral night
#

i thought u knew what u were doing

placid skiff
#

Nope, BucketType.default

small igloo
small igloo
placid skiff
#

wait you are not sending the ctx as the argument of the get_cooldown_retry_after

#

i even said to you that it needs the context as argument

small igloo
#

???

placid skiff
#

do you know what the context is?

small igloo
placid skiff
#

yes, get_cooldown_retry_after needs it as argument

placid skiff
#

you have to import context

#

D_D

small igloo
#

b r u h, ok

small igloo
placid skiff
#

it is in the commands folder, so..?

small igloo
placid skiff
#

yup

#

with C capital

small igloo
#

ok :V

small igloo
placid skiff
#

you have to PASS the CONTEXT in the get_cooldown_retry_after() method

placid skiff
#

ctx is your context .-.

small igloo
#

oh ok

small igloo
# placid skiff ctx is your context .-.
@bot.command()
async def get_cooldown(ctx : Context):
    message = ""
    for command in bot.commands:
        if command.cooldown_after_parsing:
            message += f"times before invoking {command.name}: {command.get_cooldown_retry_after(ctx)}\n"
    await ctx.send(message)```

still cant send empty message error and ukr that i alr use dat farm command
placid skiff
#

what?

small igloo
# placid skiff what?

still HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message error

placid skiff
#

print bot.commands in the console

small igloo
small igloo
placid skiff
#

send me where you declared the bot

small igloo
small igloo
small igloo
placid skiff
#

...

unkempt canyonBOT
#

Hey @small igloo!

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

small igloo
honest vessel
#

@small igloodont u want is_on_cooldown?

honest vessel
#

you gonna check if you have any cooldowns right?

small igloo
honest vessel
#

oh not the actual users cooldown

small igloo
placid skiff
small igloo
placid skiff
#

i need it to work 😄

supple thorn
small igloo
# placid skiff i need it to work 😄

ok, just examples
{<discord.ext.commands.core.Command object at 0x000001EC3CFA7820>, <discord.ext.commands.core.Command object at 0x000001EC3A918070>}

small igloo
small igloo
heavy folio
#

list comprehension

placid skiff
# supple thorn Why

cuz to join some pages of the docs of my company i need the company vpn and my credentials

heavy folio
#

[c.name for c in bot.commands] or whatever attribute you wanna use @small igloo

honest vessel
#

@small iglooi can tell your code dosnt show anything with cooldowns

honest vessel
#

uptime #commandname
False #bool-> command.cooldown_after_parsing
0.0 #how much time till command can be used again
this is what you checking

heavy folio
#

i dont think you can get the cooldown of a command

honest vessel
#
    async def testing(self, ctx):
        for command in self.bot.commands:
            print(command)
            print(command.cooldown_after_parsing)
            print(command.get_cooldown_retry_after(ctx))```
quasi stag
#

my bot has 2 commands, createbackup and applybackup, createbackup basically gets every channel and role and compiles them into a single file. and applybackup it takes the file the user uploaded and reads it. now my problem is to convert my key "type" thats a string into a channeltype object. how do i do that

honest vessel
honest vessel
heavy folio
quasi stag
hoary cargo
honest vessel
#

well to make string to channelobject should be selfdescribed

quasi stag
honest vessel
#

thats just a string of the channels name

quasi stag
#

smartass

honest vessel
#

but you said u didnt want strings and actual objects

placid skiff
#

when you need to convert a discord object from a raw data type (python builtin types) then the best way is to use the id of the object

quasi stag
#

yes?

honest vessel
quasi stag
placid skiff
#

it returns None

#

cuz the bot can't find it

honest vessel
#

you can just get the channelobjects from the guild

quasi stag
placid skiff
honest vessel
#

show how far you came with your backup functin

quasi stag
#

maybe try reading the message i sent?

placid skiff
#

btw you can't get the istance of an object which doesn't exists anymore

#

you have to recreate that object from the data that you have

honest vessel
#

yeah u will need to save permissions n all, and then create new channel with them permissions

rain olive
honest vessel
#

you cant just copy objects

placid skiff
#

when they doesn't exists .-.

rain olive
#

thats the name of the type of channel

quasi stag
placid skiff
#

then what is your problem? D_D

unkempt canyonBOT
#

Hey @quasi stag!

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

quasi stag
#

br

honest vessel
quasi stag
placid skiff
#

i can't open paste bin .-.

heavy harbor
#

I need help again

quasi stag
heavy harbor
#

Why am I getting this error

quasi stag
#

its discord.Client()

heavy harbor
#

Oh ok

#

It's case sensitive

#

?

quasi stag
#

yes

placid skiff
#

of course .-.

heavy harbor
#

Oh ok thanks guys

placid skiff
#

everything you code is case sensitive

quasi stag
#

please learn that functions like abc() and Abc() are not the same

heavy harbor
#

Oh ok

quasi stag
#

and what does that return?

north whale
quasi stag
#

exactly

honest vessel
quasi stag
#

i would have to do getattr(discord.channeltype, "news") == discord.channeltype.news like 8 times

north whale
#

you use it to convert the string back into a channel type

#

then compare that channel type to the other channel types

quasi stag
#

and?

north whale
#

or just use the string and don't bother with channel types

quasi stag
#

how do i create a channel using a channeltype argument

north whale
#

you can't

#

do you have a different idea

quasi stag
#

you cant just do await ctx.create.channeltype.channel

honest vessel
#

you can make your own dict

quasi stag
#

what?

north whale
#

I also recommended this earlier

placid skiff
honest vessel
#

t = {"text": Guild.create_text_channel()} etc maybe

north whale
honest vessel
#

something that aproach

placid skiff
north whale
#

pretty sure ChannelType has the text attribute no matter what

quasi stag
placid skiff
#

yes but he will not have the argument of that attrivute

north whale
#

are you high

north whale
#

t[thing](...)

placid skiff
quasi stag
#

cool

#
bot.channels = {
    "text": 
}
north whale
#

your dict would look something like

{
    "text": guild.create_text_channel,
    "voice": guild.create_voice_channel,
    ...
}
quasi stag
#

already stuck

#

how do i get the guild bro

north whale
honest vessel
#
t = {"text": ctx.guild.create_text_channel, "voice": ctx.guild.create_voice_channel}
test = "voice"
await t[test](name="test")
``` something like this
quasi stag
#

breh

north whale
#

and access guild from the context

quasi stag
#

okay ill try

heavy harbor
#

So uh is it problem with a script that I'm facing a issue of my code not running

north whale
#

you leaked your token

#

reset it

quasi stag
#

lmao

#

youre

honest vessel
#

free token! ducky_party

quasi stag
#

coding in mobile!??!!?

north whale
#

anyways client.run shouldn't be indented

quasi stag
#

yoo it worked!

#

thanks guys

slate swan
#

:)

placid skiff
#

lol

quasi stag
#

why tho

north whale
#

large amount of channels might not end well with discord

quasi stag
#

why would i try to ratelimit?

#

oh

honest vessel
quasi stag
#

where?

north whale
#

that was a different person

slate swan
#

oh lol

#

nvm

quasi stag
#

shes dumb

slate swan
#

indeed

north whale
#

the whole last 3 characters are hidden

honest vessel
#

#saved

slate swan
#

lol

north whale
#

wake up

quasi stag
#

okay i just realized i would need to place the channels in the correct categories and permissions

slate swan
quasi stag
#

ill work in this later

north whale
quasi stag
#

you didnt mention how slow bots logging in

north whale
#

doesn't take that long to test a bot token

honest vessel
#

when you invite bot with permission code like 8 for admin or what it is but lets say u skip "can cfreate channels" can u edit permissions inside server for bot so that he can create_channels?

quasi stag
#

i would say like 20 channels

honest vessel
#

or u need to reinvite bot with correct permissions

quasi stag
#

admin overrides every permission

north whale
honest vessel
#

i have given bot all rights still cant create a channel

#

permissions missing

north whale
#

give it administrator permissions and see what happens

quasi stag
#

give it manage channels

honest vessel
#

it has all i just said 😄

quasi stag
#

discord issue

north whale
#

if it still doesn't work it might be something to do with creating permission overwrites for a higher role

honest vessel
#

wait

#

i think i looked at wrong bot

#

too early in morning 😄 my bad ignore me

quasi stag
#

will my memory give up if i cache it with like

#

a thousand channels

slate swan
#

any idea abt this error? py Traceback (most recent call last): File "C:\Users\Saad\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke await ctx.command.invoke(ctx) File "C:\Users\Saad\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke await injected(*ctx.args, **ctx.kwargs) File "C:\Users\Saad\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In embed.fields.1.value: Must be 1024 or fewer in length. Ignoring exception in command c: Traceback (most recent call last): File "C:\Users\Saad\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped ret = await coro(*args, **kwargs) File "c:\Users\Saad\Desktop\Files\tst.py", line 39, in c await ctx.send(embed=em) File "C:\Users\Saad\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\abc.py", line 1065, in send data = await state.http.send_message(channel.id, content, tts=tts, embed=embed, File "C:\Users\Saad\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 254, in request raise HTTPException(r, data) discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In embed.fields.1.value: Must be 1024 or fewer in length.

honest vessel
#

In embed.fields.1.value: Must be 1024 or fewer in length.

maiden fable
#

The value of the second field

#

It's longer than 1024 chars

slate swan
#

ty

honest vessel
#

selfexplained errors 🙂

slate swan
honest vessel
#

read errors from below to top ^^

slate swan
#

tnx for the advice ^^

honest vessel
#

@slate swan i want an advanced bot 😛

slate swan
honest vessel
#

can be a reaction

slate swan
honest vessel
#

docs wait_for(event, *, check=None, timeout=None

slate swan
#

the "message" event

honest vessel
#

it can be a reaction i said 😄

slate swan
honest vessel
#
@client.event
async def on_message(message):
    if message.content.startswith('$thumb'):
        channel = message.channel
        await channel.send('Send me that 👍 reaction, mate')

        def check(reaction, user):
            return user == message.author and str(reaction.emoji) == '👍'

        try:
            reaction, user = await client.wait_for('reaction_add', timeout=60.0, check=check)
        except asyncio.TimeoutError:
            await channel.send('👎')
        else:
            await channel.send('👍')
slate swan
#

nvm imma just try it without the message intent

honest vessel
#

yes

#

you can have it in a command

slate swan
#

does it require the message intent?

honest vessel
#

no

visual island
slate swan
honest vessel
#

reaction, user = await client.wait_for('reaction_add', timeout=60.0, check=check)

#

as u see here no message needed

slate swan
#

im lost-

honest vessel
#

ok np

slate swan
hasty axle
#

can someone tell me how i can get member id using discord.py??

maiden fable
unkempt canyonBOT
#

property id```
Equivalent to [`User.id`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.id "discord.User.id")
boreal ravine
maiden fable
boreal ravine
heavy folio
hoary cargo
strong vessel
#

do discord bot users get banned easily? like i'm wondering what is the risk involved of making a bot and then getting banned from discord for example because of trolls. do i have to make it so the user that supports the bot is separate so that the bot owner is a secret just to avoid getting banned or something like that?

honest vessel
#

@boreal ravine for ext in os.listdir("./cogs"): self.load_extension(f"cogs.{ext.replace('.py', '')}")

#

wat if a file gets there that has maybe .txt

strong vessel
honest vessel
#

n u dont check if even failed or successed load cog

#

@strong vessel code ur bot well

#

n use alot of decorations n cooldowns

strong vessel
#

nvm i guess its unavoidable

boreal ravine
boreal ravine
boreal ravine
slim ibex
#

sqlite

boreal ravine
slim ibex
#

lmao i just got here

#

idk what happened before🗿

slate swan
tacit token
#

guys mongodb vs json?

slim ibex
#

MongoDB any fucking day

#

Pls don’t use json as a database

tacit token
slim ibex
#

?

tacit token
#

I need someone to show me how to handle channels and prefixes because it went in json, but I want to switch to a regular database.

slim ibex
#

use SQLite because Mongo is relatively hard

heavy folio
#

please, dont use json at all

slim ibex
#

^

#

unless you are serializing API data

heavy folio
#

mongo is not recommended for discord bots

tacit token
#

And someone can help me? not here, but privately with sqlite

tacit token
#

I want to save channels and prefixes in it.

vocal snow
tacit token
#

but i need normal database

shut axle
#

What should I type in my code: client.run(???)
If I saved my token in Heroku as TOKEN. ??????????????

tacit token
#

someone help me switch to sqlite? I still have one of these commands and a prefix.

slim ibex
shut axle
#

Why?

slim ibex
#

it’s made for web services

shut axle
#

But can you help me?

slim ibex
#

it’s probably in your environment variables somewhere

shut axle
#

I got you, but I wanna know what should I type in client.run. Because I saved my token as TOKEN

slim ibex
#

os.getenv(“TOKEN”)?

tacit token
#

so anybody? everybody say use sqllite but if i try nobody help

native wedge
shut axle
tacit token
slim ibex
#

you have to use the sqlite3 module or aiosqlite

tacit token
#

I would like my bot (about 10,000) on a lot of servers which database do you recommend? report system & log system & welcomerre should be the database.

slim ibex
#

SQLite can hold a lot so you should be fine

#

but you prolly shouldn’t have a table for each guild

tacit token
#

ok thanks

honest vessel
#

@strong vesseland uhm yeah owner of bot got permbanned not the bot itself

#

he probally did something against ToS and stupid he was used bot owner account

jovial cave
#

is there something wrong with my code? help me?

slim ibex
#

uhh the fuck

#

why are you doing everything in on_ready

fresh iron
#

is user.guilds a thing

slim ibex
#

And that’s not how if name main is used

jovial cave
#

ops my bot token

slim ibex
#

yeah LMAO

native wedge
#

Put it atleast in an ENV or something

fresh iron
#

is this a valid thing

jovial cave
#

yes so how do i fix it

fresh iron
#

user.guilds

slim ibex
#

!d discord.ext.commands.Bot.guilds

unkempt canyonBOT
slim ibex
#

but user does have a mutual_guilds property

#

!d discord.User.mutual_guilds

unkempt canyonBOT
#

property mutual_guilds: List[Guild]```
The guilds that the user shares with the client.

Note

This will only return mutual guilds within the client’s internal cache.

New in version 1.7.
jovial cave
#

like this or what?

#

sorry if i'm stupid

slim ibex
#

That wasn’t for you…

#

He was asking a question about his code

jovial cave
#

ohhh sorry, means how do I fix it

#

don't mix the code?

fresh iron
slim ibex
#

!d discord.Client.event

unkempt canyonBOT
#

@event```
A decorator that registers an event to listen to.

You can find more info about the events on the [documentation below](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events).

The events must be a [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine "(in Python v3.9)"), if not, [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.9)") is raised.

Example

```py
@client.event
async def on_ready():
    print('Ready!')
slate swan
#

How do I listen for commands in DMs

slim ibex
#

wdym listen for

#

Commands should work in dms unless they have a @guild_only() decorator

fresh iron
#

my code is literally the example and it still gives the same error

boreal ravine
#

read your code

slim ibex
#

show the code

boreal ravine
#

and read what the command says

fresh iron
boreal ravine
#

god

fresh iron
slim ibex
#

oh shit bro

#

oh shitty shit

stone beacon
#

🤣 lmao

#

Use discord.ext.commands.Bot m8

slim ibex
#

first off, use commands.Bot not client

#

!d discord.ext.commands.Bot

unkempt canyonBOT
#

class discord.ext.commands.Bot(command_prefix, help_command=<default-help-command>, description=None, **options)```
Represents a discord bot.

This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") you can do with this bot.

This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
swift imp
#

Says command not foundpe @bot.command(aliases = ["help", "pleh"]) async def test(ctx): await ctx.send("Test help")

fresh iron
stone beacon
#
from discord.ext.commmands import Bot

bot = Bot(command_prefix=?,etc..)

@bot.event
async def on_ready():
  pass
#

It's been months since I've used a msg command ngl

thin kelp
#

🗿

hoary cargo
jovial cave
#

@slim ibex Finally i can

slim ibex
#

?

silent ermine
slim ibex
#

abstract base class

#

some of the classes derive from abs

#

!d discord.abc.User

unkempt canyonBOT
#

class discord.abc.User```
An ABC that details the common operations on a Discord user.

The following implement this ABC:

• [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User")

• [`ClientUser`](https://discordpy.readthedocs.io/en/master/api.html#discord.ClientUser "discord.ClientUser")

• [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member")...
silent ermine
slim ibex
#

doesn’t matter, what’s the code that raises it

#

ABCs are base classes that define members that must be implemented by classes that derive from it

slate swan
maiden fable
#

!d exit

unkempt canyonBOT
#

quit(code=None)``````py

exit(code=None)```
Objects that when printed, print a message like “Use quit() or Ctrl-D (i.e. EOF) to exit”, and when called, raise [`SystemExit`](https://docs.python.org/3/library/exceptions.html#SystemExit "SystemExit") with the specified exit code.
maiden fable
#

Sorry not sorry

slim ibex
#

hunter 🗿

maiden fable
#

Hm?

silent ermine
pliant gulch
#

It's seems you have done pip install typing or something

#

Uninstall it and it should be fine?

maiden fable
#

Wait what?

#

!pypi typing

unkempt canyonBOT
maiden fable
#

Tf???

#

()

jagged root
#

How can i get user that was mentioned in a embed

maiden fable
#

U forgot to call it

pliant gulch
maiden fable
#

It's a method

pliant gulch
#

Same with asyncio

pliant gulch
unkempt canyonBOT
maiden fable
pliant gulch
#

Some people still use python2 ¯_(ツ)_/¯

slim ibex
jagged root
#

How can i get user that was mentioned in a embed please help

maiden fable
#

get_friends_count()

unkempt canyonBOT
maiden fable
#

Ah

maiden fable
#

Bruhhh

#

Just call that. It's a method

manic wing
#

bro

#

literally tells you what to do in the error

maiden fable
#

I'm out

manic wing
#

it could not be more clear

jagged root
#

How can i get user that was mentioned in a embed please help

manic wing
#

do you want them to stick a massive youtube tutorial saying exactly what to do?

slim ibex
#

bro

manic wing
slim ibex
#

@slate swan the error tells you to add await

maiden fable
unkempt canyonBOT
maiden fable
#

!d discord.Embed.description

unkempt canyonBOT
maiden fable
#

And then, u gotta use regex or smth

manic wing
#

you would have to check each part of the embed

jagged root
#

hm

slate swan
#

😔 you can just if user.mention in description

jagged root
#

i mean

#

i just want to get user that was mentioned on a command

maiden fable
#

Sarthak 👀

jagged root
#

and then put it ona embed

slate swan
manic wing
slate swan
slate swan
manic wing
#

mhm

unkempt canyonBOT
#

discord/member.py lines 489 to 494

@property
def mention(self) -> str:
    """:class:`​str`​: Returns a string that allows you to mention the member."""
    if self.nick:
        return f'<@!{self._user.id}>'
    return f'<@{self._user.id}>'```
manic wing
#

but

#

what if the user has a nick and they use the non-nick version to mention pithink

slate swan
#

the api always returns the correct mention type, i moment

fresh iron
#

so im trying to list a specific guild members but idk how to do that properly

slim ibex
#

why in on connect?

manic wing
#

on_connect doesnt pass guild

slim ibex
#

on connect takes in reconnect param

manic wing
#

idk wtf you're trying to conjure

slim ibex
#

^ some wizardry shit

manic wing
#

!d discord.on_connect

unkempt canyonBOT
#

discord.on_connect()```
Called when the client has successfully connected to Discord. This is not the same as the client being fully prepared, see [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready") for that.

The warnings on [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready") also apply.
manic wing
#

takes nothin

slim ibex
#

oh I was thinking of just connect

keen talon
fresh iron
#

there changed it to on_ready

slim ibex
#

That doesn’t make any difference?

#

on_ready doesn’t take in anything either

#

!d discord.on_ready

unkempt canyonBOT
#

discord.on_ready()```
Called when the client is done preparing the data received from Discord. Usually after login is successful and the [`Client.guilds`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.guilds "discord.Client.guilds") and co. are filled up.

Warning

This function is not guaranteed to be the first event called. Likewise, this function is **not** guaranteed to only be called once. This library implements reconnection logic and thus will end up calling this event whenever a RESUME request fails.
fresh iron
#

oh

brittle axle
fresh iron
manic wing
brittle axle
#

thats why it dosent work

#

if there are more errors please print it out

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

brittle axle
fresh iron
#

i still haven't tested im just asking if im doing it properly

quick gust
#

except should be un-indented once more

quick gust
potent spear
brittle axle
fresh iron
#

right...

potent spear
#

you can't pass a guild as argument, you'll have to pass the id or whatever and get_guild

quick gust
#

also pass ctx

#

discord.on_connect

potent spear
quick gust
#

bro

brittle axle
#

rip my spelling

silent ermine
quick gust
#

..

#

are you trolling

brittle axle
#

no

quick gust
#

go to #bot-commands

#

please, its without the ()

#

!d discord.on_connect

potent spear
# silent ermine

why would you uninstall this? also, isn't this preinstalled with python?

unkempt canyonBOT
#

discord.on_connect()```
Called when the client has successfully connected to Discord. This is not the same as the client being fully prepared, see [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready") for that.

The warnings on [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready") also apply.
silent ermine
#

just the same error keeps popping up

slim ibex
silent ermine
slate swan
#

!pip typing

unkempt canyonBOT
slim ibex
#

replit moment

slate swan
silent ermine
slate swan
#

e thats typing extensions and is important

silent ermine
slate swan
#

thats not it

brittle axle
manic wing
naive spoke
#

there is an error for this

await message.add_reaction(':thumbsup:')

it says
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 10014): Unknown Emoji

silent ermine
#

the fuq now everything inst running

manic wing
brittle axle
#

or unicode

naive spoke
#

ok

brittle axle
silent ermine
#

also if i delete these, these would create back again?

naive spoke
pliant gulch
brittle axle
naive spoke
silent ermine
#

!code

#

not that uhm the thing where i can paste it

naive spoke
#

oh

#

nvm

silent ermine
#

!pastebin

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.

pliant gulch
#

Something is wrong with your repl

#

People get that error by having the pypi version of typing installed

#

But here it says you don't have it

pliant gulch
#

Sure

silent ermine
#

now the replit wont run!

slate swan
#

poetry init

#

in shell ,and configure it yourself

silent ermine
#

what does this mean btw?

brittle axle
#

@fresh iron

slate swan
#

write yes

silent ermine
#

k

#

yooo it works now

#

well runnning

supple crescent
#

when i use the code below i get the error: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'function' object has no attribute 'int' how wouldi fix this?

@bot.command(name="contact")
async def contact(ctx):
    guild = ctx.guild
    admin_role = guild.get_role(945326991526219848)
    bot_role = guild.get_role(945107766035513357)   
    overwrites = {
        guild.default_role: discord.PermissionOverwrite(view_channel=False),
        ctx.author: discord.PermissionOverwrite(view_channel=True),
        admin_role: discord.PermissionOverwrite(view_channel=True),
        bot_role: discord.PermissionOverwrite(view_channel=True),
        guild.me: discord.PermissionOverwrite(view_channel=True)
    }

    await guild.create_text_channel("private-channel", overwrites=overwrites)  
brittle axle
#

@fresh iron i found the problem you havent defined the guild in the command

slate swan
silent ermine
#

so im checkin

unkempt canyonBOT
supple crescent
slim ibex
#

Full error that’s sent

final iron
unkempt canyonBOT
#

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

A full traceback could look like:

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

If the traceback is long, use our pastebin.

brittle axle
supple crescent
#

ohhh

#

Traceback (most recent call last):
File "C:\Users\NAME\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\NAME\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\NAME\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'function' object has no attribute 'int'

maiden fable
#

U forgot to do () (call it)

maiden fable
#

Imagine

silent ermine
slate swan
#

dont you use discord?

silent ermine
#

nope

slim ibex
#

oh no not pycord

silent ermine
#

going to pycord

slate swan
#

because in the poetry it was discord

pliant gulch
#

poetry install

slate swan
#

you have better choices tho

silent ermine
#

i like pycord though

slim ibex
#

disnake pls

silent ermine
slate swan
#

*someone said its cool and best

slim ibex
#

their docs are shit they kept the discord namespace for some reason

#

and it just makes it harder for people to transfer to it

silent ermine
#

wait i dont need to import pycord

#

on my code?

slim ibex
#

?

pliant gulch
#

They kept the namespace lol?

slate swan
#

no, the library takes discord's namespace

#

yea, that aint even optional

slim ibex
#

pycord docs have like discord.discord.ext

pliant gulch
#

This is gonna be like client vs bot all over again

slate swan
#
    console.log("Waiter Is Online, Just Checking: \n :heavy_check_mark: Means Working \n ✘ Means Not Working \n")
});```
nothing showing in terminal after this
**Making a discord bot btw** - node.js
#

yea, discord.Client vs discord.Bot

#

idky they did that

pliant gulch
silent ermine
slate swan
#

may u give link to discord.js

#

in dms

silent ermine
#

alright community

#

i need your help, pycord or disnake

#

or nextcord

slim ibex
#

Disnake

slate swan
#

disnake.

silent ermine
#

cuz im getting tired of this

slim ibex
#

(Even though I am a nextcord user mainly)

worthy helm
slate swan
slate swan
pliant gulch
#

I like neither of the forks 👁️ 👁️

slim ibex
#

I’m a pincer watcher but a Rin lover

silent ermine
#

see discord is making me send invalid api requests

#

so its foquing up my bots

pliant gulch
slate swan
supple crescent
#

when i use the code below i get the error: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'function' object has no attribute 'int' how wouldi fix this?

Traceback: Traceback (most recent call last):
File "C:\Users\NAME\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\NAME\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\NAME\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'function' object has no attribute 'int'

@bot.command(name="contact")
async def contact(ctx):
    guild = ctx.guild
    admin_role = guild.get_role(945326991526219848)
    bot_role = guild.get_role(945107766035513357)   
    overwrites = {
        guild.default_role: discord.PermissionOverwrite(view_channel=False),
        ctx.author: discord.PermissionOverwrite(view_channel=True),
        admin_role: discord.PermissionOverwrite(view_channel=True),
        bot_role: discord.PermissionOverwrite(view_channel=True),
        guild.me: discord.PermissionOverwrite(view_channel=True)
    }

    await guild.create_text_channel("private-channel", overwrites=overwrites)  
silent ermine
#

btw where is the disnake community

slate swan
#

you didnt send the main part of error again

silent ermine
#

so i can go make helli mean ask questions

slate swan
silent ermine
#

yep thank you

slim ibex
supple crescent
slim ibex
#

Yes

supple crescent
#

oh

#

idk my code isnt 94 lines

#

idk whats triggering it

#

but its smthn in here

#

bucause this error comes up when i use the !contact