#discord-bots

1 messages · Page 865 of 1

slate swan
#

3.7.x

boreal ravine
#

they gotta update it then

#

TypedDict probably is a new thing in typing

honest shoal
#

get works on bot's cache try fetch instead

slate swan
#

client.fetch_channel?

honest shoal
#

yes

slate swan
#

intents? both on dev portal and in your code ( inside commands.Bot too)

vale sierra
#
@bot.command()
async def help(ctx):
    embed = discord.Embed(title = "📚 **Listes des commandes**", description = "Je suis un bot discord polyvalent qui fait de la modération et d'autres choses amusantes et utiles.\n\n **Modération : ** \n +ban , +unban, +mute, +unmute, +clear\n **Fun : **\n +meme, +blague, +poids, +disquette", color = 0x636161)
    embed.set_author(name = "Maboulax", icon_url = "https://i.pinimg.com/236x/9b/09/5d/9b095de9260c33d3debdcb14d00c3b98--funny-monkey-pictures-funny-images.jpg", )

    await ctx.send(embed = embed) ``` Hello, i want my embed look like the left embed, but he looks like the right embed, how can i fix this ? (in my code i remove ``` this ``` bc discord don't know this is code)
slate swan
#

wait

#

i dont have intents enabled

honest shoal
#

enable them

slate swan
#

im an idiot

boreal ravine
vale sierra
#

ok

boreal ravine
#

👍

maiden field
boreal ravine
steel void
#

how to make a bot restart if it crashes

#

without systemd or stuff like that

maiden field
boreal ravine
#

oh

maiden field
honest shoal
steel void
#

i jusdt dont know why the bot is crashing

#

and dunno how to narrow it down

honest shoal
#

check errors

steel void
#

it shows no errors

#

it randomly goes offline and automatically comes back online while my other bots doesnt

honest shoal
#

where are you hosting

silent ermine
#

i have a command profile
When ever i run it , this error comes up

Command raised an exception: AttributeError: 'Member' object has no attribute 'avatar_url'```

My code: 

```py
    @commands.command()
    async def profile(self, ctx, member: nextcord.Member=None):
        if member is None:
            await ctx.send(f"{ctx.author.mention}, your profile picture is: {ctx.author.avatar_url}. \n\nLink: `{ctx.author.avatar_url}`")
        else:
            await ctx.send(f"{ctx.author.mention}, {member.name}'s profile is: {member.avatar_url}.")
#

Why does this happen ._. it also happens when i do ctx.guild.icon_url

steel void
#

winternode, and then tried to run it locally

steel void
#

both crashes every once in a while so it's not connection related

slate swan
#

!d discord.Member.avatar

unkempt canyonBOT
#

property avatar```
Equivalent to [`User.avatar`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.avatar "discord.User.avatar")
slate swan
#

and you gotta use .url on it

#

!d discord.Guild.icon

unkempt canyonBOT
#

property icon: Optional[discord.asset.Asset]```
Returns the guild’s icon asset, if available.
silent ermine
slate swan
silent ermine
slate swan
#

yessir

silent ermine
#

tysm

lost lichen
#

my check function doesnt seem to be working, its not printing anything in the console when i react, i cant seem to get it to work, any ideas why?

boreal ravine
proper tartan
lost lichen
proper tartan
lost lichen
#

no, error, there should be more stuff below the ^

proper tartan
#

now

lost lichen
#

did you import asyncio?

proper tartan
#

o I forgot

#

sorry and thank you

lost lichen
#

no problem

proper tartan
#

um

#

again problem

lone aurora
#

show code

proper tartan
#

oke

#
async def info(ctx):
    embed = discord.Embed(title=f"{ctx.guild.name}", description="more", timestamp=datetime.datetime.utcnow(), color=discord.Color.blue())
    embed.add_field(name="Server created at", value=f"27.01.2022")
    embed.add_field(name="Server Owner", value=f"NekoNeBitan")
    embed.add_field(name="Server Region", value=f"USA")

    await ctx.send(embed=embed)```
proper tartan
final iron
#

Can we see your entire file?

#

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

proper tartan
#

ou

#

@bot.command()
async def info(ctx):
embed = discord.Embed(title=f"{ctx.guild.name}", description="more", timestamp=datetime.datetime.utcnow(), color=discord.Color.blue())
embed.add_field(name="Server created at", value=f"27.01.2022")
embed.add_field(name="Server Owner", value=f"NekoNeBitan")
embed.add_field(name="Server Region", value=f"USA")

await ctx.send(embed=embed)
#

now?

final iron
#

No

#

Your entire file

proper tartan
#

oke

#

dm?

final iron
#

No

proper tartan
#

here

lost lichen
#

yes

#

or as the bot said

unkempt canyonBOT
slim lava
#

my Discord Bot has a glitchted image how can i fix this ?

proper tartan
slim lava
#

it is completely green but that is not how it is supost to look like ( a piced a random image from my hard drive)

proper tartan
#

i dont know

slim lava
#

hmmmm

proper tartan
#

@final iron

#

now?

slate swan
#

remove the help command in your bot constructor

lethal magnet
#

How can I do this in py? basically is if not 15+ members the bot leaves the guild

slate swan
proper tartan
slate swan
proper tartan
#

hvala kurcu

final iron
unkempt canyonBOT
#

4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.

slate swan
#

guys use english only

slate swan
lethal magnet
slate swan
proper tartan
final iron
slate swan
#

Dm

slate swan
unkempt canyonBOT
#

property members: List[discord.member.Member]```
A list of members that belong to this guild.
slate swan
#

!d discord.Guild.leave

unkempt canyonBOT
#

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

Leaves the guild.

Note

You cannot leave the guild that you own, you must delete it instead via [`delete()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.delete "discord.Guild.delete").
slate swan
#

there you gopithink

lethal magnet
#

thanks

slate swan
#

np

final iron
proper tartan
final iron
#

Strange

slate swan
#

the problem?

maiden field
#

/

final iron
slate swan
gusty fossil
#

Can someone point me to where in the python bot repo the bot parses and executes code passed with the !e command?

unkempt canyonBOT
#
Command: eval

Run Python code and get the results.

Source Code
manic wing
#

nvm i read that wrong

gusty fossil
kind cargo
#

anyone out to help me ?

manic wing
#

just post a question and someone will help you out

kind cargo
#

okay so : )

#

my problem is i try to make a bot with custom gif and custom name and custom number and custom amount, and it does not work

manic wing
slate swan
#

Guys i forgor python have something like "wait() (lua)"?

kind cargo
#

SWE

slate swan
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
kind cargo
#

sweden

slate swan
kind cargo
#

ok..

slate swan
#

wut if i want to make all my guilds id in guild_ids is it going to work?(500+ guilds)

slate swan
#

the global takes 1h :/

#

so

#

I don't know what difference like discord.py / nextcord.

Nextcord just changed name

slate swan
slate swan
slate swan
#

Ok

slate swan
#

disnake

#

no

#

why add all your guilds ids in the kwarg when you can just wait 1h for global?

quick gust
#

I'm a little confused, how did you-

slate swan
#

yeah it is

#

im talking abt the parameter in @client.slash_command

quick gust
#

spill the beans

slate swan
#

👍

quick gust
#

ah

slate swan
#

Nextcord sounds cool

silk mauve
#

Is it able that the embeds edites itself and change the timestamp?
Like a clock
You know what I mean? It changes the time

slate swan
#

u misunderstood me :P i want to do that cuz the "global" takes 1h

slate swan
#

just wait for 1 hour?

#

its not even 1h its an estimate

slate swan
slate swan
slate swan
slate swan
#

he ment put all the ids of the guilds the bot can see to that kwarg so he doesnt need to wait

#

just wait 1h lol

silk mauve
#

No

silk mauve
#

It just shows the time when you runned the command

slate swan
#

how do you get the guilds while defining test guilds....

silk mauve
#

It doesnt update it every minute

slate swan
#

bad

#

yeah but thats not the case hes just trying to avoid the global time

#

I like nextcord and pythonincident_actioned

slim ibex
#

🗿

slim ibex
#

I used to use nextcord

#

but I’m using disnake for my final discord bot that I’ll ever make

slate swan
#

I don't know why but my friend says that python slow s###

slate swan
slim ibex
#

compared to other languages, yes

slate swan
#

doesnt really even matter

slim ibex
#

but it’s not that much slower

#

if you want speed then don’t use Python in the first place

slate swan
#

a human can barely see the difference

silk mauve
#

hm

slate swan
slate swan
#

node?

#

idk maybe ms im not sure it depends on allot of things

#

bro ofc C is faster

#

C is like the base language lol

pliant gulch
#

Python is not slow because it's made in C, it's slow because it's interpreted

#

You have many operating systems made in C, they aren't slow

slate swan
#

yeah

#

btw andy wdym exactly by interpreted

#

and python is mostly used becaude its object oriented and a general language

slim ibex
#

Python is compiled too 🗿

#

But just compiled to allow the interpreter to read the code

halcyon onyx
#

hello

pliant gulch
#

Yea, but where as C compiles to ASM or machine code python compiles to bytecode which is then read by the VM

halcyon onyx
#

if i have value inside a def how i call it out side

slate swan
#

yeah

slate swan
silent portal
#

hi, can someone help me on how I can run multiple bot tokens? I wanted to loop through a .txt file and every Bot does a certain task. Is that possible?
I tried a few things but they don't seem to work..

slate swan
#

im not sure if you should

#

you shouldn't

manic wing
slate swan
#

cloudfare would ratelimit your ip easily

slate swan
manic wing
slate swan
#

well you could.....but awkward depends on how and which value needs to be used from the function

halcyon onyx
#

@slate swan i fixed yesterday issue finally i will sleeeeeeeeeeeep

slate swan
#

bye byepithink

#

hi

maiden fable
#

Well yea, sort of. They gonna remove the GIL iirc

#

That's gonna speed up the programs which use CPU more (threading and multiprocessing)

pliant gulch
#

They are getting rid of the GIL?

manic wing
#

the what?

pliant gulch
#

Is python 3.11 still gonna be thread safe if they get rid of the GIL?

manic wing
#

whats the GIL

maiden fable
slate swan
pliant gulch
#

I'm assuming they would be changing some stuff of the GIL

maiden fable
pliant gulch
#

Removing it would make python not thread safe

#

Or unless they add another safe-guard

maiden fable
#

This is what they are doing iirc

maiden fable
devout iris
#

is there a way we can get the ids of all users in a specific role?

#

i.e if members have "police" role, bot will write these users id.

lament mesa
maiden fable
#

Oh

slate swan
unkempt canyonBOT
slate swan
#

use list comp to get ids

ornate crater
#

was prob?

#

0 server..

#

intents ✅

#

🥲

kindred epoch
ornate crater
#

Because that's how I love it

slate swan
ornate crater
#

no..

slate swan
#

you gotta use some format shit

manic wing
#

just put the list inside the function

slate swan
ornate crater
#

3 minute?

slate swan
#

yeah that would probably be enough

ornate crater
#

but that much

slate swan
#

yes

pliant gulch
slate swan
pliant gulch
#

HTTP requests have dynamic ratelimits; gateway commands, E.g change presence don't

#

you can send 120 commands to the gateway within a 60 second timeframe

#

That simplifies down to 2/1s for the gateway

tidal hawk
#

Can you send text on top and below embed?

silent ermine
tidal hawk
#

<text>
<embed>
<text>

#

Mhm

silent ermine
#

make sure to make the embed!

slate swan
silent ermine
tidal hawk
#

That doesnt work

slate swan
#

wdym

silent ermine
tidal hawk
#

the okimii

silent ermine
slate swan
#

how wouldnt that work

quick gust
tidal hawk
#

You cant have non pos after pos

#

or however you call these

slate swan
#

ah yeah true

#

you cant have a positional argument after a kwarg

tidal hawk
#

Exactly

slate swan
#

just send another msg lol

slate swan
pliant gulch
slim ibex
#

andy 😳

pliant gulch
#

binds .

slate swan
#

moai binds🗿

slim ibex
#

lol

#

gotta start making a leveling system for my bot

slate swan
#

lol

slim ibex
#

i finally fixed my database connectioj problem too

pliant gulch
#

I kind of have an urge to make an SQL database with rust

#

Would unrust my rust skills

slim ibex
#

shit lemme join

#

(gotta learn rust first)

pliant gulch
#

I've made a lexer and parser in C++ for my own programming lang before, just gotta port that to rust and make it follow SQL rules

#

then figure out storage

slim ibex
#

i have this idea for an app that i've had for a while

#

just never really started it.

#

i am thinking of doing it with c# or rust

swift acorn
slate swan
slim ibex
#

its in the fucking docs you dumbass bot

swift acorn
#

lmao

slim ibex
#

!d discord.Member.avatar

unkempt canyonBOT
#

property avatar```
Equivalent to [`User.avatar`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.avatar "discord.User.avatar")
pliant gulch
#

😔

swift acorn
#
embed.set_author(name=bm, icon_url=str({member.avatar_url}))
#

I'm using it here and it doesn't work

wicked atlas
slim ibex
wicked atlas
#

I mean, it's valid, but odd

swift acorn
#

yea ik im not good at all

slim ibex
#

@pliant gulch ||would you be interested in making this app idea with me eventually?||

pliant gulch
swift acorn
scarlet aurora
#
  File "C:\Users\llVll\Desktop\TMG SB\main.py", line 126, in <module>
    bot.load_extension(f'cogs.{filename[:-3]}')
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.commands' raised an error: TypeError: decorator() got an unexpected keyword argument 'name'
PS C:\Users\llVll\Desktop\TMG SB> ``` ```py
@commands.command()
    async def help(self, ctx):
        await ctx.message.delete()
        await ctx.send("``ini\n[utils] utilities\n[fun] fun stuff\n\n[TMG - MIDVITE]``", delete_after=8)```
final iron
scarlet aurora
#

can someone tell me why this doesn't work

wicked atlas
swift acorn
# final iron Code?
@sotw.command()
@commands.has_permissions(administrator=True)
async def kick(ctx, member : discord.Member, *, reason=None):
  id = member.id
  bm = sotw.get_user(id)
  if reason == None:
    reason = 'Unspecified'
  embed = discord.Embed(
    description = 'Reason: **'+reason+"**",
    footer = f'Moderator: {ctx.author}',
    colour = discord.Colour.red()
  )
  embed.set_author(name=bm, icon_url={member.avatar_url})
rocky trench
#

how do I install an older version of dpy?

torn sail
final iron
#

Also those { are useless

scarlet aurora
# wicked atlas Can you send your whole `cogs/commands.py`?
import discord, pyfiglet, requests, io, aiohttp, warnings, colorama
from discord.ext import commands as commands
import random
import sys
from colorama import Fore
from pyfiglet import Figlet
import os
import requests 
from http.client import HTTPException


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

    @commands.command()
    async def help(self, ctx):
        await ctx.message.delete()
        await ctx.send("``ini\n[utils] utilities\n[fun] fun stuff\n[nsfw] self explanitory\n\n[TMG - MIDVITE]``", delete_after=8)

    @commands.command()
    async def utils(self, ctx):
        await ctx.message.delete()
        await ctx.send("``ini\n[cl] clears messages\n[ascii] (message)\n\n[TMG - MIDVITE]``", delete_after=8)




def setup(bot):
    bot.add_cog(commands(bot))
    ```
swift acorn
rocky trench
#

how do I install an old version of dpy???

swift acorn
final iron
wicked atlas
final iron
#

Then do print(discord.__version__)

swift acorn
scarlet aurora
final iron
swift acorn
final iron
#

Also you cannot name your cog commands

scarlet aurora
#

Commands?

final iron
#

Sure

final iron
swift acorn
#

what's traceback? MEESMILESWEAT6

final iron
#

!traceback

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.

rocky trench
#
@bot.command()
async def check(ctx,guildid = None):
    mmembers = []
    chars = [" ","Q","q","W","w","E","e","R","r","T","t","Y","y","U","u","I","i","O","o","P","p","A","a","S","s","D","d","F","f","G","g","H","h","J","j","K","k","L","l","Z","z","X","x","C","c","V","v","B","b","N","n","M","m","1","2","3","4","5","6","7","8","9","0","-","/",":",";","(",")","$","&","@","«",",",".",",","?","!","’","[","]","{","}","#","%","^","*","+","=","_","|","~","<",">","€","£","¥","•",".",",","?","!","’"]
    if guildid is None:
        guild = ctx.guild
    else:
        guild = bot.get_guild(int(guildid))
    
    for member in guild.members:
        for letter in member.display_name:
            if letter not in chars:
                if str(member.id) not in mmembers:
                    mmembers.append(str(member.id))
                    print(mmembers)
                if len(mmembers) > 100:
                    channel = bot.get_channel(943252762584547331)
                    new_list = (",".join(mmembers))
                    await channel.send(f'``{new_list}``')
                    mmembers.clear()
    if len(mmembers) > 0:
        channel = bot.get_channel(943252762584547331)
        new_list2 = ("\n".join(mmembers))          
        await channel.send(f'``{new_list2}``')
        mmembers.clear()``` this doesnt work for some chars tho, is there a way to just get all normal chars, punctionary and lowercase/uppercase and numbers?
final iron
#

!d string

unkempt canyonBOT
rocky trench
#

thats what im here for

scarlet aurora
#

so like that?

rocky trench
#

@final iron how would I check the name for chars?

final iron
#

🤷‍♂️

scarlet aurora
#

do i got to change anything else?

final iron
#

Shouldn't

swift acorn
final iron
#

This is impossible to read

swift acorn
#

its on replit it appears in small blocks like that 😭

scarlet aurora
# final iron Shouldn't
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\llVll\Desktop\TMG SB\main.py", line 119, in on_ready
    bot.load_extension("cogs.commands")
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.commands' raised an error: TypeError: decorator() got an unexpected keyword argument 'name'
#

still errored with that

wary zenith
wary zenith
#

they are flask logging

swift acorn
final iron
swift acorn
#

at least not when I run it

scarlet aurora
#

oooh

wary zenith
swift acorn
#

there are when I use the command

final iron
#

Send the traceback

wary zenith
#

when you use the command what happens?

scarlet aurora
# final iron Send the traceback
Traceback (most recent call last):
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\llVll\Desktop\TMG SB\main.py", line 119, in on_ready
    bot.load_extension("cogs.Commands")
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 676, in load_extension
    raise errors.ExtensionNotFound(name)
discord.ext.commands.errors.ExtensionNotFound: Extension 'cogs.Commands' could not be loaded.```
rocky trench
#
@bot.command()
async def check1(ctx,guildid = None):
    mmembers = []
    if guildid is None:
        guild = ctx.guild
    else:
        guild = bot.get_guild(int(guildid))
    
    for member in guild.members:
        for letter in member.display_name:
            if letter not in string.ascii_letters or string.digits or string.punctuation:
                if str(member.id) not in mmembers:
                    mmembers.append(str(member.id))
                    print(mmembers)
                if len(mmembers) > 100:
                    channel = bot.get_channel(943252762584547331)
                    new_list = (",".join(mmembers))
                    await channel.send(f'``{new_list}``')
                    mmembers.clear()
    if len(mmembers) > 0:
        channel = bot.get_channel(943252762584547331)
        new_list2 = ("\n".join(mmembers))          
        await channel.send(f'``{new_list2}``')
        mmembers.clear()```
#

so I tried this, but it doesnt seem to work. It returns all members...

#

@final iron any idea?

scarlet aurora
swift acorn
#

idk what I did but it worked tysm all of you lmao

wary zenith
scarlet aurora
#
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\llVll\Desktop\TMG SB\main.py", line 119, in on_ready
    bot.load_extension("cogs.commands")
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.commands' raised an error: TypeError: decorator() got an unexpected keyword argument 'name'
final iron
#

Is your filename commands?

scarlet aurora
final iron
#

Yeah change that

scarlet aurora
#

to?

final iron
#

Whatever you want

wary zenith
scarlet aurora
#

thanks man

final iron
#

Is it working?

scarlet aurora
#
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\llVll\Desktop\TMG SB\main.py", line 119, in on_ready
    bot.load_extension("cogs.maincommands")
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.maincommands' raised an error: TypeError: decorator() got an unexpected keyword argument 'name'
final iron
#

Can you send your entire maincommandsfile?

scarlet aurora
#
import discord, pyfiglet, requests, io, aiohttp, warnings, colorama
from discord.ext import commands as commands
import random
import sys
from colorama import Fore
from pyfiglet import Figlet
import os
import requests 
from http.client import HTTPException



#<--------------Commands Start-------------->
class Commands(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.command()
    async def help(self, ctx):
        await ctx.message.delete()
        await ctx.send("``ini\n[utils] utilities\n[fun] fun stuff\n[nsfw] self explanitory\n\n[TMG - MIDVITE]``", delete_after=8)

    @commands.command()
    async def utils(self, ctx):
        await ctx.message.delete()
        await ctx.send("``ini\n[cl] clears messages\n[ascii] (message)\n\n[TMG - MIDVITE]``", delete_after=8)
#<--------------Commands End-------------->


def setup(bot):
    bot.add_cog(commands(bot))
    ```
wary zenith
final iron
#

wut

scarlet aurora
#

ok i removed as commands

final iron
#
def setup(bot):
    bot.add_cog(commands(bot))
scarlet aurora
#

oh

wary zenith
final iron
scarlet aurora
# final iron It should be your class name
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\llVll\Desktop\TMG SB\main.py", line 119, in on_ready
    bot.load_extension("cogs.maincommands")
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.maincommands' raised an error: TypeError: decorator() got an unexpected keyword argument 'name'
#

i put it as my class name but this error is still here

final iron
#

Don't leave anything out

scarlet aurora
#

which file?

final iron
#

maincommands

scarlet aurora
final iron
#

Yes

#

Did you leave anything out?

scarlet aurora
#
import discord, pyfiglet, requests, io, aiohttp, warnings, colorama
from discord.ext import commands
import random
import sys
from colorama import Fore
from pyfiglet import Figlet
import os
import requests 
from http.client import HTTPException


#<--------------Commands Start-------------->
class Commands(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.command()
    async def help(self, ctx):
        await ctx.message.delete()
        await ctx.send("``ini\n[utils] utilities\n[fun] fun stuff\n[nsfw] self explanitory\n\n[TMG - MIDVITE]``", delete_after=8)

    @commands.command()
    async def utils(self, ctx):
        await ctx.message.delete()
        await ctx.send("``ini\n[cl] clears messages\n[ascii] (message)\n\n[TMG - MIDVITE]``", delete_after=8)




def setup(bot):
    bot.add_cog(Commands(bot))
    ```
young remnant
#

3

final iron
#

tbh idk them

scarlet aurora
final iron
#

No

#

Send everything

#

Absolutely everything

#

Leaving shit out is wasting both of our time

scarlet aurora
#

ill dm u a pastebin of it?

final iron
#

No

scarlet aurora
#

since its too big

final iron
#

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

final iron
#

@commands.command()(name="id")

#

See how much quicker this would have been if you just sent the entire file?

scarlet aurora
#

thanks

#

what do i change that to?

final iron
#

@commands.command(name="id")

#

Welp that was a waste of 20 minutes

scarlet aurora
#
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\llVll\Desktop\TMG SB\main.py", line 119, in on_ready
    bot.load_extension("cogs.maincommands")
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
    self._load_from_module_spec(spec, name)
  File "C:\Users\llVll\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.maincommands' raised an error: TypeError: decorator() got an unexpected keyword argument 'aliases'
``` changed it but same error
final iron
#

@commands.command()(aliases=["clear"])

scarlet aurora
#

oh ok

slate swan
#

oh is that what they did?

scarlet aurora
#

it worked

#

thanks @final iron

final iron
slate swan
#

could anyone help me with buttons i am using discord.py

final iron
#

Most people will be more inclined to help if they know what your question is immediately

slate swan
#

what is the most efficient and easiest way to make it so if a user clicks a button it's disabled for only them

using discord.py

wicked atlas
#

I don't think that's a thing you can do

#

You could try doing stuff with ephemeral messages

scarlet aurora
#

what does pycache do again?

#

its in the files and i just forget it's purpose

wicked atlas
scarlet aurora
#

oh ok

slim ibex
#

its compiled but the compiler doesn't check for code validity

#

as long as you have correct syntax, the code will compile and will run through the interpreter

#

so you can do some weird ass shit with python

slate swan
wicked atlas
#
0_0
slate swan
#

bro🗿

old gate
#

Hey is anyone around I'm trying command my bot to a specific message channel and It's not working in my current code

wary zenith
#

mongo

slate swan
#

can't click anymore

wary zenith
#

when stop interaction?

#

isnt there a timeout feature?

old gate
#

Need a pro's help over here DM me when your able

#

Here fine as well

#

@bot.command()
@commands.has_permissions(administrator=True)
async def flood(ctx, number, amount):
channel = bot.get_channel(946972661001650278)

hoary cargo
old gate
#

Its to send an announcement to another room

hoary cargo
#

Weird name and args just to send an announcement

old gate
#

i have the other part of the code disclosed

wary zenith
#

ye i sent it there too, wasnt sure where the problem is 😂

old gate
#

@bot.command()
@commands.bot_has_permissions(administrator=True)
async def green(ctx):
await ctx.message.delete()
await asyncio.sleep(1)
embed=discord.Embed(description="Condition Green Server Status", color=0x339933, timestamp=datetime.utcnow())
embed.set_footer(text=f"{ctx.author.name}#{ctx.author.discriminator}",icon_url=ctx.author.avatar_url )
await ctx.send(embed=embed)

#

say i want this to go to a certain channel how would i make it possible

#

Syntax errors

#

ignore my bottem part

#

thats just after i pruned out that shitty code

#

Its a scammer research bot

final iron
#

mhm

kindred drum
#

yo, how do I get member with on_raw_reaction_remove, payload.member returns None

old gate
#

Its my website

#

yep sending

unkempt canyonBOT
#

discord.on_raw_reaction_remove(payload)```
Called when a message has a reaction removed. Unlike [`on_reaction_remove()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_reaction_remove "discord.on_reaction_remove"), this is called regardless of the state of the internal message cache.

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

!rule 5

unkempt canyonBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

old gate
#

Its to warn people when we're sending out calls

final iron
#

Yeah sure

kindred drum
final iron
old gate
#

Oh we dont flood on discord

#

We have private servers

final iron
#

mhm

kindred drum
old gate
#

We call flood scammers

unkempt canyonBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

old gate
#

@bot.command()
@commands.bot_has_permissions(administrator=True)
async def green(ctx):
await ctx.message.delete()
await asyncio.sleep(1)
embed=discord.Embed(description="Condition Green Server Status", color=0x339933, timestamp=datetime.utcnow())
embed.set_footer(text=f"{ctx.author.name}#{ctx.author.discriminator}",icon_url=ctx.author.avatar_url )
await ctx.send(embed=embed)

final iron
unkempt canyonBOT
old gate
#

This isnt malious also we do it to scammers

final iron
#

Then you can

final iron
old gate
#

How to send a normal file to another folder then commanded in

#

Dude i shut down scammers

kindred drum
old gate
#

My team destroy's 200s of illegal call centres be day

#

Believe me i'm not malious

final iron
#

🥄

old gate
#

Not even a scam baiter saving people

final iron
old gate
#

Believe me i'm no hacker I just program pbx clouds and tech

#

No i respect it

#

No worry's guys

#

T-dos scammers

#

wow nothing wrong with that

final iron
#

The issue with writing code that floods scammers server is that it can easily be used against anyone

old gate
#

Not flooding servers

final iron
#

Theres no way of knowing what/who the code will be used against

kindred drum
# final iron 🥄

😭

guild = bot.get_guild(payload.guild_id)
user = await guild.fetch_member(payload.user_id)
           ```
all I needed was the payload.user_id
old gate
#

why do you take it all out of context

final iron
old gate
#

THats to steal ppls info

#

i dont want that shit

#

I dont do illegal or malicous stuff to anyone but scammers off discord. I was just apart of this group asking to make a simple announcement bot

#

Hope ya'll get scammed

lament depotBOT
#
**Do you think there's a way in which Discord could handle bots better?**

Suggest more topics here!

kindred drum
final iron
#

bot.get_guild returns a guild object

#

So you can use all the methods on it

slate swan
#

How can i set the channel Announcement to true / false

cedar stream
#

what do yall think the best and the worst forks of dpy are?

slim ibex
#

DISNAKE BEST

final iron
#

In my opinion Disnake is the best and pycord is the worst

slim ibex
#

pycord worst

manic wing
slim ibex
#

but the non forks are better than the forks

cedar stream
#

i agree that disnake is the best

#

and pychord worst

cedar stream
slim ibex
#

?

manic wing
#

he means non forks like rin and hikari

slim ibex
#

hikari, pincer, rin

cedar stream
#

i never used them

final iron
#

rin is the best wrapper

#

🙏

#

!pypi rin

unkempt canyonBOT
final iron
#

Don't start it again

wary zenith
#

oh ic

#

didnt realise

swift acorn
#

I'm trying to make the current time appear there in the footer but epoch time isn't working and I'm out of options

slim ibex
#

!d datetime.datetime.utcnow

unkempt canyonBOT
#

classmethod datetime.utcnow()```
Return the current UTC date and time, with [`tzinfo`](https://docs.python.org/3/library/datetime.html#datetime.datetime.tzinfo "datetime.datetime.tzinfo") `None`.

This is like [`now()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.now "datetime.datetime.now"), but returns the current UTC date and time, as a naive [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "datetime.datetime") object. An aware current UTC datetime can be obtained by calling `datetime.now(timezone.utc)`. See also [`now()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.now "datetime.datetime.now").

Warning

Because naive `datetime` objects are treated by many `datetime` methods as local times, it is preferred to use aware datetimes to represent times in UTC. As such, the recommended way to create an object representing the current time in UTC is by calling `datetime.now(timezone.utc)`.
slate swan
#

have you tried https://www.google.com

#

(joking)

#

can i see the code @swift acorn

unkempt canyonBOT
swift acorn
slate swan
#

Lol

swift acorn
#
@sotw.command()
@commands.has_permissions(administrator=True)
async def kick(ctx, member : discord.Member, *, reason=None):
  bid = member.id
  mid = ctx.author.id
  bm = sotw.get_user(bid)
  mod = sotw.get_user(mid)
  if reason == None:
    reason = 'Unspecified'
  embed = discord.Embed(
    description = '**Reason: **'+reason+f"""**

Moderator:** {ctx.author.mention}""",
    colour = discord.Colour.red()
  )
  embed.set_author(name=str(bm)+' has been kicked', icon_url=member.avatar_url)
  cet = ctime()
  embed.set_footer(text='User ID: '+str(bid)+' • Time: '+str(cet)+' UTC')
 
  try:
    await member.send('Goodbye, thanks for participating in the SOTW. 👋')
  except:
    print("Couldn't dm user, command executed with exception.")

  await ctx.send(embed=embed)
  await member.kick(reason=reason)
slate swan
#

not working

#
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object.</Details>
</Error>```
#

send it in codescript

final iron
#

You're not allowed to give help per rule 5

#

We've gone over this

final iron
#

🗿

slate swan
#

im not?

#

i used to

final iron
#

You currently are lmao

slate swan
#

but i dont use betterdiscord anymore lol

slate swan
final iron
slate swan
#

ah

wary zenith
#

instagram api

#

instagram api

slate swan
#

Why does the bot show the wrong member status? (there are intents)

silent ermine
#

how would i customize this error command to say that the bot is missing permissions?

slate swan
#

the bot shows the wrong status of the participants, like it is online, but it shows offline

#

@final iron

final iron
#

!d discord.Member.status

unkempt canyonBOT
#

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

Ok

#

already have try except :P it should pass this error,

slate swan
#

add it in discord.Embed()

swift acorn
#

That'll come in footer?

slate swan
swift acorn
#

Oh damn it was that simple

slate swan
#

you can use that or use the timestamp kwarg and use a datetime obj

slate swan
#

what are you trying to do?

wicked atlas
#

Also, that is a long python file

slate swan
#

use cogs lol

slate swan
slate swan
slim ibex
slate swan
#

¯\_(ツ)_/¯

slate swan
lyric tusk
#

when i tryd to pip install wavelink:
error: all wavelink ': The system does not find the specified file.

slate swan
wicked atlas
lyric tusk
# wicked atlas Can you show the full error output?

Fatal error in launcher: Unable to create process using '"C:\Users\AppData\Local\Programs\Python\Python39\python.exe" "C:\Users\AppData\Local\Programs\Python\Python39\Scripts\ pip.exe" install wavelink': The system does not find the specified file.

cold sonnet
#

can you easily use a postgres database from a cog?

#

does it get updated everytime something happens there?

#

meaning of the question:
does the main file pass database updates to the cog if the database is saved into a bot variable?

final iron
#

It does for sqlite3

#

Not sure about postgres though

cold sonnet
#

wait lemme give you some code if you can answer it then

final iron
#

They could probably help more

cold sonnet
#
import disnake
from disnake.ext import commands
import os
import asyncpg

bot = commands.Bot(command_prefix="!", intents=disnake.Intents.all(), help_command=None)

DB_SETTINGS = {
    #yeah no
}
bot.db = bot.loop.run_until_complete(asyncpg.create_pool(**DB_SETTINGS, ssl='require'))

for extension in os.listdir("cogs"):
    if extension.startswith("cog"):
        bot.load_extension(f"cogs.{extension[:-3]}")
        print(f"Loaded {extension[:-3]}")

bot.run("yeah no")
cold sonnet
#

it's not about the database rn

slate swan
cold sonnet
#

don't like to complicate it

slate swan
#

smhpithink

cold sonnet
#

shake your head quietly yert

#

and guess what

#

I don't subclass the help command either

final iron
#

Understandable

cold sonnet
#

now how do I compare postgres date to datetime.date.today() sadcat

final iron
#

Use timestamp

cold sonnet
#

no

final iron
#

🗿

cold sonnet
#

I don't want no hours

final iron
#

wdym

cold sonnet
#

I just need a day

#

and everyone in the server is Hungarian

#

no different timezones

#

<Record birthday=datetime.date(2004, 2, 27)>
I have to get the date out of this and turn it to
2022-02-27

#

-years

#

this will be weird

#

wait I'm dumb, it's because of the years

#

"SELECT id FROM users WHERE birthday = $1", datetime.date.today() this no work cuz of the years

#

I'm gonna go back to #databases before someone yells at me

final iron
#

<t:1644901200:d>

#

This good or are you just completely opposed to timestamps?

cold sonnet
#

completely opposed to timestamps

final iron
#

aight I guess

slate swan
#

How can i return 2 prefixes?
in the bot?

final iron
#

It's not a database

slate swan
#

ik is a file lol

#

but how can i return 2 prefixes? + my bot doesn't load that much data

#

json should be fine for now

final iron
slate swan
#

pretty sure json is fine in a small amount of data

#

anyways how can i return 2 diff prefixes?

final iron
#

JSON is just simply not a database

#

Doesn't matter the amount of data, it just isn't a database

#

It's meant for formatting data

slate swan
#

can i just get some help returning 2 diff prefixes?

final iron
#

Not with json

slate swan
#

i gotchu but pls brainmon

#

can i make another def for self prefix?

#

and load it like

#

command_prefix=get_prefix, self_get_prefix

final iron
#

Don't think so

slate swan
#

then how am i able to return 2 prefixes

final iron
#

🤷‍♂️

silent ermine
rotund creek
#

AttributeError: 'NoneType' object has no attribute 'is_finished'

slim ibex
#

why would you need two prefixes?

final iron
final iron
rotund creek
slate swan
slim ibex
rotund creek
#

It doesnt help

slim ibex
final iron
#

variable names should also be written in snake_case

slate swan
#

like the bot can have a certain prefix per the bot

rotund creek
silent ermine
slate swan
#

but authors can have a different one

slim ibex
#

yeah use a database

slate swan
#

let's say the guild has . but the member wants ,

final iron
#

Just use a database

slate swan
#

then both should work

slim ibex
#

no that’s not how it works

slate swan
#

BRO MY ISSUE IS LOADING THE PREFIX

final iron
#

Oh

final iron
silent ermine
rotund creek
#

Json gets corrupted so easily

final iron
rotund creek
#

And is not considered a db

silent ermine
rotund creek
slim ibex
#

Use a database, in your prefix function use a query that fetches the prefix for that guild and you can used when_mentioned_or I believe it is

#

such as:

def get_prefix(self, bot, message) -> str:
  prefix = self.db.field('''SELECT prefix FROM guilds WHERE guild_id = $1''', message.guild.id)
  return when_mentioned_or(prefix)(bot, message)
rotund creek
#

@final iron can you really help with my problem though

final iron
oblique laurel
#

Is there a reason to save data to a database vs a file?

slim ibex
rotund creek
final iron
final iron
oblique laurel
oblique laurel
slim ibex
#

databases can specify relationships between data

rotund creek
#

Ok anyways dont need help from a guy who acts like a child for something that doesnt affect the code

final iron
# oblique laurel Ye

txt files are simply not databases. They don't have all the features databases have to offer and they are a lot harder to get data from

slim ibex
#

and its more organized

slim ibex
#

your python code should follow pep8.

oblique laurel
#

Not even gonna ask what his problem is lol

rotund creek
#

It doesnt affect outcome

slim ibex
#

it doesn't matter. thats how python is supposed to be written

final iron
rotund creek
#

Dont care

slim ibex
#

what is your issue anyways?

final iron
#

How am I supposed to help you if I can't read your code

#

🤷‍♂️

rotund creek
#

How does it affect readability

oblique laurel
rotund creek
#

How do people who code in other languages like dart, read dart?

slim ibex
#

what the fuck is this code

final iron
rotund creek
#

Okay so whats the difference

#

Ugh im not even gonna argue

oblique laurel
#

Will say tho, sometimes smth like black is more applicable

slim ibex
#

there is a lot wrong with this code

#

__init__ doesn't take ctx

#

interactions use Interaction not ctx iirc

rotund creek
#

I passed ctx myself for a reason

slim ibex
#

interaction replaces ctx

final iron
#

This code is completely unreadable smh

slim ibex
#

legit

#
class HelpView(nextcord.ui.View):
    def __init__(self, help_cmd: "HelpCommand", options: list[nextcord.SelectOption], *, timeout: Optional[float] = 120.0):
        super().__init__(timeout=timeout)
        self.add_item(HelpDropdown(help_cmd, options))
        self._help_cmd = help_cmd

    async def on_timeout(self):
        self.clear_items()
        await self._help_cmd.response.edit(view=self)

    async def interaction_check(self, interaction: nextcord.Interaction) -> bool:
        return self._help_cmd.context.author == interaction.user

compare this old view of mine, to that

#

idk whats the point of self.children[0], etc

final iron
#

Can't you just use | instead of optional?

slim ibex
#

i would try to refactor this code

cold sonnet
#

oof nubbyman use variables and for loops

#

this is yandere dev mode

rotund creek
#

There is a difference between pycord and nextcord

cold sonnet
#
            self.children[0].style = discord.ButtonStyle.green
            self.children[1].style = discord.ButtonStyle.green
            self.children[2].style = discord.ButtonStyle.green
            self.children[0].disabled = True
            self.children[1].disabled = True
            self.children[2].disabled = True
slim ibex
final iron
#

When was | released?

slim ibex
#

plus Optional[some_type] is the same as Union[some_type, None]

final iron
#

3.10?

slim ibex
#

i think so

#

for type hints

final iron
#

Oh I gotta talk to okimii then

#

He changed Optional[] to | so it will break our package's backward compatibility

wary zenith
slim ibex
#

i might be wrong though

rotund creek
#

I give up you guys judging my code instead of helping

slim ibex
#

!pep 604

unkempt canyonBOT
#
**PEP 604 - Allow writing union types as ``X | Y``**
Status

Accepted

Python-Version

3.10

Created

28-Aug-2019

Type

Standards Track

wary zenith
slim ibex
#

yeah it was 3.10

final iron
#

Yeah I got to talk to okimii

rotund creek
#

When was 3.10 created

#

2019?!?

slim ibex
#

some time last year

#

!pep 619

unkempt canyonBOT
#
**PEP 619 - Python 3.10 Release Schedule**
Status

Draft

Python-Version

3.10

Created

25-May-2020

Type

Informational

rotund creek
#

Nice

final iron
#

Fix the class/function/variable naming at least

wary zenith
#

!pep 69

unkempt canyonBOT
#
PEP not found

PEP 69 does not exist.

wary zenith
#

rlly?

#

why not

#

!pep 8

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

Active

Created

05-Jul-2001

Type

Process

final iron
#

pep8 🙏

wary zenith
#

21 years ago 😭

final iron
rotund creek
#

Okay

final iron
#

Your indentation is also completely out of wack but I'll let it slide

rotund creek
#

Im done tho

final iron
#
        self.first_user = firstUser
        self.second_user = secondUser
        self.first_choice = firstChoice
#

Still using camelCase here

rotund creek
#

Fuck

#

Didnt see that

final iron
#

You can just do find and replace

rotund creek
#

How

final iron
#

pycharm has that feature

#

Let me open it real quick

rotund creek
#

Im on ipad

#

But i fixed those issues

#

I think I got everything

final iron
#

Alright send your full traceback then

rotund creek
#

It doesnt allow copy

#

Bad quality

slate swan
#
async def get_prefix(bot, message):
    author = message.author.id
    guild = message.guild.id
    try:
        with open(prefix_path, "r")as f:
            prefixes = json.load(f)
    except FileNotFoundError:
        prefixes = {}

    try:
        with open(self_prefix_path, "r")as f:
            self_prefixes = json.load(f)
    except FileNotFoundError:
        self_prefixes = {}

    if str(guild) not in prefixes:
        return commands.when_mentioned_or(".")(bot, message)
    elif str(guild) in prefixes:
        return commands.when_mentioned_or(*prefixes.get(str(message.guild.id)))(bot, message)
    
    elif str(author) in self_prefixes:
        return commands.when_mentioned_or(*prefixes.get(str(message.author.id)))(bot, message)
    else:
        return commands.when_mentioned_or(".")(bot, message)

angel = slash_util.Bot(
    command_prefix=get_prefix,
    intents=discord.Intents.all(),
    case_insensitive = True,
    help_command=None
    )
#

wait

rotund creek
#

@final iron how should I send traceback

slate swan
#

ik the issue nvm

rotund creek
#

Will photo be fine

slate swan
#
async def get_prefix(bot, message):
    author = message.author.id
    guild = message.guild.id
    try:
        with open(prefix_path, "r")as f:
            prefixes = json.load(f)
    except FileNotFoundError:
        prefixes = {}

    try:
        with open(self_prefix_path, "r")as f:
            self_prefixes = json.load(f)
    except FileNotFoundError:
        self_prefixes = {}

    if str(guild) not in prefixes:
        return commands.when_mentioned_or(".")(bot, message)
    elif str(guild) in prefixes:
        return commands.when_mentioned_or(*prefixes.get(str(message.guild.id)))(bot, message)
    
    if str(author) in self_prefixes:
        return commands.when_mentioned_or(*self_prefixes.get(str(message.author.id)))(bot, message)
    else:
        return commands.when_mentioned_or(".")(bot, message)

angel = slash_util.Bot(
    command_prefix=get_prefix,
    intents=discord.Intents.all(),
    case_insensitive = True,
    help_command=None
    )
#

why the self prefix still not loading?

slate swan
final iron
#

Never mind

slate swan
slate swan
slate swan
#

that's not my question

final iron
#

But it's my question

slate swan
#

imma join with main acc

dry kelp
#

such a huge difference

slate swan
dry kelp
#

right?

rotund creek
#

@final iron

dry kelp
rotund creek
#

You never answered my question

dry kelp
#

u can include / commands

final iron
slate swan
slate swan
wary zenith
#

i thought they were the same

dry kelp
#

normal commands work too

wary zenith
#

oh well

cold sonnet
slate swan
#
camelCase
PascalCase
snake_case
wary zenith
rotund creek
cold sonnet
#

where do you use camelCase

slate swan
wary zenith
dry kelp
cold sonnet
slate swan
final iron
rotund creek
dry kelp
#

so why tf is the self prefix not loaaadinggg????

final iron
slate swan
#

enum......

rotund creek
#

@final iron why you not helping

rotund creek
slate swan
final iron
cold sonnet
slate swan
unkempt canyonBOT
#

@slate swan :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | AttributeError: 'NoneType' object has no attribute 'strip'
rotund creek
#

@slate swan how is it none

final iron
#

!e

from __future__ import braces
unkempt canyonBOT
#

@final iron :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 | SyntaxError: not a chance
slate swan
rotund creek
#

Let me type

slate swan
#

🗿

rotund creek
#

await interaction.followup.send("nothing", embed = embed, view = None)

#

Thats where error is

dry kelp
#

@final iron help

tacit storm
rotund creek
#

Wdym

slate swan
#

it raised an error on a is_finished attr

final iron
#

Also this

dry kelp
#
async def get_prefix(bot, message):
    author = message.author.id
    guild = message.guild.id
    try:
        with open(prefix_path, "r")as f:
            prefixes = json.load(f)
    except FileNotFoundError:
        prefixes = {}

    try:
        with open(self_prefix_path, "r")as f:
            self_prefixes = json.load(f)
    except FileNotFoundError:
        self_prefixes = {}

    if str(guild) not in prefixes:
        return commands.when_mentioned_or(".")(bot, message)
    elif str(guild) in prefixes:
        return commands.when_mentioned_or(*prefixes.get(str(guild)))(bot, message)
    
    if str(author) not in self_prefixes:
        return commands.when_mentioned_or(".")(bot, message)
    elif str(author) in self_prefixes:
        return commands.when_mentioned_or(*self_prefixes.get(str(author)))(bot, message)

angel = slash_util.Bot(
    command_prefix=get_prefix,
    intents=discord.Intents.all(),
    case_insensitive = True,
    help_command=None
    )
rotund creek
dry kelp
rotund creek
slate swan
rotund creek
#

But why is it none

#

What do I do to unnone

dry kelp
final iron
dry kelp
#

this man

slate swan
#

dont start again

dry kelp
#

"why are u using json"

tacit storm
dry kelp
#

"why are u on a alt"

slate swan
#

guys

tacit storm
#

dont start this shit again

dry kelp
#

bro that's none of your business so STOP

slate swan
#

3ban can you stop?

dry kelp
#

my question was pretty simple.. why the self prefix won't load

rotund creek
#

Well pep8 got a point

slate swan
#

ok jeez ignore

rotund creek
#

Json is dumb

dry kelp
final iron
rotund creek
#

Json should be deleted

final iron
#

No

tacit storm
#

ok everyone arguing about the stupid shit about json, shut up.

final iron
#

JSON is incredibly useful for formatting

rotund creek
#

All youtube videos that use json as storage should be deleted

tacit storm
#

this is not the channel for arguing and rather a channel for discord bots

both of you stop or ill call a a moderator.

dry kelp
sick birch
#

Alright guys calm it down

dry kelp
#
async def get_prefix(bot, message):
    author = message.author.id
    guild = message.guild.id
    try:
        with open(prefix_path, "r")as f:
            prefixes = json.load(f)
    except FileNotFoundError:
        prefixes = {}

    try:
        with open(self_prefix_path, "r")as f:
            self_prefixes = json.load(f)
    except FileNotFoundError:
        self_prefixes = {}

    if str(guild) not in prefixes:
        return commands.when_mentioned_or(".")(bot, message)
    elif str(guild) in prefixes:
        return commands.when_mentioned_or(*prefixes.get(str(guild)))(bot, message)
    
    if str(author) not in self_prefixes:
        return commands.when_mentioned_or(".")(bot, message)
    elif str(author) in self_prefixes:
        return commands.when_mentioned_or(*self_prefixes.get(str(author)))(bot, message)

angel = slash_util.Bot(
    command_prefix=get_prefix,
    intents=discord.Intents.all(),
    case_insensitive = True,
    help_command=None
    )
#

self prefix won't load

sick birch
#

I'm guessing it's getting a FileNotFoundError

dry kelp
#

the path for prefix file work

sick birch
#

Also open() is blocking, use aiofiles instead

dry kelp
#

which is almost the same thing

sick birch
#

what's the difference between prefix_path and self_prefix_path?

dry kelp
#

@sick birch u here?

sick birch
#

yeah, but I'm not sure what the difference is between those 2 files

dry kelp
#

loading 2 different files

#
  1. {guild id : prefix}
slate swan
#

I believe prefixes is the servers prefix and self prefixes is just a separate user prefix

dry kelp
#
  1. {author id : prefix}
slate swan
#

Yeah I thought so

slim ibex
#

i honestly don't know how you will pull off prefixes for a certain user

slate swan
#

It’s hard but it’s possible

slate swan
#

Wdym

dry kelp
sick birch
slate swan
#

pulling a custom prefix for each user in a db

slim ibex
#

^

slate swan
#

Yeah ik

sick birch
slim ibex
#

there is really no point to do so. what benefit does it bring?

slate swan
#

thats why i dont do custom prefixes

#

its useless

slate swan
sick birch
#

at one point you're going to have to make up some insane prefixes because it's gonna be taken by others

slim ibex
#

but its extra work that isn't needed

dry kelp
sick birch
#

I don't think it's the most user intuitive thing but if you really want to go ahead

slate swan
slim ibex
#

like how do you deal with two users having the same prefix

slate swan
#

Maybe some people don’t have that key for the server prefix so they use a custom user prefix like damn how y’all so brain dead?

dry kelp
slim ibex
#

oh shit i said something controversial

hushed field
#

wtf is happening

sick birch
#

@dry kelp to answer your original question, add a print statement to the except that way we can narrow it down to a pathing issue

slate swan
slate swan
#

depends on internet cache and much else

dry kelp
final iron
slate swan
dry kelp
dry kelp
#

TELL ME DO U KNOW WHAT IT DOES

final iron
dry kelp
#

fucking dumbass talking shit

sick birch
#

guys please

slate swan
slim ibex
#

ok this turned around quick;y

slate swan
sick birch
#

keep it down

slate swan
#

bro what

dry kelp
#

some of y'all are just a pain bruh

slim ibex
#

now bros attacking me for wondering about user prefixes💀