#discord-bots

1 messages Β· Page 791 of 1

maiden fable
#

Ask me, it took ages for discord to verify my bot and gimme that intent ;-;

slate swan
maiden fable
#

Lemme see

burnt heath
maiden fable
#

u didn't define self

burnt heath
#

its now doing nothing

maiden fable
burnt heath
#

oh wait it did

maiden fable
#

it takes time to get the data from discord, parse it and stuff

burnt heath
#

lemme try now

#

k now why is this two times

maiden fable
#

Lmao

#

You got an on_message event?

burnt heath
#

yes

maiden fable
#

Mind showing it?

maiden fable
burnt heath
#

idk if u meant this but this what i understood

maiden fable
#

Also

#

do *, item so that u will get a single string instead of list

oblique cobalt
maiden fable
slate swan
burnt heath
#

i dont

maiden fable
maiden fable
keen talon
slate swan
# maiden fable Mind showing the whole error?

Traceback (most recent call last):
File "C:\Users\garyk\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\garyk\AppData\Roaming\Python\Python37\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\garyk\AppData\Roaming\Python\Python37\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: bot

keen talon
maiden fable
slate swan
keen talon
#

πŸ™‚

maiden fable
burnt heath
#

also can u tell how to use commands from different files? i used to do that in js but i forgot because i havent done it in a long time

burnt heath
#

wuts dat

oblique cobalt
#

or other way around which i forgor πŸ’€

oblique cobalt
maiden fable
unkempt canyonBOT
#

add_command(command)```
Adds a [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") into the internal list of commands.

This is usually not called, instead the [`command()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin.command "discord.ext.commands.GroupMixin.command") or [`group()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin.group "discord.ext.commands.GroupMixin.group") shortcut decorators are used instead.

Changed in version 1.4: Raise [`CommandRegistrationError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandRegistrationError "discord.ext.commands.CommandRegistrationError") instead of generic [`ClientException`](https://discordpy.readthedocs.io/en/master/api.html#discord.ClientException "discord.ClientException")
oblique cobalt
burnt heath
#

how am i supposed to download the hlper module

maiden fable
#

What is that

burnt heath
#

idk it shows this

maiden fable
#

u r using 3.7 in yr IDE

#

Why...

burnt heath
#

?

#

im just testing some stuff

slate swan
burnt heath
#

so i got a template online

maiden fable
#

Yea that

#

The pip got a stroke

burnt heath
#

it does?

slate swan
#

And this isnt the appropriate channel to fix pip

maiden fable
#

People in general: Why tf do people come here for help, there are help channels for a reason 🀣

burnt heath
#

so now im supposed to fix pip when it was working absolutely fine 2seconds

maiden fable
#

Reinstall it

#

and stop using Python 3.7

#

Use at least Python 3.9

slate swan
maiden fable
#

Let's give them some work then :DDD

burnt heath
maiden fable
slate swan
maiden fable
#

wow, my bot's bot.users

karmic lintel
#
i want like
 if commands by user != commands of bot :
                       await ctx.send ('not a valid command')
else:
                      ()```
maiden fable
#

use on_command_error

#

!d discord.ext.commands.CommandNotFound

unkempt canyonBOT
#

exception discord.ext.commands.CommandNotFound(message=None, *args)```
Exception raised when a command is attempted to be invoked but no command under that name is found.

This is not raised for invalid subcommands, rather just the initial main command that is attempted to be invoked.

This inherits from [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError").
hoary gust
#

guys can i do self.bot.send?

#

is it possible

maiden fable
#

No

#

ctx.send() is the way to go

slate swan
maiden fable
#

await message.author.kick(reason)

velvet tinsel
maiden fable
velvet tinsel
#

only about your pfp

#

And also your pfp has an error

maiden fable
#

I need a new pfp

velvet tinsel
#

yes, you do.

hoary gust
maiden fable
hoary gust
#

is there any other way to send message without using ctx?

#

in cog

#

@maiden fable

maiden fable
#

No

#

message.channel.send

hoary gust
maiden fable
#

Yea

#

channel.send()

hoary gust
#

haha got it

#

i forgot about that

slate swan
# maiden fable `await message.author.kick(reason)`

how do i fix this
Traceback (most recent call last):
File "C:\Users\garyk\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\garyk\Desktop\delink-bot-main\init.py", line 59, in on_message
await deletemsg(message)
File "C:\Users\garyk\Desktop\delink-bot-main\utils\functions.py", line 55, in deletemsg
await message.author.kick(reason)
TypeError: kick() takes 1 positional argument but 2 were given

maiden fable
quick gust
brisk brook
#

why is a blackjack command so hard to make

maiden fable
quick gust
keen talon
maiden fable
slate swan
#

guys guys, does the on_slash_command_error event follow the same syntax as on_command_error?

#

pithink rip everybody

quick gust
#

sorry bad joke

slate swan
#
    @commands.Cog.listener()
    async def on_guild_remove(self,guild):
        with open("prefixes.json", "r") as f:
          prefixes = json.load(f)

        prefixes.pop[str(guild.id)]

        with open("prefixes.json", "w") as f:
          json.dump(prefixes,f)```
quick gust
#

looks like a Lucas tutorial

slate swan
#

nah

#
Ignoring exception in on_guild_remove
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "/home/runner/beluga/cogs/prefix.py", line 65, in on_guild_remove
    prefixes.pop[str(guild.id)]
TypeError: 'builtin_function_or_method' object is not subscriptable```
#

wanna see my prefix command?

slate swan
alpine vault
#

I was making an function which received an instance of commands.Bot(...) so I type hinted it with bot: discord.ext.commands.bot.Bot which got me the error AttributeError: module 'discord' has no attribute 'ext', what am I doing wrong here?

slate swan
#

Well, at first it would be discord.ext.commands.Bot

#

And I would recommend to use a different library as discord.py is no longer being maintained.

outer flint
#

so, can I create a command that, when executed, will restart the bot? thinku

burnt heath
slate swan
#
    @commands.command(aliases = ['changeprefix','chprefix'])
    async def prefix(self,ctx,*,prefix=None):
      if ctx.author.guild_permissions.manage_channels == True:
        if not prefix:
            with open("prefixes.json","r") as f:
                prefixes = json.load(f)
            
            prefix = prefixes[str(ctx.guild.id)]
            em = discord.Embed(title='Current prefix',description = f'My current prefix = `{prefix}` ',colour = discord.Color.gold())
            await ctx.send(embed=em)
        else:
            with open("prefixes.json","r") as f:
                    prefixes = json.load(f)
                
            prefixes[str(ctx.guild.id)] = prefix
                

            with open("prefixes.json","w") as f:
                    json.dump(prefixes,f ,indent=4)

            emb = discord.Embed(description = f"**prefix changed to `{prefix}`**",colour = discord.Color.gold() )
            await ctx.send(embed=emb)
      else:
        with open("prefixes.json","r") as f:
            prefixes = json.load(f)
        
        prefix = prefixes[str(ctx.guild.id)]
        em = discord.Embed(title='Current prefix',description = f'My current prefix = `{prefix}` ',colour = discord.Color.gold())
        await ctx.send(embed=em)
        ```
#

my prefix command

slate swan
boreal ravine
#

rtd idk

slate swan
#

lol

alpine vault
#

Is it invalid to use decorators like this?

class meta(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.command
    @self.bot.cache.command("cmd_test")
    def test():
        return

I am getting the error self is not defined (on the line of second decorator)

#

so how can I can make an decorator from the bot argument that __init__ takes?

#

without the use of globals?

slate swan
#

Only that you don't have some of the exceptions that Context has

#

And have the extra exceptions an interaction raises

slate swan
slate swan
#

Also where's the params for it

#

And it's supposed to be a coro

alpine vault
slate swan
alpine vault
#

Now it looks like this :

class meta(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.command()
    @self.bot.cache.command("cmd_test")
    async def test(self, ctx):
        return

edit : err

alpine vault
slate swan
#
async def test(self, ctx):
   ...
slate swan
#

And remote that self.bot.cache decorator

#

Remove*

alpine vault
#

what's the alternative?

slate swan
#

cof cof

#

You wrap the decorator function in another function

boreal ravine
slate swan
#
def wrap_command(your_params_here):
    def inner(ctx):
        ctx.bot.cache.command(your_params_here)
    return inner
alpine vault
#

My project code is so sketched right now that I use an alt to ask questions and make PRs πŸ₯΄

slate swan
#

how do i make my bot mention a role?

boreal ravine
#

<@&id> or if you have the role object, use the discord.Role.mention property

slate swan
#

kk thx

boreal ravine
#

@slate swan ?

slate swan
#

not me

slate swan
#

Exposed

slate swan
maiden fable
slate swan
#

how to react to a new arrive in the server

boreal ravine
#

whats a new arrive

final iron
#

!d discord.on_member_join

unkempt canyonBOT
#

discord.on_member_join(member)``````py

discord.on_member_remove(member)```
Called when a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") leaves or joins a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").

This requires [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") to be enabled.
final iron
#

@slate swan ^

silk lynx
#
    item_name = item_name.lower()
    name = None
    
    for item in Egg_Shop:
        name = item["name"].lower()
        if name == item_name:
            name = name
            price = item["price"]
            break

    if name == None:
        return [False, 1]

    cost = price * amount

    users = await get_bank_data()

    bal = await update_bank(user)

    if bal[0] < cost:
        return [False, 2]

        try:
            index = 0
            t = None
            for thing in users[str(user.id)]["petbank"]:
                n = thing["item"]
                if n == item_name:
                 old_amt = thing["amount"]
                new_amt = old_amt + amount
                users[str(user.id)]["petbank"][index]["amount"] = new_amt
                t = 1
                break
                index += 1
                if t == None:
                 obj = {"item": item_name, "amount": amount}
                users[str(user.id)]["petbank"].append(obj)
        except:
            obj = {"item": item_name, "amount": amount}
            users[str(user.id)]["petbank"] = [obj]

        with open("mainbank.json", "w") as f:
            json.dump(users, f)

        await update_bank(user, cost * -1, "Coins")
        return [True, "Worked"]```
#

These are codes for buy command .... when i run them i dont get errors but still the command dont work ... what can i do?

potent spear
#

don't watch YT videos about these types of libraries, that's the first hint

final iron
#

I've seen this code so many times before

silk lynx
#

hm..

slate swan
final iron
#

What

slate swan
#

what you mean by ^

potent spear
#

see the above

slate swan
#

ok i see

#

hhh

slate swan
#

how do I expect the user to give a float number

quaint scaffold
slim ibex
#

but that doesn't make it only accept floats

quaint scaffold
#

That's true, if they inputted 2 it'd turn into 2.0

slim ibex
#

it can still be anything, the type hint just says it shoudl be float

slate swan
#

Not anything but an int/float

#

 if message.content.startswith('$greet'):
        channel = message.channel
        await channel.send('Say hello!')

        def check(m):
            return m.content == 'hello' and m.channel == channel

        msg = await client.wait_for('message', check=check)
        await channel.send(f'Hello {msg.author}!')``` and I want a float
#

got this from a website

slim ibex
#

uhh where is the float supposed to come in

slate swan
#

Make a check which checks if message.content is numeric

quaint scaffold
quaint scaffold
#

Np, re-write all of your code and do not use repl.it

slim ibex
slate swan
#

does if type(response) == float: work

visual island
#

use isinstance

slim ibex
#

!d isinstance

unkempt canyonBOT
#

isinstance(object, classinfo)```
Return `True` if the *object* argument is an instance of the *classinfo* argument, or of a (direct, indirect, or [virtual](https://docs.python.org/3/glossary.html#term-abstract-base-class)) subclass thereof. If *object* is not an object of the given type, the function always returns `False`. If *classinfo* is a tuple of type objects (or recursively, other such tuples) or a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union) of multiple types, return `True` if *object* is an instance of any of the types. If *classinfo* is not a type or tuple of types and such tuples, a [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "TypeError") exception is raised.

Changed in version 3.10: *classinfo* can be a [Union Type](https://docs.python.org/3/library/stdtypes.html#types-union).
velvet tinsel
#

good afternoon

final iron
#

Good morning

slate swan
#

good evening

visual island
#

good night

quick gust
#

good nig-

#

nvm

#

icy faster

visual island
#

why do people still calling me icy

quick gust
#

it's easier to say

#

than cirno

kind wind
#

How do you make a slowmode command?

slate swan
#

rewrote the entire code

river flare
#

Hello. I have this code, but i want to make it like when row is 0, to give different output.```python
mycursor.execute("SELECT gen FROM customers WHERE name = %s", (user.name,))
row = mycursor.fetchone()
print(f"selected gen for {user.name}: {row[0]}")
new_gen = int(row[0]) - 1
print(f"gen for update: {new_gen}")
upd_stmt = "UPDATE customers SET gen = %s WHERE name = %s"
mycursor.execute(upd_stmt, (new_gen, user.name))
mydb.commit()
lines.remove(random_item_from_list)
with open('rockstars.txt','w') as f:
f.writelines(lines)
emb=nextcord.Embed(title="Ainta Gen", description=f"Your account is: {random_item_from_list}\n**Gens left:** {new_gen}", color=color, timestamp=datetime.now())
await user.send(embed=emb)

quaint scaffold
slate swan
quaint scaffold
#

The code is valid, so it should work. If you are running it locally, then it might have a very long response time

slim ibex
#

why type hint ctx

#

not saying it’s bad but you don’t need to

slate swan
#

messages before !hello were with a different code

quaint scaffold
#

Are you running the bot off of your PC?

slate swan
#

yes

quaint scaffold
#

The ping is likely the issue. It takes up to two minutes to respond when I run it off of my own

slate swan
#

oh

#

the last code was much faster

quaint scaffold
#

Was the bot previously running on repl.it prior to the re-write?

slate swan
#

I have no idea

#

!bigcode

#

!code

#

!hugecode

quaint scaffold
#

Is this your first time using Python?

slate swan
#

I'm so bad at it 😐

quaint scaffold
#

No, the language itself

potent spear
#

his prefix is simply not set up

#

OR he uses on_message as command system :/

slate swan
quaint scaffold
#

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

quaint scaffold
#

You need to learn the language - Python
discord.py is a library that uses Python

slim ibex
#

have you learned Python

quaint scaffold
#

He doesn't know the difference between Python and discord.py, so no

slim ibex
#

yeah

slate swan
quaint scaffold
#

You can ignore us, but you cannot make a discord bot if you do not even understand Python

slate swan
#

ah no I'd rather be the type of person to follow good advice, thank you

quaint scaffold
#

Good luck

#

But don't waste anyone's time with a more complex library because you don't want to bother learning the basics

boreal ravine
#

lol

#

python is the easiest language

#

I don't get why people don't bother to learn it before using d.py

brisk brook
#

!paste

unkempt canyonBOT
#

Pasting large amounts of code

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

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

brazen raft
quaint scaffold
#

Because they want to make something cool and making a simple quiz game using input() is NoT wOrTh tHeIR tImE

quaint scaffold
#

As for asynchronous bot programming, that's what they'd rather be doing

karmic lintel
#

def get_prefix(client,message):
  with open('prefixes.json', 'r') as f:
    prefixes = json.load(f)
  return prefixes[str(message.guild.id)]```
shows key error in last line
boreal ravine
karmic lintel
karmic lintel
boreal ravine
#

show full error

grim oar
#

Show dict structure

boreal ravine
karmic lintel
#

guild id wasn't there now its working

boreal ravine
#

you said it was earlier but ok

slate swan
#

guys guys, even though message intents would be disabled, It can still detect if a message was sent, right?

visual island
#

yes

slate swan
#

nice

#

thank you sooooooooooooooo much

visual island
#

but content, embeds, attachments, components will be empty

fresh iron
#

hello so i'm basically trying to make the bot posts these answers for these questions everything the these questions get asked within few seconds

#

kinda forgot how to do that

maiden fable
maiden fable
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
#

How would i make a kick command with cogs

#

same as you do for a normal one, but with self as the parameter for the function

#

What is the best way to have a command sorter?? without cogs?

#

wdym by sorter? categories?

honest vessel
#

groupcommands?

#

but why wouldt u wanna use cogs?

rare saddle
#

How to find out how many times a person has used a command?

rare saddle
slate swan
hoary cargo
slate swan
#

When I tried making a broadcast command to dm the owners in the servers its in it never worked I spent a whole day trying

final iron
slate swan
final iron
#

If you cannot transfer your code into cogs you most likely haven't learned fundamentals yet

#

It's just simple classes

cold sonnet
#

πŸ‘

honest vessel
#

@slate swan lol?

slate swan
#

What python version is better?

final iron
slate swan
#

kk

honest vessel
#

@slate swan maybe u have global error handlers makin debug harder for u i have a load cog shit that i can add/remove cogs if i wanna see btr i only run the cog i am working with

brisk brook
#

How do i translate discord buttons to cogs?

honest vessel
slate swan
honest vessel
#

@slate swan ur what bot?

#

or cogfile

final iron
#

So it's just like working in a class

brisk brook
#
class Confirm(nextcord.ui.View):
    def __init__(self):
        super().__init__()
        self.value = None

    # When the confirm button is pressed, set the inner value to `True` and
    # stop the View from listening to more input.
    # We also send the user an ephemeral message that we're confirming their choice.
    @nextcord.ui.button(label='Confirm', style=nextcord.ButtonStyle.green)
    async def confirm(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
        await interaction.response.send_message('Confirming', ephemeral=True)
        self.value = True
        self.stop()

    # This one is similar to the confirmation button except sets the inner value to `False`
    @nextcord.ui.button(label='Cancel', style=nextcord.ButtonStyle.grey)
    async def cancel(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
        await interaction.response.send_message('Cancelling', ephemeral=True)
        self.value = False
        self.stop()
``` how do I access this in my cogs?
#

do I self.confirm = Confirm() ?

honest vessel
slate swan
brisk brook
final iron
#

Try it

brisk brook
#

i did

final iron
#

And?

brisk brook
#

bot.add_cog(eco(bot))
File "c:\Users\philip\Desktop\coding\projects\projects\discord\jr_\economy.py", line 39, in init
self.sub = Confirm()
File "c:\Users\philip\Desktop\coding\projects\projects\discord\jr_\economy.py", line 17, in init
super().init()
File "C:\Users\philip\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nextcord\ui\view.py", line 166, in init
loop = asyncio.get_running_loop()
RuntimeError: no running event loop

#

@final iron

maiden fable
#

Where u doing that?

brisk brook
#

on the same file

maiden fable
#

Like, in the cog file or what

brisk brook
#

yeah

slate swan
#

How would i make it so my bot can play music?

maiden fable
slate swan
#

wait what?

brisk brook
maiden fable
maiden fable
unkempt canyonBOT
#

Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.

For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:

The following restrictions apply to your use of the Service. You are not allowed to:

1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service;  (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;

3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;

9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
slate swan
#

oh ok thx

brisk brook
#
import nextcord
from nextcord.ext import commands
from economy import eco

intents = nextcord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!",case_insensitive=True,intents=intents)

@bot.event
async def on_ready():
    print("The bot is online.")

bot.add_cog(eco(bot))
``` @maiden fable
maiden fable
#

Ah

#

U gotta do bot.load_extension("economy") or smth where economy is the file name

brisk brook
#

net bet bet

#

still the same error

maiden fable
#

Show

hoary cargo
maiden fable
brisk brook
#
  File "c:\Users\philip\Desktop\coding\projects\projects\discord\jr_\bot.py", line 13, in <module>    
    bot.load_extension(eco(bot))
  File "c:\Users\philip\Desktop\coding\projects\projects\discord\jr_\economy.py", line 39, in __init__
    self.sub = Confirm()
  File "c:\Users\philip\Desktop\coding\projects\projects\discord\jr_\economy.py", line 17, in __init__
    super().__init__()
  File "C:\Users\philip\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nextcord\ui\view.py", line 166, in __init__
    loop = asyncio.get_running_loop()
RuntimeError: no running event loop
hoary cargo
#

well, in the first place that thing above doesn't even look like a cog

honest vessel
stone moon
#

how to find content of replied message when user replies to someone?

#

message.reference

#

please ping me

honest vessel
#

@slate swanthis is basicly all u need for play music/sound in vc,

crisp tapir
honest vessel
#
self.voice = await ctx.author.voice.channel.connect(reconnect=True, timeout=5500)

self.voice.play(FFmpegPCMAudio(url), after=lambda e: print('Player error: %s' % e) if e else None)
brisk brook
#

It works without the cogs

#

Ion know why it won't work with the cogs

hoary cargo
#

because probably you don't use them right

hoary cargo
crisp tapir
#

but if i use OAuth2 ? what i can do using OAuth2???

#

and what is allowed to do with OAuth2??

honest vessel
#

arent the OAuth2 also bot

#

so thats why its allowed ur acc still has [bot] tag

crisp tapir
#

ahhh

#

oky, but bots can do everything like users?

heavy folio
#

not everything

honest vessel
#

u should't keep asking tho about selfbotting

heavy folio
#

yeah ^

crisp tapir
heavy folio
#

what what

honest vessel
#

just move on make a bot or find another server

crisp tapir
#

lol

heavy folio
#

which part of it did it mention "self-bots"

crisp tapir
#

theyre not like bots??

heavy folio
honest vessel
#

well he asking about whats diffrent n whats allowed selfbot vs bot

#

@crisp tapirdo u know what a bot is?

heavy folio
#

thats sus because the more we tell him the more he'll find out about self bots

honest vessel
#

bot is automated computer runned

#

client is a human

crisp tapir
#

ah then sorry

heavy folio
#

that...

honest vessel
#

if they can do both same ofc,

crisp tapir
#

i seen

#

the last sentence

heavy folio
#

"to not get banned"

crisp tapir
#

but if i use OAuth?

#

"outside OAuth/bot api"

heavy folio
#

so you wanna use OAuth to make a self bot?

honest vessel
#

if u use OAth in ur developer page @ discord, u still have bot

crisp tapir
#

i think

#

idk if is possible

honest vessel
#

but u dont use token, u use Oauth to identify urself

crisp tapir
#

yes?

honest vessel
#

its not selfbotting

crisp tapir
#

a

#

why discord doesnt allow it??

honest vessel
#

selfbotting is pretend be a client

crisp tapir
#

on telegram userbots are allowed

honest vessel
#

but you do automated stuff

heavy folio
crisp tapir
crisp tapir
heavy folio
#

anyways lets stop the convo bout self bots

honest vessel
#

why cant u just do a bot like 99% else what disturbs u so much having a [bot] tag?

crisp tapir
#

okay sorry

crisp tapir
honest vessel
#

i could understand if u would like to make a discord CLI client for fun but thats pretty much only reason

honest vessel
#

and that is not selfbotting cause nothing is automated

heavy folio
#

tf?

honest vessel
#

@crisp tapirok i think ama report u

heavy folio
#

can i ping moderators for this

honest vessel
cloud dawn
#

Depends on how he is self botting though

crisp tapir
#

you cant

honest vessel
#

@cloud dawnhe wants to sell fake accounts and get rich...

heavy folio
cloud dawn
slate swan
#

@crisp tapir hello, we won't help with self-botting as it violates Discord's ToS

crisp tapir
#

okay

honest vessel
#

i think its funny when peoples has agendas like that but cant code n needs help xD why not gitgod or giveup

cloud dawn
#

Dashboards for example are self-bots, per-guild configs.

honest vessel
#

what is dashboards?

cloud dawn
honest vessel
#

hm why not use webhooks then?

cloud dawn
#

Those are really limited

crisp tapir
#

what?

rare saddle
#

How to respond to the author of the message in on_message?

slate swan
#

I need help guys

honest vessel
maiden fable
cloud dawn
rare saddle
cloud dawn
honest vessel
#

well message.author

maiden fable
honest vessel
slate swan
#

my discord project is not running pls help

rare saddle
honest vessel
maiden fable
slate swan
#

i tried running it buy it didnt work

#

i think my pc has a problem or something

honest vessel
#

sometimes i cant tell if noobs or trolls,

maiden fable
karmic lintel
#

i want a proper syntax for it like -

if command used by a user != command of my bot: 
         await ctx.send('hi')```
maiden fable
#

U shouldn't really judge anyone like that, yk

rare saddle
honest vessel
maiden fable
unkempt canyonBOT
#

exception discord.ext.commands.CommandNotFound(message=None, *args)```
Exception raised when a command is attempted to be invoked but no command under that name is found.

This is not raised for invalid subcommands, rather just the initial main command that is attempted to be invoked.

This inherits from [`CommandError`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CommandError "discord.ext.commands.CommandError").
maiden fable
#

Rip I'm sleepy

#

Misread can't as can, sorry!

karmic lintel
honest vessel
slate swan
#

how can u check amount of members in a guild?

cloud dawn
slate swan
karmic lintel
cloud dawn
honest vessel
#

@slate swannothing wrong with 666 tho

maiden fable
#

I don't really think this is a Mod case? Idrk, I guess that's for mods to find out

honest vessel
#

@slate swanis it a crime being antichristian?

visual yarrow
#

Hello. Could you contact @novel apex please.

maiden fable
cloud dawn
#

Next time best to report to modmail instead of creating a witch hunt.

karmic lintel
honest vessel
#

in that sense i feel u, but overall 666 yes is devils number but everyone has their rights of religion

visual yarrow
#

Let's keep further discussion of this out of this channel to stay on-topic please.

honest vessel
#

that is correct

maiden fable
#

U both should just take it to OT or DMs idk

honest vessel
#

!ot

unkempt canyonBOT
visual yarrow
#

So, discord bots ey?

honest vessel
#

@slate swan lets debate religions

maiden fable
slate swan
#

How do I make a kick command?

maiden fable
#

Let's spam Discord's API Computers

unkempt canyonBOT
#

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

Kicks this member. Equivalent to [`Guild.kick()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.kick "discord.Guild.kick").
visual yarrow
slate swan
#

Well I haven't made a fully kick command..

honest vessel
#

well all u need is that pretty much

#

and decorations n errorhandler and u set

slate swan
tacit token
#

hello guys, what happends with python dc api??

cloud dawn
compact sky
#

would i make a discord bot with replit

slate swan
#

How do i make is so when i ban someone it DMS them the reason?

cloud dawn
cloud dawn
grand shell
#

is there a way to detect when the bot is kicked from a server?

manic wing
#

!d discord.on_guild_remove

unkempt canyonBOT
#

discord.on_guild_remove(guild)```
Called when a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild") is removed from the [`Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client").

This happens through, but not limited to, these circumstances...
cloud dawn
#

Keep in mind that you can't send anything to that guild anymore.

grand shell
#

yeah thanks for the tip!

robust raven
#

hi i just made a bot and i tried to upload it to repl.it and the cogs don't work (on my pc it works) and no error shows up

#

can i do something about it

#

??

honest vessel
slate swan
#

how can u do something like user has been invited by user2

honest vessel
#

and its still aint 100%

honest vessel
#

google discord invite tracker python

slate swan
#

i'm looking at a bot on github, it's pretty eh

#

u need a whole database apparently

honest vessel
#

a whole database is still just a tiny databse πŸ€·πŸ»β€β™‚οΈ

slate swan
slate swan
#

Anybody know like good base code for a discord antinuke

slate swan
#

Really need it to stop bans channel creation

manic wing
slate swan
robust raven
#

no

slate swan
#

I got good vps

#

To host it

slate swan
#
@commands.command()
    @commands.has_permissions(ban_members = True)
    async def ban(ctx,member : discord.Member,*,reason= "I do not need a reason"):
        await ctx.send(member.name + " has been banned from the server, because"+reason)
        await member.send(reason=reason)
        await member.ban(reason=reason)
```  when i try to ban someone i keep getting this error discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Admin' object has no attribute 'send' can anyone tell me whats wrong
manic wing
cloud dawn
robust raven
cloud dawn
slate swan
robust raven
#

ok

slate swan
#

For example, one of my bots uses this.

run = "python bot.py"```
sacred sigil
#
@bot.command()
@commands.is_owner()
async def rename(ctx, *, message):
    channel = ctx.textchannel()
    await channel.edit(name=message)
    await ctx.message.delete()
#

this correct?

#

or should it be ctx.TextChannel()?

manic wing
sacred sigil
#

appreciate it

normal jolt
#

however, to get all text channels
it's ctx.guild.text_channels

robust raven
#

bruh i m just stupid i had the bot running on my pc and the replit

slate swan
#

can u do something like this

bot = commands.Bot(remove_command='help')
karmic lintel
slate swan
#

Hey guys, how do I send a text fille via python code to a discord webhook? Just a simple webhook message with the text fille on it.

#

also dont mind my status im just testing it on my own lol

manic wing
slate swan
slate swan
#

How would i make a tik tak toe command

potent spear
robust raven
#

Guess replit is not the best cloud hosting

crystal cliff
echo wasp
#

If I own my bot how can I make it so I canrun them without admin perms in the server?

robust raven
#

Not even the loadcog command doesn't work

#

That is in the main file

echo wasp
#

Replit thing try local host and then put in a private github then use heroku it is free

robust raven
#

Heroku doesn't work for me

echo wasp
#

If local host works

echo wasp
robust raven
#

Yes I followed the instructions on Jacob Allen how to make discord bot

slate swan
#

are txt databases decent?

robust raven
#

Yes

echo wasp
#

Json is better but sql is best

slate swan
#

well, it's for a school project and we need to use txt for it

#

oh this is the wrong channel. my apologies

robust raven
#

No it is just for a hobby

slate swan
#

sql is good for a basic db

robust raven
#

BTW I am 12 and I really understand the code

slate swan
#

ok?

#

Yes I know, but our teacher stated that we must use a txt database

#

so i'm just asking around it

#

then dont do the project

#

lol

#

hes teaching you horrible things because txt files arent supposed to store data

rare saddle
#

How to make the bot not constantly write that a person has 10,000 xp and a new role?

slate swan
#

Yeah, i know we used sql before, but were using txt cause we need to apparently, he agreed on it himself

#

i would just do the project in sql or not do it lol

#

bad practice isnt something good lol

#

agreed

robust raven
slate swan
#

pep 8 is screaming

#

and your missing self

#

and .send doesnt have a reason kwarg only ban does

#

how can u get the account age? in days

manic wing
unkempt canyonBOT
#

property created_at: datetime```
Returns the user’s creation time in UTC.

This is when the user’s Discord account was created.
slate swan
#

thanks

#

something like this?

 user.created_at.__format__('%d')
slate swan
slate swan
echo wasp
#

hi so i have 2 different bots a beta bot and a regular bot i want them in the same folder but idk what to do because i don't want the cog files colliding

echo wasp
slate swan
#

no just add different paths

echo wasp
#

Explain

slate swan
#

with os.listdir

slate swan
#

I dont understand how to apply yours

#

also the text filles I am trying to send will always have different names

echo wasp
#

So for the oslistdir do I do ./cog

#

Or do I need todo the whole thing

slate swan
#

i tried this @manic wing

manic wing
#

why dont you just use discod.Webhook?

reef trail
#

how do you get a guild id by using a role?

final iron
#

!d discord.Role.guild

unkempt canyonBOT
final iron
#

This returns a guild object

#

Which you can use the id attribute on

unkempt canyonBOT
fresh iron
reef trail
#

okay, how does get_role work then? ive tried

bruh = await bot.get_role(role_ID)
print(bruh.name)``` 
but i get `'Bot' object has no attribute 'get_role'`, do i need to fetch the guild first?
fresh iron
vestal cave
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.

reef trail
slate swan
#

!d discord.Guild.get_role

unkempt canyonBOT
slate swan
vestal cave
# fresh iron why?

Easier for us to read

If it is the command prompt, right-click the title bar and select "Mark", then highlight the stuff and press Enter to copy it

fresh iron
#

`
C:\Users\Ramsay>pip install discord.py
Collecting discord.py
Downloading discord.py-1.7.3-py3-none-any.whl (786 kB)
|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ | 655 kB 45 kB/s eta 0:00:03ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\Ramsay\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", line 438, in _error_catcher
yield
File "C:\Users\Ramsay\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "C:\Users\Ramsay\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "C:\Users\Ramsay\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 465, in read
s = self.fp.read(amt)
File "C:\Users\Ramsay\AppData\Local\Programs\Python\Python310\lib\socket.py", line 705, in readinto
return self._sock.recv_into(b)
File "C:\Users\Ramsay\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1273, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\Ramsay\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1129, in read
return self._sslobj.read(len, buffer)
TimeoutError: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
`

vestal cave
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.

final iron
unkempt canyonBOT
vestal cave
#

Ah ... so it's the old one?

final iron
vestal cave
#

Is discord.py the obsolete, outdated one?

fresh iron
final iron
quick gust
vestal cave
final iron
quick gust
slate swan
quick gust
#

but yes master isn't published to the pypi

fresh iron
slate swan
#

they just meant that you should use codeblocks, read what they wrote in brackets

slate swan
#

its an outdated mirror

#

just use a fork tbh πŸ₯΄

#
@tasks.loop(seconds=600)
async def role_color():
    colorz = ["red", "green", "lime", "yellow", "purple", "orange", "blue"]
    guild = client.get_guild(756504534897000528)
    for role in guild.roles:
        try:
            for color in colorz:
                await role.edit(color=discord.Colour.color())
                print(role)
        except:
            pass
quick gust
#

jkjk

slate swan
#

Someone get this work :'(

#

uh

slate swan
quick gust
slate swan
#

did okimii get brozoned again?

slate swan
cold sonnet
#

atleast not an attack helicopter

#

jesus I'm fawked

tidal hawk
#

Does anyone have idea, how to create a invitation tracker on high traffic servers?

atomic zealot
#

Im trying to have my bot mention a person and a channel, but It keeps showing up as this instead of actually mentioning

cold sonnet
#

get the member object

#

and use member.mention

atomic zealot
#

ohh ok, thanks!

cold sonnet
#

and channel.mention on a TextChannel object

cold sonnet
#

so database

tidal hawk
#

That requires me to use guild.invites() a lot right?

cold sonnet
#

I think so

tidal hawk
#

But it gets rate limited

slate swan
#

wdym

tidal hawk
#

Had experience when it started returning None after few hours of running

#

I thought it got executed so many times that it stopped giving me results

quick gust
#

help guys :(

bot = commands.Bot(
    command_prefix=get_prefix,
    intents=disnake.Intents.all(),
    case_insensitive=True,
    is_owner=493344822900424714,
)```
```py
@tasks.loop(seconds=60)
async def change_pr():
    await bot.change_presence(
        activity=disnake.Activity(
            type=disnake.ActivityType.playing,
            name=f"With {len(bot.users)} members in {len(bot.guilds)} servers",
            status=disnake.Status.online,
        )
    )```

```yaml
Unhandled exception in internal background task 'change_pr'.
Traceback (most recent call last):
  File "/config/.local/lib/python3.8/site-packages/disnake/ext/tasks/__init__.py", line 167, in _loop
    await self.coro(*args, **kwargs)
  File "/config/workspace/main.py", line 45, in change_pr
    await bot.change_presence(
  File "/config/.local/lib/python3.8/site-packages/disnake/client.py", line 1428, in change_presence
    await self.ws.change_presence(activity=activity, status=status_str)
AttributeError: 'NoneType' object has no attribute 'change_presence'```
slate swan
quick gust
#

my main file

#

oh wait

slate swan
#

make sure to do it after the bot has started running

quick gust
#

at the end of the file

slate swan
#

yeah you should use wait_until_ready

haughty quartz
#

is there a way for me to make let my bot make changes to the code when run?

slate swan
#

!d discord.ext.commands.Bot.wait_until_ready

unkempt canyonBOT
#

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

Waits until the client’s internal cache is all ready.
slate swan
#

another alternative is passing the activity while initialising the bot

quick gust
haughty quartz
slate swan
#

if you dont need to change it

slate swan
quick gust
#

I was starting it before my run function lmfao

haughty quartz
slate swan
#

exts that have commands and listeners

haughty quartz
slate swan
#
@tasks.loop(seconds=10)
async def change_status():
    await client.change_presence(activity=discord.Activity(type=(next(activity)), name=(next(status))))
#

I use this, You can get the idea from it

slate swan
#

ur gonna get rate limited fast.

#

I never do...

#

You can change the seconds to 30

cold sonnet
#

still sounds bad

slate swan
#

I NEVER DO THO!

#

I swear I don't

#

the person is still confused what next is, bet

#
status = cycle(['SamTheNoob#4854', 'The Hub'])
activity = cycle([discord.ActivityType.listening, discord.ActivityType.watching])
#

:)

#

and where does the cycle comes from? you dont show how you import it from itertools

#
from itertools import cycle

#

here

#

and here we have, Making a discord Bot with python : Part <> ( Custom Status)

#

yez!

#

And making the bot pretending to watch the hub

#

its from lucas, if im not wrong

#

Well, I started watching his videos to learn python and making bots

#

But no...

#

and ill assume you start the task in on_ready too?

#

yes!

#

hm

#

It was my idea

#

I'm a weirdo

#

How would i make it so i can have all my commands in different files? like 1 file per command

#

use cogs

#

and make a cog per command

#

but why would you do that?

#

So then i could work on one command at a time without messing anything else up

quick gust
slate swan
#

how to send a message with discord py

#

?

slate swan
#

oh, someone's back πŸ‘οΈ

slate swan
slate swan
#

i should start bye now

slate swan
slate swan
slate swan
unkempt canyonBOT
#
class discord.ext.commands.Context(*, message, bot, view, args=..., kwargs=..., prefix=None, command=None, invoked_with=None, invoked_parents=..., invoked_subcommand=None, ...)```
Represents the context in which a command is being invoked under.

This class contains a lot of meta data to help you understand more about the invocation context. This class is not created manually and is instead passed around to commands as the first parameter.

This class implements the [`Messageable`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable "discord.abc.Messageable") ABC.
slate swan
#

and what this is used for @client.event

slate swan
#

what is the difference between @client.event and @commands.command()

#

@slate swan

#

one is a command thats in a cog and the other one is an event

#

cog?

#

its an ext that has commands and listeners

#

ext? @slate swan

leaden jasper
#

is there an event for when someone deletes their account?

slate swan
cold sonnet
#

!codeblocks

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.

cold sonnet
#

you put # instead of @ first line cryingCat

crystal cliff
tacit horizon
#

cannot import name 'menus' from 'discord.ext' (unknown location)

#

what is this

cold sonnet
#

well you didn't pass any id in the get_channel at the top either

crystal cliff
cold sonnet
#

why

crystal cliff
solemn holly
#
embed = discord.Embed(
        title = f'@{username}',
        url = f'https://www.instagram.com/{username}',
        color = discord.Color.purple()
    )

Does anyone know how to randomise the color of an embed?

cold sonnet
cold sonnet
unkempt canyonBOT
#
Not likely.

No documentation found for the requested symbol.

velvet tinsel
#

lmao

slate swan
#

well, it exists

slate swan
cold sonnet
#

!d discord.Colour.random

unkempt canyonBOT
#

classmethod random(*, seed=None)```
A factory method that returns a [`Colour`](https://discordpy.readthedocs.io/en/master/api.html#discord.Colour "discord.Colour") with a random hue.

Note

The random algorithm works by choosing a colour with a random hue but with maxed out saturation and value.

New in version 1.6.
slate swan
#

its ust not documented

velvet tinsel
#

wait wtf

slate swan
#

or the Color class is just a Subclass of Colour we can say

slate swan
crystal cliff
velvet tinsel
#

not american 😀

unkempt canyonBOT
#

disnake/colour.py line 326

Color = Colour```
slate swan
#

my life was a lie

crystal cliff
#

@cold sonnet help pls

velvet tinsel
#

Colour πŸ˜”

slate swan
#

its just an alias or an instance of the class

velvet tinsel
#

Color is way better

slate swan
#

no

#

its just a word

velvet tinsel
#

wanna mess

#

it's not a word

slate swan
#

im american

velvet tinsel
slate swan
#

lol

velvet tinsel
#

!ot

unkempt canyonBOT
slate swan
#

lol

cold sonnet
velvet tinsel
slate swan
#

it is a word

#

why would danny add it if its not a word

lethal moat
#

is it possible to get ctx like this when using slash commands? (i cant test it myself rn cuz my slash commands wont register for whatever reason)

@bot.slash_command(guild_ids=[GUILD_ID])
async def takegold_slash(ctx,interaction: Interaction, arg1: int = SlashOption(required=True), arg2: int = SlashOption(required=True)):
    arg1 = arg1.replace("<","")
    arg1 = arg1.replace(">","")
    arg1 = arg1.replace("@","")
    arg1 = arg1.replace("!","")
    if await PlayerSignUpChecker(arg1) == "no":
        await SignUpPlayer(arg1)
    await TakePlayerGold(ctx,arg1,arg2, prefix, owner_id)

*using nextcord

slate swan
#

just use interaction?

#

interaction has a send method

lethal moat
#

I need the author id at times too

#

how can i get the user id using interaction

slate swan
unkempt canyonBOT
lethal moat
slate swan
#

yes

slate swan
#

How do I make a warn command?

final iron
#

You should also add a system to remove the warns

#

Making a warn system is quite simple

slate swan
#

ok thanks

#

How would i setup a database tho

final iron
#

You just set it up

#

I don't understand what you're asking

slate swan
#

hes asking like how

#

first you need to learn sql than aiosqlite and then you make a db file with the sql browser and make a table and then youre good

lunar quail
#

Can someone find me where I am calling an int? literally can't find it
Here's file that the error occured :

import discord
import typing
from discord.ext import commands
from tools.enum_tools import CommandType, EmojiRubric


class enlarge(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.command()
    async def cmd_enlarge(self, ctx, *emotes: typing.Union[discord.PartialEmoji, str]):

        successful_additions = 0

        for index, i in enumerate(emotes):

            if not isinstance(i, discord.PartialEmoji):
                embed = discord.Embed(
                    title="That is not an custom emoji",
                    description=f"You need to give me an custom discord emoji!\nYou passed in : {i}",
                )
                await ctx.send(embed=embed)
                continue

            embed = discord.Embed(title=f"Enlarged view of {i.name}")
            embed.set_image(url=i.url)
            embed.set_footer(
                text=f"{index + 1} of {len(emotes)} to enlarge {'' if not (index + 1) == len(emotes) else '(over)'}"
            )

            successful_additions += 1
            await ctx.send(embed=embed)
        await self.bot.cache.command(ctx, CommandType.enlarge)
        await self.bot.cache.emoji_rubric(
            ctx, EmojiRubric.enlargement, successful_additions
        )


def setup(bot):
    bot.add_cog(enlarge(bot))
#

Here's the entire traceback :

Adding add.py from cogs...
Adding enlarge.py from cogs...
Adding list.py from cogs...
Adding meta.py from cogs...
Adding rename.py from cogs...
Successfully connected to the database
Cache is ready.
Successfully logged in as StackOverflow#8213
im called, type_of_command = <CommandType.enlarge: 'cmd_enlarge'>, type_of_command.value = 'cmd_enlarge'
Ignoring exception in command cmd_enlarge:
Traceback (most recent call last):
  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 173, in wrapped
    ret = await coro(*args, **kwargs)
  File "c:\Users\Achxy\Desktop\emoji-alchemist\cogs\enlarge.py", line 35, in cmd_enlarge
    await self.bot.cache.emoji_rubric(
TypeError: 'int' object is not callable

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

Traceback (most recent call last):
  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 882, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 910, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 182, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'int' object is not callable
slate swan
lunar quail
# slate swan ``` await self.bot.cache.emoji_rubric( TypeError: 'int' object is not callable `...

That's exactly what I thought at first too! but emoji_rubric is an function located somewhere and not an int.

    async def emoji_rubric(
        self,
        ctx: discord.ext.commands.context.Context,
        type_of_rubric: EmojiRubric,
        value_to_increment,
    ):
        """
        Accepts 2 positional arguments, command context and type of rubric respectively
        returns None
        Internally references increment_usage from database_tools
        """
        print(
            f"im called, {type_of_rubric = }, {type_of_rubric.value = }"
        )  # for debugging, remove afterwards, FIXME:
        await increment_usage(
            self.pool,
            ctx,
            type_of_rubric.value,
            value_to_increment,
            in_the_table="emoji_rubric",
        )
lunar quail
#

I have checked every line of code and did not find a single occurrence of calling an int

slate swan
#

Welp my bot will take 2 more week LOL

#

make it 3

cold sonnet
#

make it quick learning everything

slate swan
#

Kind of wish there was a way i could maybe have someone nice do it for me....

bold surge
#

sql is very gud tho

final iron
#

We don't give people code here

slate swan
#

keep wishing

final iron
#

Sql is very easy

slate swan
#

lol

slate swan
lethal moat
#

how do I use cooldown with slash commands?

slate swan
#

import discord
from discord.ext import commands
bot = commands.Bot(command_prefix="!")
@bot.event
async def on_ready():
print("I am ready.Let s do it!")
@bot.command()
async def coucou(ctx):
await ctx.send("Coucou")

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

slate swan
#
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix="!")
@bot.event
async def on_ready():
    print("I am ready.Let s do it!")
@bot.command()
async def coucou(ctx):
    await ctx.send("Coucou")
#

the bot sends me two Coucou messages

#

i dont know wh

#

restart

#

y

cold sonnet
#

did you run the code twice?

potent spear
#

because you have 2 instances running

slate swan
#

restart and retry

tidal hawk
#

r

slate swan
#

kill the code?

cold needle
#

is it possible to get the text from a webhook

#

with a discord bot

potent spear
cold needle
#

so it pings specific role

cold needle
slate swan
#

Wha

potent spear
slate swan
#

you did but i don't have the solution

potent spear
#

that's what happens when you crosspost

slate swan
slate swan
velvet tinsel
#

hi okimii

honest vessel
#

help me how i make command invade russia with my nato role

#

jk πŸ˜„ @velvet tinsel hi

#

i forgot give ukraine role, fixed

velvet tinsel
#

idc what the west say

rare saddle
#

How to give experience to a person when he is in a voice channel?

velvet tinsel
honest vessel
#

they say they dont care n coming for putin

velvet tinsel
#

then, you kill mobs

#

and get experience

#

πŸ‘

slate swan
velvet tinsel
velvet tinsel
#

im amazing at designing

#

I'm googling design ideas

rare saddle
# honest vessel by time

And how to determine how long he spent in the voice channel? And then how to make a condition that if a person sat there for 3 hours, then give out 50 xp

honest vessel
#

time em since joined vc n new timer wen mute - that? i dunno

#

@rare saddle u seem to get what u want theoratically just do it practically

honest vessel
#

count seconds

#

google how many sec in 3h

#

or 60*60*3

cold sonnet
#

jesus

#

I almost fainted

#

BRO

#

3600

honest vessel
#

bro

velvet tinsel
honest vessel
#

ye time of seconds for 3h

velvet tinsel
#

I'm confused

#

wdym by 3600

#

oh, you mean 60*60*3?

cold sonnet
#

he said 120*3 first, then 36*3

velvet tinsel
cold sonnet
#

now you can't delete that

honest vessel
velvet tinsel
honest vessel
#

i realised multiplication not addition duh

#

the formel was correct

#

move on

velvet tinsel
#

move on

cold sonnet
#

movin on

final iron
#

movin on

final iron
#

πŸƒ

limber isle
#

Hey, does anyone know about an open source alternative to statbot?

final iron
#

Not really what this channel is for

limber isle
#

And your name is not pep8 compliant, use snake case

final iron
#

No

limber isle
#

the channel is named discord bots but okay πŸ˜‚

#

I guess I will ask in offtopic or a help channel

final iron
#

"For questions and discussions relating to Discord bot development with discord.py and other relevant Python libraries."

#

Don't see where it says asking for alternatives to discord bots

limber isle
#

Let me rephrase. Is anyone aware of an alternative open source project to statbot? I would like to contribute to such project and its development but I can't find any

final iron
#

Nope

limber isle
#

Aight, cool, thanks x)

tidal hawk
#

Any tutorial out there, which teaches/gives tips how to organize files & optimize the bot?

soft vortex
cedar stream
#

Wrong one

soft vortex
#

Docs kinda wordy

#

Thanks anyways

cedar stream
#

It’ s almost only place I go to for dpy related stuff

soft vortex
#

I see

velvet tinsel
velvet tinsel
cedar stream
velvet tinsel
cedar stream
#

Self taught

#

Tho I have a teacher now

cedar stream
velvet tinsel
velvet tinsel
cedar stream
#

U play?

velvet tinsel
#

my teachers kinda weird tho

cedar stream
#

Ur fav genre?

cedar stream
velvet tinsel
#

I walk in for a lesson and she's like "I signed you up for a concert btw" and I'm like "...you what?"

cedar stream
#

LMFAOOO

velvet tinsel
cedar stream
#

Imagine

velvet tinsel
cedar stream
velvet tinsel
#

informal, duet and then big formal

velvet tinsel
cedar stream
#

So like classical?

velvet tinsel
#

mhm

cedar stream
#

Idk if I know a classical piece

velvet tinsel
#

I'm also doing don giovanni (if that's how you spell it) for the duet

#

I'm paired with a grade 8 (who's my friend)

#

I'm a low level grade 4 😦

cedar stream
velvet tinsel
#

I'm doing the grade 5 dis year tho

velvet tinsel
cedar stream
#

Idk how grades work but gl

cedar stream
velvet tinsel
#

liebestraum no.3 is amazingggg

#

and another song, idk how to spell it tho

cedar stream
#

Ill mby listen to it

#

Did u ever play blues

#

Also we are having a convo bout music in a discord bots channel

#

Mods wont appreciate it πŸ˜‚

velvet tinsel
#

LOL

#

wanna take it to DMs

cedar stream
#

Sure

velvet tinsel
#

before minaberry commits

#

!mute

cedar stream
#

LMFAOOO

slate swan
#

!ot

unkempt canyonBOT
velvet tinsel
slate swan
#

whats the best lib for disc bots rn?