#discord-bots

1 messages · Page 903 of 1

stone beacon
#

It's @client.event

junior verge
#

yea

supple thorn
#

Theres no ()

stone beacon
#

No parenthesis for that decorator

junior verge
#

Alright

#

It should be installed?

#

Anyone?

stone beacon
#

Bad news for ya m8

junior verge
#

Uh

stone beacon
#

If I remember correctly, the devs of that package changed the name

junior verge
#

To?

stone beacon
#

They had a massive overhaul and changed the entire package

junior verge
#

So how do I get slash commands to work lol

stone beacon
#

try discord-interactions-py on pypi

rocky trench
#

No point of using an external slash library anymore

stone beacon
#

So you have a couple options. Either use the old old version of that package which they've discontinued support for, use their updated package or just use discord v2 I think

rocky trench
#

Dpy 2.0 has pretty easy / commands, else use slash_util

#

slash_util was featured by dpy community before dpy 2.0 got resumed

stone beacon
#

Think I switched to nextcord like 2mths ago. Thankfully, it's 99.95% the same syntax and it installs discordv2 along with it I think

#

So I'm good

rocky trench
#

Yeah

narrow grail
#

is there a methode to host my disocrd bot with my old mobile phone?

slate swan
#

oh nvm

vale wing
narrow grail
# slate swan oh nvm

many people host their bot on their pc but i want to do this with my old phone

vale wing
#

PC is not suitable for hosting unless you leave it on 24/7

#

VPS is the best option

narrow grail
vale wing
#

Replit is bad

slate swan
#

replit ew

narrow grail
vale wing
#

Most of them no but you can get free credits

junior verge
narrow grail
vale wing
unkempt canyonBOT
narrow grail
#

thanks

slate swan
#

isnt dpy ending

boreal ravine
#

no

#

it's starting

boreal ravine
#

d.py's application commands are not stable yet

rocky trench
slate swan
#

How do I implement slash commands then?

rocky trench
boreal ravine
cold sonnet
#

will be stable

boreal ravine
#

"will" :)

cold sonnet
#

dpy has always had the best quality by far

#

I don't even think it will take much time

#

Danny's gotta catch up aswell after that drama

#

and how original the dpy devs always are

#

I love it

boreal ravine
narrow grail
modest plover
#

Is it an android?

narrow grail
#

or how

#

yes

modest plover
#

Ok, so you need to use:
Termux (download from F-Droid, not play store)
A GitHub account
That's about it.

#

Also probably a code editor just incase, I'd say probably Acode

manic wing
#

its so funny cloning linux

#

so
much
stuff

whole shoal
modest plover
#

Once you have them, open Termux and do the following in order:
termux-setup-storage (press allow when it pops up)
termux-change-repo pick grimler
pkg install build-essential (if it fails, it's build-essentials idk it's one of the two)
pkg install python
pkg install git

narrow grail
modest plover
#

Get to there then lmk, don't want to overcomplicate it to all fuck right off the bat

#

Also I recommend making a folder in your phone titled bots just so you can put the code there

narrow grail
#

yeah

#

thanks man @modest plover

modest plover
#

Once you have all of them,
You need to setup git to actually get the files from whenever you edit the code on presumably a pc.

light violet
#

Does anybody know aiosonic

#

K

jolly basalt
#

How do I send a video

#

just

vid = discord.File(path)

?

#

cuz that aint working

modest plover
#

To do that, it's this
git config --global user.name "username"
git config --global user.email "example@example.com"

modest plover
jolly basalt
#

ok imma read the docs

supple thorn
#

!d discord.ext.commands.Context.send

light violet
#

💩

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

Sends a message to the destination with the content given.

The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.

To upload a single file, the `file` parameter should be used with a single [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`File`](https://discordpy.readthedocs.io/en/master/api.html#discord.File "discord.File") objects. **Specifying both parameters will lead to an exception**.

To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects. **Specifying both parameters will lead to an exception**.
supple thorn
#

Don't you use the file kwarg to send video files

light violet
#

Ping sarthak

supple thorn
#

@jolly basalt

light violet
#

Bruh is he sarthak

#

Bruhhhh........

supple thorn
#

Why would i ping sarthak

light violet
#

I need his dm

#

I couldnt find it

supple thorn
#

So

#

Why are you asking people to randomly ping sarthak here

light violet
#

What is his nick here

supple thorn
#

I'm pinging lonely cause of his question

supple thorn
jolly basalt
supple thorn
#

Did you try to use the file kwarg in the ctx.send()?

jolly basalt
#

i kinda fixed it soooo

slate swan
#

👀

jolly basalt
light violet
#

@slate swan hey bro i needed a help

slate swan
slate swan
#

what's the file variable

jolly basalt
#

the downloadvideo func is just basic pytube stuff

slate swan
#

so does it save the video locally or in-cache?

jolly basalt
#

locally

#

i write bad code, please don't make fun of me

slate swan
#

what name does it get saved with?

jolly basalt
slate swan
#

may i see your downloadvideo function?

jolly basalt
slate swan
#

ight, gimme a moment ill check the docs

jolly basalt
#

okie

#

and also, I had imported YouTube from pytube

jolly basalt
slate swan
jolly basalt
#

there is a testpaper now XD

supple thorn
slate swan
#

alright, ping me later if you need help with it

jolly basalt
slate swan
jolly basalt
#

it's on desktop

jolly basalt
slate swan
junior verge
#
import discord
from discord.ext import commands


class Ping(commands.Cog):

    def __init__(self, client):
        self.client = client

    @commands.Cog.listener()
    @commands.command()
    async def ping(self, ctx):
        await ctx.send(f'Pong! **{round(self.client.latency * 1000)}**ms')

def setup(client):
    client.add_cog(Ping(client))
``` Why doesn't this work
slate swan
#

since the vide has \ in the title, and in computers means directory

supple thorn
#

You have a listener

#

@junior verge

junior verge
#

oops

#

I just did not see that lmao

#
import discord
from discord.ext import commands

class Avatar(commands.Cog):

    def __init__(self, client):
        self.client = client

    @commands.command(name='Avatar',aliases=["av"])
    async def avatar(self, ctx, *,  avamember : discord.Member=None):
        userAvatarUrl = avamember.avatar_url
        await ctx.send(userAvatarUrl)

def setup(client):
    client.add_cog(Avatar(client))
``` hm?
light violet
# slate swan am not checking dms though

i need to make a command with wich the bot inters through guild channels and automatically detects multiple channels i.e. channels with same name and delete them

#

how to do that

slate swan
unkempt canyonBOT
light violet
slate swan
#

I can't find the serverinfo and userinfo code to send them in embed can you help me ?

honest vessel
#

@junior verge avatar.url

slate swan
#

I can't find the serverinfo and userinfo code to send them in embed can you help me ?

junior verge
honest vessel
junior verge
honest vessel
#

ye

junior verge
#

userAvatarUrl = avamember.avatar.url Like that?

maiden fable
#

Yea

junior verge
#

calm ty

honest vessel
#

@junior verge but why u make a cog for each command

#

u can have like users or info as cogname n have avatar as command n add more related commands about user/info in same cog

honest vessel
#

he wants spoonfeed codes?

supple thorn
#

If you don't mention a member of course the avatar_url won't work

#

Because you made it default to None

cold sonnet
fervent surge
#

so, in dyno and stuff, there is this feature where if you react to a pre-programmed message (say reaction roles) twice, your first selection is gone, how would you replicate such behaviour?

slate swan
#

!d discord.Message.reactions

unkempt canyonBOT
slate swan
#

!d discord.Message.clear_reaction

#

oh wait

slate swan
unkempt canyonBOT
#

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

Remove a reaction by the member from the message.

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

If the reaction is not your own (i.e. `member` parameter is not you) then the [`manage_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission is needed.

The `member` parameter must represent a member and meet the [`abc.Snowflake`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Snowflake "discord.abc.Snowflake") abc.

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

Imagine

slate swan
royal jasper
#

when i try to run a await ctx.guild.unban(user, reason=None) the bot return CommandInvoke error, can anyone help me?

flat solstice
#
class user(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    user = app_commands.Group(name="users", description="Check User stuff.", guild_ids=[default_guild])
    async def _userinfo_(self, interaction, member):
        member = interaction.user if member is None else member
        embed = Embed(title = f"{member}", description = f"Status: **{member.status}**\n*{member_status}*", colour = member.colour)
        await interaction.response.send_message(embed=embed)

    @user.command()
    @app_commands.describe(member="The discord member to get information for.")
    async def info(self, interaction: Interaction, member: Union[Member, User]):
        await self._userinfo_(interaction, member)

@app_commands.context_menu(name="User Info")
async def userinfo(interaction: Interaction, member: Member):
    await self._userinfo_(interaction, member)
    

def setup(bot):
    bot.add_cog(user(bot))
    bot.tree.add_command(userinfo, guild=discord.Object(id=default_guild))```okay so i have this `_userinfo` func that I call inside of my app command and that I want to call inside of my context menu, but context menu's don't have self so I get an error that self is not defined (understandable) when I call the function as the context menu. I then took the `_userinfo_` func out of the class and am now calling it like `await _userinfo_()` in my menu and app command and this raises an error saying `_userinfo_` is not defined
maiden fable
slate swan
maiden fable
slate swan
#

but you intelligent 😔 you should understand

junior verge
#
@client.event
async def on_ready():
    print('Daxbot is ready!')

    servers = len(client.guilds)
    members = 0
    for guild in client.guilds:
        members += guild.member_count - 1

    await client.change_presence(activity = discord.Activity(
        type = discord.ActivityType.watching,
        name = f'{servers} servers and {members} members'
    ))
            
``` Anything wrong with this?
maiden fable
#

I mean, I respect that u gave such an explained.... explanation, but still... Think about us low IQ people lemon_pensive

junior verge
#

What is

maiden fable
#

!d discord.Client.activity exists

unkempt canyonBOT
junior verge
#

hm?

maiden fable
#

hm?

junior verge
#

Don't get what's wrong

maiden fable
#

I meant, use that kwarg

#

(activity=discord.Acitivity(type=..., name=...))

junior verge
#

I don't see what I did wrong or different

#

ah

maiden fable
#

In the constructor

slate swan
#

on_ready pepecry

#

you shouldnt make requests in on_ready in the first place

maiden fable
#

That's why I told him about the kwarg

maiden fable
sage otter
#

also Client.users exists btw so you know you don’t have to do whatever you just did there.

junior verge
#

I still don't get it, sorry.

sage otter
#

Why do it it’s already done for you AMshrug

maiden fable
maiden fable
maiden fable
sage otter
# junior verge wym

Like you said, they both provide the same result. And it’s not like you need any modifications. So why not use what’s given.

maiden fable
#

Indeed

sage otter
junior verge
#

Done that now.

maiden fable
junior verge
#
@client.event
async def on_ready():
    print('Daxbot is ready!')

    servers = len(client.guilds)
    for guild in client.guilds:
        members += guild.member_count - 1

    await client.change_presence(activity=discord.Activity(type = discord.ActivityType.watching,name = f'{servers} servers and {client.users} members'))
            
sage otter
#

It’s users

junior verge
#

oh

sage otter
#

client.users

junior verge
#

yeah done

slate swan
#

@maiden fable how you gonna access the users in constructor though

maiden fable
#

Idk try doing:

bot = Bot(...) 
bot.activity = ... 
#

Tho this isn't gonna work, I'm 90% sure

junior verge
#

I mean mine used to work how I had it

sage otter
maiden fable
#

Hmm, just realized that should work

sage otter
#

I mean I think it would work.

maiden fable
#

didn't I say the same thing bro

flat solstice
# maiden fable I just.... lost a few braincells tryna comprehend what u doing here. Is there an...

I have this _userinfo_ func which sends a msg when it's run. I want to run this func inside of my @user.command() func (so I had _userinfo_ inside of my cog class) but I also run to run _ussrinfo_ from inside of my context menu however d.pys context menus can't be inside of classes (so it doesn't have self) so I can't put my userinfo` func inside of my cog class.

In short how do I run a async func that's not inside of my class?

slate swan
junior verge
#
@client.event
async def on_ready():
    print('Daxbot is ready!')

    servers = len(client.guilds)
    for guild in client.guilds:
        members += guild.member_count - 1

    await client.change_presence(activity=discord.Activity(type = discord.ActivityType.watching,name = f'{servers} servers and {client.users} members'))
            
``` So this should work?
maiden fable
slate swan
junior verge
#

Sure

slate swan
#

and members isnt defined

#

nor do you need that loop

junior verge
sage otter
slate swan
junior verge
#

How should I define members here

slate swan
junior verge
#

You just said it

slate swan
junior verge
#

What loop?

slate swan
junior verge
#

oh

#

thats just so the bot itself doesnt count

sage otter
#

Oh wait. You should probably call len on bot.users

#

That’s definitely not gonna be good if you don’t

slate swan
flat solstice
junior verge
#
@client.event
async def on_ready():
    print('Daxbot is ready!')

    servers = len(client.guilds)

    await client.change_presence(activity=discord.Activity(type = discord.ActivityType.watching,name = f'{servers} servers and {client.users} members'))
            
``` Just that then?
slate swan
#

plus who cares if a number is lesser or more shrug

junior verge
#

Idk yay

sage otter
#

len(client.users)

junior verge
#

That will just go as text, uhm

#

Kinda confused

waxen python
#

say i have an embed that reaches the 6000 char limit, what would be the best way to get a 2nd, 3rd, 4th etc embed sent (i dont want to do pages).
I currently have:

            channel = self.client.get_channel(943393646248591361)
            msg = await channel.fetch_message(952383491457286214)
            async with aiosqlite.connect("database.db") as db:
                guild = self.client.get_guild(607675165785980932)
                embed = discord.Embed(title="KB Current Status:")
                cursor = await db.execute('SELECT * FROM "kb-manage"')
                rows = await cursor.fetchall()
                for row in rows:
                    article = row[0]
                    lan = row[1]
                    assigned = row[2]
                    expire = row[3]
                    try:
                        assigned = guild.get_member(int(assigned))
                        assigned = assigned.mention
                    except:
                        assigned = "Unassigned"
                    status = row[4]
                    embed.add_field(name=f"**{article}**",
                                    value=f"Language: {lan} - Assigned: {assigned} - Status: {status} - Expire: <t:{expire}>", inline=False)
                    del article, lan, assigned, status
                embed.set_footer(text="Updated every 60 seconds.")
                await msg.edit(embed=embed)

but im reaching the limit, and would like to have more embeds sent.
Whats the best way to do this with what I have?

junior verge
#

If I would just write len{client.users} that wouldnt work

slate swan
junior verge
#

ah

#

let's see if it works

slate swan
junior verge
#

Thanks

narrow grail
#

What is the difference between discord.Client and commands.Bot?

sage otter
#

It’s like a really nice Tesla model S vs a old broken down Toyota Prius.

slate swan
slate swan
#

more than discord.Client

slate swan
sage otter
#

Watch out she’s gonna rule 7 you

maiden fable
slate swan
maiden fable
slate swan
maiden fable
slate swan
narrow grail
maiden fable
#

Lmao

junior verge
slate swan
#

ig so lmao

junior verge
#

ill see xD

slate swan
narrow grail
junior verge
slate swan
# narrow grail Is there an example like what you can also do what discord.Client can‘t

Bot is an extended version of Client (it's in a subclass relationship). Ie. it's an extension of Client with commands enabled, thus the name of the subdirectory ext/commands.

The Bot class inherits all the functionalities of Client, which means that everything you can do with Client, Bot can do it too. The most noticeable addition was becoming command-driven (@bot.command()), whereas you would have to manually work with handling events when using Client. A downside of Bot is that you will have to learn the additional functionalities from looking at examples or source codes since the commands extension isn't much documented. UPD: Now it is documented here.

If you simply want your bots to accept commands and handle them, it would be a lot easier to work with the Bot since all the handling and preprocessing are done for you. But if you're eager to write your own handles and do crazy stunts with discord.py, then by all means, use the base Client.

In case you're stumped by which to choose, I recommend you to use commands.Bot since it's a lot easier to work with and it's in addition of everything Client can already do. And please remember that you do not need both.

waxen python
slate swan
slate swan
junior verge
slate swan
slate swan
junior verge
junior verge
slate swan
waxen python
#
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(blahblah, intents=intents)

is how i used to do it.
I dont think intents.members = True is needed now

#
intents = discord.Intents.all()
client = commands.Bot(blahblah, intents=intents)
junior verge
#
import discord
import os
from discord.ext import commands
import json

intents = discord.Intents.all()
client = commands.Bot(command_prefix = ".", intents=intents)

with open("config.json", "r") as f:
  config = json.load(f)

@client.command()
async def load(ctx, extension):
    client.load_extension(f'cogs.{extension}')

@client.command()
async def unload(ctx, extension):
    client.unload_extension(f'cogs.{extension}')

for filename in os.listdir('./cogs/'):
    if filename.endswith('.py'):
            client.load_extension(f'cogs.{filename[:-3]}')

@client.event
async def on_ready():
    print('Daxbot is ready!')

    servers = len(client.guilds)

    await client.change_presence(activity=discord.Activity(type = discord.ActivityType.watching,name = f'{servers} servers and {len(client.users)} members'))
            
client.run(config["bot_token"])

slate swan
hazy oxide
#

Can someone help?

nextcord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In data.embeds0.thumbnail.url: Scheme "none" is not supported. Scheme must be one of ('http', 'https').  
unkempt canyonBOT
#

Pasting large amounts of code

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

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

slate swan
#

Guys how can i print first and second line with specific text using request and api
example
geoip = requests.get("https://api.hackertarget.com/geoip/?q="+ arg1)

slate swan
waxen python
#

cope, looks fine on desktop :P

hazy oxide
#

anyone know what is Scheme "none" is not supported error?

slate swan
junior verge
#

This is all the code for it though

hazy oxide
#

as an embed thumbnail

junior verge
#

Yep

urban shell
#

hey guys,
I was wondering how can I install discord.py v2.0
this is what I used earlier - pip install git+https://github.com/Rapptz/discord.py@rewrite
but it doesn't work anymore, is there any other way to install v2.0?

junior verge
#

Got this now

hazy oxide
#

or anyone know how to show guild avatar image in nextcord?

slate swan
#

his bot in 13 guils

slate swan
#

guilds*

junior verge
#

I got it

slate swan
hazy oxide
junior verge
slate swan
urban shell
#

the rewrite branch is Not Found apparently

#

so what can I do now

junior verge
#

done

hazy oxide
#

i did this, and i got that error (im using nextcord)

slate swan
#

this in 2v

junior verge
unkempt canyonBOT
#

property icon: Optional[nextcord.asset.Asset]```
Returns the guild’s icon asset, if available.
vocal snow
hazy oxide
#

so its url = ctx.Guild.icon?

junior verge
#

@slate swan getting this

slate swan
#

thats embed with api
and i asked how can i replace text from this api with spefic text and first and second line

junior verge
#

@slate swan Actually it works now, how do I make it so it updates like every 5m instead of when I restart my bot.

hazy oxide
#

The embed won't appear, but when i use that on slash command, it says

nextcord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In data.embeds0.thumbnail.url: Scheme "none" is not supported. Scheme must be one of ('http', 'https').  
#

wait

slate swan
#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
hazy oxide
#
@client.command(aliases=["serverinfo"])
@commands.cooldown(1, 5, commands.BucketType.user)
async def si(ctx):
  role_count = len(ctx.guild.roles)
  list_of_bots = [bot.mention for bot in ctx.guild.members if bot.bot]

  siEm = nextcord.Embed(timestamp=ctx.message.created_at, color=ctx.author.color)
  siEm.set_thumbnail(url=ctx.guild.icon)
  siEm.add_field(name="Server Name", value=f"{ctx.guild.name}", inline=False)
  siEm.add_field(name="Member Count", value=ctx.guild.member_count, inline=False)
  siEm.add_field(name="Verification Level", value=str(ctx.guild.verification_level), inline=False)
  siEm.add_field(name="Highest Role", value=ctx.guild.roles[-2], inline=False)
  siEm.add_field(name="Total Roles", value=str(role_count), inline=False)
  siEm.add_field(name="Bots", value=", ".join(list_of_bots), inline=False)
  siEm.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar.url)

  await ctx.send(embed=siEm)
slate swan
flat solstice
# maiden fable Ah lemme see. just got on my laptop

Thanks for taking a look, unfortunately I had to leave to go to work so I won't be replying for 6 ish hours so if you have a question or something then give me a ping and I'll reply when I'm back. I may respond in 2 to 3 hours when I'm on break but I'll be on mobile

junior verge
#

Yeah

hazy oxide
#

hm

junior verge
#

Also what's wrong here ```py
import discord
from discord.ext import commands

class Avatar(commands.Cog):

def __init__(self, client):
    self.client = client

@commands.command(name='Avatar',aliases=["av"])
async def avatar(self, ctx, *,  avamember : discord.Member=None):
    userAvatarUrl = avamember.avatar.url
    await ctx.send(userAvatarUrl)

def setup(client):
client.add_cog(Avatar(client))

hazy oxide
#

lemme try

slate swan
#

idk idk but ye

polar lodge
#

so it is trying to get the avatar of nobody which isn't possible

junior verge
#

Can't I just do .av

#

Like that it gets mine

final iron
junior verge
#

But when I do .av @junior verge gives this

polar lodge
#
if avamember is None:
  ctx.message.author```
#

lol i forgot you can do if not

junior verge
quick gust
#

just do

avmember = avmember or ctx.author```
unkempt canyonBOT
#

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

well i'd suggest using this

avamember = avamember or ctx.message.author```
slate swan
junior verge
#

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

quick gust
slate swan
waxen python
#

nextcord or something

quick gust
#

definitely not using nextcord

waxen python
#

oh, that might have been someone else

slate swan
quick gust
#

in dpy 2.0+

#

but it should error if they aren't on 2.0

#

avatar has no attribute url

hazy oxide
#

uh, it printed None

quick gust
#

I'd just say print discord.__version__ to double check

hazy oxide
#

oh gosh im dumb, ik the prob

junior verge
hazy oxide
#

im running the code in my test server, which it has no guild avatar

slate swan
hazy oxide
#

facepalm

junior verge
#

How do I check

#

1.7.3

hazy oxide
#

@slate swan but how to make so that error won't appear in my console

waxen python
#

so its _ not .

junior verge
hazy oxide
#

for example if someone use my bot on the server that has no guild avatar

waxen python
#

if not xx:
not exist

slate swan
waxen python
junior verge
#

So leave it to .

quick gust
junior verge
quick gust
waxen python
#

oh. mb

#

ctx.author.avatar_url

slate swan
quick gust
#

change it to member.avatar_url, I'm sure it would work Daxles

hazy oxide
waxen python
#

you can try and except it

quick gust
#

icon = ctx.guild.icon.url or "No Icon"

kekw, one liners pog

quick gust
#

oh didn't see, lemme edit

waxen python
#

try:
get icon url
except Exception as e:
print(e)

junior verge
quick gust
#

and then icon would become No Icon

slate swan
#

is there a ban appeal?

quick gust
#

nope, try it

junior verge
quick gust
#

since there's an or, it moves to the next assignment

quick gust
unkempt canyonBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AttributeError: 'NoneType' object has no attribute 'upper'
junior verge
quick gust
#

hm

slate swan
#
    for role_id in teamss:
        for member in ctx.guild.members:
            if ctx.guild.get_role(role_id) in member.roles and FO in member.roles:
                people.append(f"{member.mention} - {ctx.guild.get_role(role_id).mention}")
                lst.append(role_id)

        

    for roles in ctx.guild.roles:
        if roles in team:
            if roles.id not in lst:
                checked.append(roles.mention)

checked is returning None

slate swan
junior verge
#
import discord
from discord.ext import commands

class Avatar(commands.Cog):

    def __init__(self, client):
        self.client = client

    @commands.command(name='Avatar',aliases=["av"])
    async def avatar(self, ctx, *,  avamember : discord.Member=None):
        if not avamember:
            avamember = ctx.author
        userAvatarUrl = avamember.member.avatar_url
        await ctx.send(userAvatarUrl)

def setup(client):
    client.add_cog(Avatar(client))
``` Or I just made a stupid mistake
waxen python
#

try lowercase name='avatar'

slim ibex
#

use Bot not client

slate swan
#

that doesn't matter

slim ibex
#

it does

slate swan
#

how so

junior verge
#

No does not matter at all

slim ibex
#

discord.Client doesn't have commands

slate swan
slim ibex
#

discord.ext.commands.Bot does

junior verge
#

Yeah

slate swan
#

yeah he defined client ascommands.Bot

slim ibex
#

change it to bot

junior verge
#

No

slate swan
#

its only a var

slate swan
junior verge
#

I am not changing it

final iron
slate swan
slim ibex
#

no its not only a var. it is confusing to people trying to help. it shouldn't be client when discord.Client exists

slate swan
#

pep8 style? so ppl can understand the code?

final iron
slate swan
slim ibex
#

if you are using discord.ext.commands.Bot, name the variable bot

junior verge
#

Alright so how can I get my code to work, just chang it to a lowercase?

slim ibex
#

its a simple change

#

CTRL+F and replace all client with bot

slate swan
#

Im not going to aruge over this, its just a variable, client = commands.Bot like it can be that easy to name it anything u want lol = commands.Bot like litterally

waxen python
#

it is in this case

slate swan
slim ibex
waxen python
#

yes

slim ibex
#

^

final iron
#

View this example

slate swan
slim ibex
#

if im helping someone, and I see @lol.event, I won't know whether they initialized discord.Client or discord.ext.commands.Bot

sage otter
slate swan
#

all of understood that he was using "client = commands.Bot" rather than it being "discord.Client"

final iron
#
user: discord.Member
member: discord.User

See how confusing this is?

slim ibex
#

^

slate swan
slim ibex
#

discord.User and discord.Member are two different things

slim ibex
#

a User is a Discord account. a Member is someone in the server

slate swan
#

this is my point, i understand that, but code wise/running wise it wouldn't matter.

slim ibex
#

it might not effect code running, but do you want the person helping you to be confused?

slate swan
#

facts

slate swan
slim ibex
#

no lol

#

for all I know, he could have initialized discord.Client and was trying to use cogs in it because he didn't know discord.Client didn't have commands

silent ermine
#

is there a decorator for only the server owner to use a command ?

slate swan
#

for example if ctx.author.id == ctx.guild.owner.id

slim ibex
unkempt canyonBOT
#

@discord.ext.commands.is_owner()```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that checks if the person invoking this command is the owner of the bot.

This is powered by [`Bot.is_owner()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.is_owner "discord.ext.commands.Bot.is_owner").

This check raises a special exception, [`NotOwner`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.NotOwner "discord.ext.commands.NotOwner") that is derived from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
silent ermine
slate swan
silent ermine
slim ibex
#

ye read the msg incorrectly

slim ibex
slim ibex
#

you can also create a custom check

slate swan
#
def is_guild_owner(ctx):
    ctx.author.id == ctx.guild.owner.id
slim ibex
#

you need to return a predicate inner function

quick gust
slate swan
#

oh

slim ibex
#
def is_guild_owner():
  def predicate(ctx: Context) -> bool:
    if ctx.author.id == ctx.guild.owner.id:
      return True

  return commands.check(predicate)
sage otter
silent ermine
silent ermine
slate swan
#

no

#

i didn't predicate it like how moai did

slim ibex
#

~~```py
def is_guild_owner() -> Callable[[Context], bool]:
def predicate(ctx: Context) -> bool:
if ctx.author.id == ctx.guild.owner.id:
return True

return commands.check(predicate)

spice it up a bit with type hints
slim ibex
#

🗿

slate swan
#

or that

#

@silent ermine yeah id recon this one its easier to read aswell

silent ermine
#

oh huh you can do @bot.check ok

#

and after @bot.command would I do @is_guild_owner()?

slate swan
#

wait i think i know why

waxen python
#

Its meant to be a board in a read only channel that people can all look at to get the information for articles to be written. I dont want pages because that would mean people would have to interact with it whilst someone else may be reading it...

silent ermine
silent ermine
slate swan
#

yes

#

I have a problem

#

yeah i think i know the problem, roles return a list correct, since im looping through all the roles, and teams are just roles name so

slate swan
slate swan
waxen python
#

im not sure how well that would work here as things get added to this list..
I was thinking having 10 items per embed but i wasnt sure how to pull that off with how im editing the embed currently

slate swan
#

the bot does not connect to the voice channel

quick gust
slate swan
#

its a custom check

#

dont see a point of making one. but sure

slate swan
# slate swan the bot does not connect to the voice channel

Code:
@client.event
async def on_ready():
print('Bot turned on')

@client.command()
async def join(ext):
embed = discord.Embed(title ="Error!", description = "You are not connected to a voice channel.", color = "32FF00")
channel = ext.author.voice.channel

if ext.author.voice is None:
return ext.send(join=embed)
if ext.author.voice is not None:
return ext.author.voice.channel
await channel.connect()

#

thanks, i solved it. I had to realize what i was checking for, and what the bot was returning

silent ermine
slate swan
silent ermine
slate swan
#

tho, dont use ctx.guild.owner
compare the ids instead

#
return ctx.author.id == ctx.guild.owner_id```

reason: .owner needs member intents
waxen python
#

this was kinda what i was thinking.. ill play around with it more. thanks

silent ermine
silent ermine
slate swan
#

Pls help me

#

I have a problem with bot voice channel connect

silent ermine
# slate swan `@commands`
AttributeError: module 'nextcord.ext.commands' has no attribute 'is_guild_owner_ctx'```

```py
@bot.check()
def is_guild_owner_ctx(ctx):
    return ctx.author == ctx.guild.owner_id```
silent ermine
silent ermine
slate swan
slate swan
#
if ctx.author.id == ctx.guild.owner_id:
   #stuff here ```
#

inside the command, yes

slate swan
silent ermine
#

imma just make a async def check_owner

slate swan
#

it doesnt have update_per_limit too cri

#

Pls help me.I have a problem with bot voice channel connect.Code:
@client.event
async def on_ready():
print('Bot turned on')

`@client.command()
async def join(cxt):
embed = discord.Embed(title ="Error!", description = "You are not connected to a voice channel.", color = "32FF00")
channel = cxt.author.voice.channel

if cxt.author.voice is None:
return ext.send(join=embed)
if cxt.author.voice is not None:
return ext.author.voice.channel
await channel.connect()`

final iron
#

Have you ever coded python?

slate swan
final iron
#

I can see that

slate swan
#

I'm trying to figure it out

#

No error.The bot does not connect to the voice channel

unkempt canyonBOT
quick gust
#

i don't understand the code tbh, the naming is confusing

#

!d discord.VoiceChannel.connect | I'd just use this if member.voice is not none

unkempt canyonBOT
#

await connect(*, timeout=60.0, reconnect=True, cls=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Connects to voice and creates a [`VoiceClient`](https://discordpy.readthedocs.io/en/master/api.html#discord.VoiceClient "discord.VoiceClient") to establish your connection to the voice server.

This requires [`voice_states`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.voice_states "discord.Intents.voice_states").
slate swan
#

Thx

#

ctx.channel.send pepecry

#

oh wait, yerlikaya, long time es_pepeDaddy

#

How do i get it so it says how long ago a message was deleted..

<t:{int(message.delete.timestamp())}:R>")```
slate swan
#

um

sick birch
#

Because the current time is the time of deletion within an on message delete event

maiden fable
#

Robin have u ever done game deving? 👀

slate swan
#

Error

rancid stump
#

what is guild_id in discord ?

final iron
#

There's

unkempt canyonBOT
final iron
#

But no guild_id

rancid stump
slate swan
final iron
rancid stump
#

and what is session_id ?

sick birch
quick gust
unkempt canyonBOT
quick gust
#

heh

maiden fable
#

Was just asking him

quick gust
#

come on, it was a joke

maiden fable
quick gust
#

smh

slate swan
#
@bot.event
async def on_message(message):
    for channel in config["whitelist_channels"]:
        if message.channel.id == channel:
            pass
        else:
            return
slate swan
#

wait i forgot to show entire code

foggy rain
slate swan
#
@bot.event
async def on_message(message):
    for channel in config["whitelist_channels"]:
        if message.channel.id == channel:
            pass
        else:
            return

    # If embed is true check all properties of embed
    if message.embeds:
        print("Embed Exists")
    else:
        print(f"Message: {message.content}")
slate swan
rugged steeple
odd prawn
#

Keep in mind that a whitelist usually implies inclusivity.

slate swan
#
@bot.event
async def on_message(message):
    if message.channel.id in config["whitelist_channels"]:
        pass
#

so this should be correct?

#

it worked thanks

foggy rain
#

I think you should use continue instead of pass.

slate swan
#

how does continue and pass differ?

foggy rain
#

If you wanna skip executing code after if block then use continue to send loop to next iteration

slim ibex
#

continue isn't used in if statements afaik

rugged steeple
odd prawn
#

continue is a keyword used in a loop that begins the next iteration of that loop.
pass moves on to the next line.

slim ibex
#

if statements don't iterate they just check if a condition is true

vale wing
slate swan
#

pass is what i wanna use

foggy rain
slate swan
#

well continue continues the loop which is what i dont want to

odd prawn
#

There is no loop to continue here.

slate swan
#

I want to skip and go to the next line so it prints the message

slate swan
#

I don't even need pass anymore I could just do if bla_bla not in config: return

rugged steeple
#

Reducing the indentation and unnecessary pass statment -
Instead of

if something: ...
else: return

It'd be

if not something: return 

...
vale wing
#

pass is typically used when you made a function but you want to add contents to it later, and in this construction

try:
    ...
except:
    pass```
#

As well as for making empty classes

rugged steeple
vale wing
#

Ok

rugged steeple
#

!zen

unkempt canyonBOT
#
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

rugged steeple
#

!zen 5

unkempt canyonBOT
#
The Zen of Python (line 5):

Sparse is better than dense.

slate swan
#

aliving, you? peephappy

rugged steeple
#

Oh lol, it starts counting the lines from 0 o.O

inland crest
#

hello

foggy rain
#

Hola

inland crest
#

how do i add aliases to a command when im using this

elif user_message == 'GTN':
        number = random.randint(1, 10)
        await message.channel.send('Guess my number')

        def check(msg):
            return msg.author == message.author and msg.channel == message.channel and int(msg.content) in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

        msg = await client.wait_for("message", check=check)

        if int(msg.content) == number:
            await message.channel.send("Correct")
        else:
            await message.channel.send(f"Nope it was {number}")```
foggy rain
#

Your code

inland crest
#

how do i add aliases to a command when im using this

elif user_message == 'GTN':
        number = random.randint(1, 10)
        await message.channel.send('Guess my number')

        def check(msg):
            return msg.author == message.author and msg.channel == message.channel and int(msg.content) in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

        msg = await client.wait_for("message", check=check)

        if int(msg.content) == number:
            await message.channel.send("Correct")
        else:
            await message.channel.send(f"Nope it was {number}")```
rugged steeple
#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

slate swan
#
Traceback (most recent call last):
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 349, in static_login
    data = await self.request(Route('GET', '/users/@me'))
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 302, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized

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

Traceback (most recent call last):
  File "main - Kopie.py", line 61, in <module>
    bot.run(token)
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 631, in run
    return future.result()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 610, in runner
    await self.start(*args, **kwargs)
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 573, in start
    await self.login(*args)
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 424, in login
    await self.http.static_login(token.strip())
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 353, in static_login
    raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002931E407040>
Traceback (most recent call last):
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 719, in call_soon
    self._check_closed()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002931E407040>
Traceback (most recent call last):
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 719, in call_soon
    self._check_closed()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002931E407040>
Traceback (most recent call last):
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 719, in call_soon
    self._check_closed()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
inland crest
#
elif user_message == 'GTN':
        number = random.randint(1, 10)
        await message.channel.send('Guess my number')

        def check(msg):
            return msg.author == message.author and msg.channel == message.channel and int(msg.content) in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

        msg = await client.wait_for("message", check=check)

        if int(msg.content) == number:
            await message.channel.send("Correct")
        else:
            await message.channel.send(f"Nope it was {number}")```
#

?

slate swan
#

Any fix? i already changed/rested my discord bot token

inland crest
rugged steeple
inland crest
#

thanks so much

final iron
#

This is a yikes and a half

#

1st Use the commands extension

slim ibex
#

global mess doesn't create a variable my guy

#

and you dont use global in the global scope

slate swan
rugged steeple
#

@inland crest a quick refactoring -

def check(old, new) -> bool:
   return (new.author, new.channel) == (old.author, old.channel) and 1 <= int(new.content) <= 10


...
elif user_message.lower() in {"gtn", "g", "other alias"}:
        await message.channel.send('Guess my number')

        msg = await client.wait_for("message", check=lambda x: check(message, x))

        number = random.randint(1, 10)
        if int(msg.content) == number:
            await message.channel.send("Correct")
        else:
            await message.channel.send(f"Nope it was {number}") 

** Please dont mind the indentation, writing this on the phone...

rugged steeple
tacit horizon
#

how to edit send embed

unkempt canyonBOT
#

await edit(content=..., embed=..., embeds=..., attachments=..., suppress=..., delete_after=None, allowed_mentions=..., view=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Edits the message.

The content must be able to be transformed into a string via `str(content)`.

Changed in version 1.3: The `suppress` keyword-only parameter was added.

Changed in version 2.0: Edits are no longer in-place, the newly edited message is returned instead.

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

ok

maiden fable
tidal hawk
#

How do I remove the picture from the message? For instance if I want to remove the embed, then i set it's value None, but it doesn't work for file/images..

fervent surge
#

so, i think im using dpy 1, what changes to my code do I need if I upgrade to dpy 2

#

big changes

#

are there only new features or are there any big changes to any existing ones

maiden fable
tidal hawk
#

Nah doesn't work

fervent surge
#

or even pycord

#

yeah, what I need to change to upgrade to pycord, im using discord and discord-py-slash-command

#

or is pycord just dpy

#

but better

tidal hawk
#

Use disnake

fervent surge
#

i think pycord is better ngl

tidal hawk
#

Okay

fervent surge
#

but im reallly confused rn

#

a lot has happened in a year

#

when I last made bots, only a week had passed since slash commands really became a thing

slate swan
#

no one cares

modern egret
#

for database

tidal hawk
fervent surge
boreal ravine
tidal hawk
fervent surge
#

im confused on what library/fork im supposed to use

slate swan
fervent surge
#

will it be easier to convert

slate swan
#

nice server no one helping

fervent surge
#

ideally, i dont really want to convert

tidal hawk
modern egret
#

need check individual user of id in task

fervent surge
tidal hawk
#

just rename @commands.command -> @commands.slash_command()

#

and ctx -> inter

fervent surge
tidal hawk
#

you can mass replace it

fervent surge
#

also, i think(im not sure) that pycord has a bigger community?

#

ok, all i need is to make a dropdown selection

tidal hawk
#

Ez to make with disnake

fervent surge
#

is that possible in dpy1?

tidal hawk
fervent surge
#

or, dispycord2.5infinityCoroSupportedawaitAsyncSnowflake

tidal hawk
#

I have no idea xd

#

never used pycord

fervent surge
#

could youtube help?

#

or is that unreliable, as the dpy server said

tidal hawk
#

iguess

#

idk

ionic turtle
#

its back in dev

fervent surge
quaint epoch
#

my bot is hosted on heroku, it's been working fine until yesterday when i tried to login in pycharm with heroku CLI, it gives me this error Error: connect EACCES 0.0.0.0:443

ionic turtle
fervent surge
boreal ravine
ionic turtle
#

agreed

#

their documentation is good tho

fervent surge
#

i barely understand the docs

ionic turtle
#

what do u not understand?

fervent surge
#

sure, it has the classes, but it doesn't clearly describe how they should be used

hushed galleon
#

oh did that 1 mean <2.0

ionic turtle
#

^^

fervent surge
#

ok

tidal hawk
#

Disnake has good ones

fervent surge
#

tho i kinda prefer stackoverflow

tidal hawk
#

lol

fervent surge
#

ok, im gonna go for dpy2

boreal ravine
fervent surge
#

now, is it on pip?

#

or do I need git?

hushed galleon
#

you have to install it from github directly

fervent surge
ionic turtle
#

then you hsould get git

fervent surge
#

well, i do

#

but my hosting doesn't

#

replit (dont ask, i cant spend money)

ionic turtle
#

can u not put in req.txt

ionic turtle
fervent surge
boreal ravine
ionic turtle
fervent surge
fervent surge
tidal hawk
#

this guy trolling

boreal ravine
fervent surge
#

who, me?

boreal ravine
#

yes

fervent surge
#

no im not

#

how am i?

#

ok, sorry and thx for the advice!

ionic turtle
boreal ravine
#

Mate, you're using replit install d.py 2.0 through the shell

fervent surge
ionic turtle
#

did u read the errors>

fervent surge
quaint epoch
tidal hawk
fervent surge
slate swan
#
    @commands.Cog.listener()
    async def on_member_leave(member):
        FO = []
        teamname = []
        channel = bot.get_channel(notice_leave)
        FO1 = await find_by_name("Franchise Owner", ctx.message.guild.roles)
            
            
        
        for roles in member.guild.roles:
            if roles in team:
                if roles in member.roles:
                    teamname.append[roles.name]

        x = teamname[0]                    
        for user in member.guild.members:
            if FO1 in user.roles and x in user.roles:
                FO.append(f"{user.mention}")


        em = discord.Embed(title="Player Left", description=f"{member.mention} left", color=color)
        await channel.send(content=''.join(FO), embed=em)
``` why does the bot send nothing in the channel
fervent surge
#

ok, anyways, its fine, thx

tidal hawk
#

error?

slate swan
#

no error

ionic turtle
#

prob cache issue

boreal ravine
slate swan
boreal ravine
slate swan
#

would you like to see the code?

#

for findbyname

boreal ravine
slate swan
#

these types of servers, use fonts 24/7

ionic turtle
#

ok

boreal ravine
#

o

ionic turtle
#

its a cog class right?

#

💀

slate swan
#

has anyone here made ticket tool if so can i have i dont rlly wanna code alot rn XD

tidal hawk
#

☝️

slate swan
#

all js

tidal hawk
#

no

slate swan
#

o yea

slate swan
boreal ravine
slate swan
#

i stupid

#

oh wait

ionic turtle
#

try this?

slate swan
#

i did self.bot = bot

ionic turtle
#

u need self as a parameter of any func if its not a static method

#

rn ur saying member param is the self param

final iron
ionic turtle
#

its a big yikes

#

but they wanted a simple ticket bot 🤷‍♂️

#

but yea

final iron
#

Why json though

ionic turtle
#

😭 ikr

ionic turtle
#

send ur code again @slate swan

tidal hawk
#

MOST RELIABLE DATABASE

pliant gulch
#

Funny joke

slate swan
#

hold on im updating it

#

actually

ionic turtle
#
  @commands.Cog.listener()
    async def on_member_leave(self, member):
        FO = []
        teamname = []
        channel = self.bot.get_channel(notice_leave)
        FO1 = await find_by_name("Franchise Owner", ctx.message.guild.roles)
            #ASSUMING THE  `find_by_name` is imported not in the class
            
        
        for roles in member.guild.roles:
            if roles in team:
                if roles in member.roles:
                    teamname.append[roles.name]

        x = teamname[0]                    
        for user in member.guild.members:
            if FO1 in user.roles and x in user.roles:
                FO.append(f"{user.mention}")


        em = discord.Embed(title="Player Left", description=f"{member.mention} left", color=color)
        await channel.send(content=''.join(FO), embed=em)
ionic turtle
#

Ok

boreal ravine
slate swan
#

async def on_member_remove(member): why is the bot saying this is 2 arugements rather than 1

torn sail
#

Then the guild doesn’t have an icon

ionic turtle
boreal ravine
hazy oxide
slate swan
maiden fable
humble granite
#

Hello! I have a little problem,..

So I've created a await guild.create_role(name="text") function in my code.
I tested a lil bit around and now It's not responding anymore.
So for example:```
print("creating role") # works
await guild.create_role(name="text") # no response, even with wrong input
print("created role") # not printing because the role creator is being awaited

pliant ocean
#

@client.command(help='Access Reddit')
async def Rmemes(self,ctx,subred="rmemes"):
msg=await ctx.send('Loading meme.....')
reddit = asyncpraw.Reddit(client_id='',
client_secret='',username='Livid-Brick-74',password='',user_agent='pythonasycpraw')
subreddit=await reddit.subreddit(subred)
all_subs=[]
top = subreddit.top(Limit=50)
async for sumbission in top:
all_subs.append(submission)
random_sub=random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = discord.Embed(title=name)
embed.set_image(url=url)
await ctx.send(embed=embed)
await msg.edit(content=f'https://reddit.com/r/{subreddit}/')

#

i am getting the error of ctx is a required arguement that is missing

#

what am i doing wrong

pliant ocean
maiden fable
#

Just use the JSON API bro

slate swan
#

nvm hunter god here

maiden fable
#

Eh I am going to get smth to eat anyways

pliant ocean
#

so

slate swan
humble granite
#

@pliant ocean send traceback so we can help you

pliant ocean
#

Traceback (most recent call last):
File "C:\Users\Subhojit Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Subhojit Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 855, in invoke
await self.prepare(ctx)
File "C:\Users\Subhojit Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 789, in prepare
await self._parse_arguments(ctx)
File "C:\Users\Subhojit Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 697, in _parse_arguments
transformed = await self.transform(ctx, param)
File "C:\Users\Subhojit Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 542, in transform
raise MissingRequiredArgument(param)
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.

torn sail
#

Remove self

#

You’re not in a class

slate swan
maiden fable
slate swan
maiden fable
#

its actually easier

slate swan
#

to sort them first of all, is a big headache for me

maiden fable
#

😔

pliant ocean
# torn sail Remove self

Traceback (most recent call last):
File "C:\Users\Subhojit Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Subhojit Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Subhojit Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: ListingGenerator.init() got an unexpected keyword argument 'Limit'
this is what i get its showing loading meme but gives this

#

is L in limit small?

maiden fable
#

yes

pliant ocean
#

okay

slate swan
#
Traceback (most recent call last):
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 349, in static_login
    data = await self.request(Route('GET', '/users/@me'))
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 302, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized

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

Traceback (most recent call last):
  File "main - Kopie.py", line 61, in <module>
    bot.run(token)
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 631, in run
    return future.result()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 610, in runner
    await self.start(*args, **kwargs)
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 573, in start
    await self.login(*args)
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 424, in login
    await self.http.static_login(token.strip())
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 353, in static_login
    raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002931E407040>
Traceback (most recent call last):
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 719, in call_soon
    self._check_closed()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002931E407040>
Traceback (most recent call last):
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 719, in call_soon
    self._check_closed()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002931E407040>
Traceback (most recent call last):
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 719, in call_soon
    self._check_closed()
  File "C:\Users\Vestige\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
#

how i can fix this error?

humble granite
slate swan
#

i did

#

already changed all reseted

pliant ocean
#

Traceback (most recent call last):
File "C:\Users\Subhojit Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Subhojit Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Subhojit Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'submission' is not defined

#

but i think i already defined submission?

humble granite
#

error is unauthorized and it gives "improper token passed" this means you've passed the wrong bot token

slate swan
maiden fable
#

?

slate swan
#

is this not the bot token?

maiden fable
#

Yes it is

slate swan
#

So why the fuck its not working

slate swan
pliant ocean
#

okay it worked but it spams memes like 15-20 times

maiden fable
#

😔

slate swan
#
from distutils import command
from re import X
import traceback
import discord, json, os, random
from discord.ext import commands
import time
import sys
from datetime import datetime
from os import listdir

token = ""  # Bot Token
prefix = "?"  # Bot Prefix
status = "VGen"  # Playing Status


os.system("cls")
os.system("title Account Gen Bot")

bot = commands.Bot(command_prefix=prefix)

logo = """
╦  ╦╔═╗╔═╗╔╦╗╦╔═╗╔═╗
╚╗╔╝║╣ ╚═╗ ║ ║║ ╦║╣ 
 ╚╝ ╚═╝╚═╝ ╩ ╩╚═╝╚═╝
"""


@bot.event
async def on_ready():
    await bot.change_presence(activity=discord.Game(name=status + " | " + prefix + "help"))
    print(logo)
    print(f'Connected in: {bot.user}')
    print("  Satus    : " + status)
    print("  Prefix   : " + prefix)

bot.remove_command("help")
@bot.command()
async def help(ctx):
    helpmenu = discord.Embed(title="Help", description="", color=0x9208ea, )
    helpmenu.description += prefix + "search <mail>"
    helpmenu.set_thumbnail(url="https://media.discordapp.net/attachments/933028046364106752/946877687140614304/chrome_FkkVv3EboU.png?width=80&height=40")
    await ctx.send(embed=helpmenu)
    
@bot.command()
async def search(ctx, arg1):
    await ctx.message.delete()
    embed=discord.Embed(color=0x39fd3f)
    embed.set_author(name="test1", url="https://test.com/")
    embed.set_thumbnail(url="https://i.pinimg.com/originals/40/55/da/4055da716e80ffef4742b05d40dce139.png")
    embed.add_field(name="Searching File now", value="Results for **"+arg1+"**...", inline=False)
    await ctx.send(embed=embed)
    search = open("dumps.txt") #Your path to the file you want the bot to search for
    for line in search:
        if arg1 in line:
            embed=discord.Embed(color=0x39fd3f)
            embed.add_field(name="Data Search", value=line, inline=False)
            await ctx.send(embed=embed)

bot.run(token)
slate swan
#

anything wrong?

maiden fable
slate swan
#

bro just help me

slate swan
maiden fable
slate swan
#

WHYYYY

maiden fable
#

czzzzzz we are doing it voluntarily?

pliant ocean
# slate swan latest code

@client.command(help='Access Reddit')
async def Rmemes(ctx,subred="memes"):
msg=await ctx.send('Loading meme.....')
reddit = asyncpraw.Reddit(client_id='1Oyh8I8h57AV-ID98PHyWQ',
client_secret='cJ0uGjkhTvRGvoI2xPD4lbLJYRn_cQ',username='Livid-Brick-74',password='',user_agent='pythonasycpraw')
subreddit=await reddit.subreddit(subred)
all_subs=[]
top = subreddit.top(limit=50)
async for submission in top:
all_subs.append(submission)
random_sub=random.choice(all_subs)
name = random_sub.title
url = random_sub.url
embed = discord.Embed(title=name)
embed.set_image(url=url)
await ctx.send(embed=embed)
await msg.edit(content=f'https://reddit.com/r/{subreddit}/')

slate swan
#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

maiden fable
pliant ocean
slate swan
maiden fable
#

😔 Stop uwuing, uwu isn't uwu anymore

pliant ocean
slate swan
maiden fable
#

@oblique karma DM me yr token

slate swan
#

lmao

final iron
#

🗿

maiden fable
#

Well he isn't responding, soooo 🤷

vale wing
maiden fable
#

he left

vale wing
#

L ok

slate swan
#
@bot.command(pass_context=True)
@commands.has_role("3l")
async def claim(ctx, *, reason=None):``` how do i make it reply if you dont have 3l role
humble granite
slate swan
humble granite
slate swan
#

ok

slate swan
#

im dumb sorry

#

is this right format?

humble granite
# slate swan ```py@bot.command(pass_context=True) @commands.has_role("3l") async def claim(ct...

It should look like this:

@bot.command(name="claim",description="This is the description of your command. both name and description are optional",pass_context=True)
async def _claim(ctx, *, reason=None):
        username, user = reason.split(':')                                                                                                  if not get(ctx.guild.roles,id=int(ROLE_ID)) in ctx.author.roles:return await ctx.send("You do not have the right role to use this command") # requires discord utils import
        await ctx.send(f"{username} {user}")
slate swan
#

ty

slim ibex
#

you dont need pass_context

slate swan
#

username, user = reason.split(':') if not get(ctx.guild.roles,id=int(952619437427654696)) in ctx.author.roles:return await ctx.send("You do not have the right role to use this command") # requires discord utils import
^
SyntaxError: invalid syntax

#

why is code so spaced out

humble granite
# slate swan username, user = reason.split(':') ...

the "simpler" version:

@bot.command(name="claim",description="This is the description of your command. both name and description are optional",pass_context=True)
async def _claim(ctx, user:discord.Member=None,*, reason:str=None):
        if not get(ctx.guild.roles,id=int(ROLE_ID)) in ctx.author.roles:
          return await ctx.send("You do not have the right role to use this command") # requires discord utils import
        await ctx.send(f"{username} {user}")

(please format this if neccessary I'm curentlöy not in a editor and discord is cursed for me)

slate swan
#

How can I correct the calculation errors that my bot makes ?

vale sierra
#
    @commands.command()
    @commands.has_permissions(manage_channels=True)
    async def slowmode(self, ctx):
        if time == 0:
            await ctx.send("Slowmode Off")
            await ctx.channel.edit(slowmode_delay = 0)
        elif time > 21600:
            await ctx.send("Vous ne pouvez pas mettre le slowmode au-dessus de 6 heures.")
            return
        else:
            await ctx.channel.edit(slowmode_delay = time)
            await ctx.send(f"Slowmode mit à {time} secondes !")
```  Hello, i have this error with this code
final iron
slate swan
final iron
humble granite
vale sierra
slate swan
#

its a variable not discord member @humble granite

#

@bot.command() @commands.cooldown(1,5,commands.BucketType.channel) async def userinfo(ctx,member: discord.Member = None): if member == None: member = ctx.author try: roles = [role for role in member.roles[1:]] embed = discord.Embed( color = discord.Color(0xff3400), title = f"{ctx.member}") embed.add_field(name="**ID**", value=f"{member.id}", inline=False) embed.add_field(name="**Status**", value=str(member.status).replace("dnd", "Do Not Disturb"), inline=False) embed.set_thumbnail(url=f"{member.avatar_url}") embed.add_field(name=f"**Rôles ({len(ctx.author.roles) - 1})**", value='• '.join([role.mention for role in roles]), inline=False) embed.add_field(name="**Compte crée le**", value=f"{member.created_at.date()}".replace("-", "/"), inline=False) embed.add_field(name="**A rejoins le serveur le**", value=f"{member.joined_at.date()}".replace("-", "/"), inline = False) embed.set_footer(icon_url = f"{ctx.author.avatar_url}", text = f"Demandé par {ctx.author}") embed.timestamp = datetime.datetime.utcnow() await ctx.send(embed=embed) except: roles = [role for role in member.roles[1:]] embed = discord.Embed( color = discord.Color(0xff3400), title = f"{member}") embed.add_field(name="**ID**", value=f"{member.id}", inline=False) embed.add_field(name="**Status**", value=str(member.status).replace("dnd", "Do Not Disturb") , inline=False) embed.set_thumbnail(url=f"{member.avatar_url}") embed.add_field(name=f"**Rôles (0)**", value="No roles", inline=False) embed.add_field(name="**Compte crée le**", value=f"{member.created_at.date()}".replace("-", "/"), inline=False) embed.add_field(name="**A rejoins le serveur le**", value=f"{member.joined_at.date()}".replace("-", "/"), inline = False) embed.set_footer(icon_url = f"{ctx.author.avatar_url}", text = f"Demandé par {ctx.author}") embed.timestamp = datetime.datetime.utcnow() await ctx.send(embed=embed)

slate swan
#

config.json

"whitelist_channels": [
        id_here
    ],
    "blacklist_channels": []

main.py

@bot.event
async def on_message(message):
    # Counters
    print(type(whitelist))
    print(type(blacklist))
    print(whitelist)
    print(blacklist)
    blacklisted_messages = 0
    whitelisted_messages = 0
    messages = 0
    embed_counter = 0
    
    if whitelist:
        if message.channel.id not in config["whitelist_channels"]:
            blacklisted_messages += 1
            return

    elif blacklist:
        if message.channel.id in config["blacklist_channels"]:
            blacklisted_messages += 1
            return
        elif message.channel.id not in config["blacklist_channels"]:
            whitelisted_messages += 1
            pass

    elif whitelist is False and blacklist is False:
        messages += 1
#

This code doesn't work and shows messages from all channels

vale sierra
slate swan
#

I'm trying to make a system where if whitelist_channels is True it should let the message pass

humble granite
vale sierra
slate swan
#

ah

#

main.py but this is the code underneath that codeblock above

print(f"{channel} -> {author}: {msg}")

and channel, author, and msg are my own variables and they do work since they are correct but they print every message instead of just the ones in the whitelisted channel

#

je sais pas comment la simplifier dans ce cas là

vale wing
#

!rule 4 btw

unkempt canyonBOT
#

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

vale sierra
#

@slate swan viens dm je t'en passe une bien plus simple sans l'erreur

slate swan
#

asy

final iron
#

french 😔

vale wing
slate swan
humble granite
vale wing
#

You could do something like

channel_id = message.channel.id
if whitelist_enabled and channel_id not in config['whitelist']:
    # when the message is not whitelisted

elif blacklist_enabled and channel_id in config['blacklist']:
    # when the message is blacklisted
slate swan
#

this checks if my whitelist is enabled or not but doesn't work, the whitelist variable is a NoneType in the on_message func and this codeblock runs before the events and stuff like that are setup (at beggining of file)

if not config["whitelist_channels"]:
    whitelist = False
    print(f"{bad} Whitelist is empty!")
    print(f"{bad} Showing all messages from all channels")

# Check if blacklist is empty
if not config["blacklist_channels"]:
    blacklist = False
vale wing
#

Yes but the conditions you were making there are most likely incorrect

vale wing
slate swan
#

But how would I check if my list is empty in the main.py file
The list is in a json file

#

Would I have to convert it first to a python list?

vale wing
#

Wait uh how do you decode json

slate swan
#

Idk 🤷🏿‍♂️

slate swan
vale wing
#

That should be json.load

slate swan
#

Like this:

with open("config.json", "r") as f:
  config = json.load(f)
vale wing
#

Ok this is normal

slate swan
#

so it already converts it to python dict?

vale wing
#

Afaik if you parse something other than bool to condition it will just check if its length is not equal 0

vale wing
#

What format would you expect it to be

slate swan
#

Ok so I can't check if by doing if True or if False

slate swan
#

[] = array in json, [] = list in python

#

but it becomes dict?

vale wing
#

!e py ls1 = [10, 20, 30] ls2 = [] if ls1: print('ls1') if ls2: print('ls2')

unkempt canyonBOT
#

@vale wing :white_check_mark: Your eval job has completed with return code 0.

ls1
slate swan
#

but in json [] this is array and when using json.load() that it should become dict right?

#

or does it convert to list?

vale wing
#

What

#

Dict is {} both in py and json, list is []

slate swan
#

oh

#

ok

#

so doing if whitelist:

#

should check if it has contents in it

vale wing
#

Yes

slate swan
#

that doesnt seem to work for me 😦

slate swan
#

It sets atrributeError : the message object has no server attribute

`@bot.command()
async def serverinfo(ctx):
"""Shows server info"""

    server = ctx.message.server

    roles = str(len(server.roles))
    emojis = str(len(server.emojis))
    channels = str(len(server.channels))

    embeded = discord.Embed(title=server.name, description='Server Info', color=0xEE8700)
    embeded.set_thumbnail(url=server.icon_url)
    embeded.add_field(name="Crée le:", value=server.created_at.strftime('%d %B %Y at %H:%M UTC+3'), inline=False)
    embeded.add_field(name="Server ID:", value=server.id, inline=False)
    embeded.add_field(name="Membres sur le serveur:", value=server.member_count, inline=True)
    embeded.add_field(name="Server owner:", value=server.owner, inline=True)

    embeded.add_field(name="Default Channel:", value=server.default_channel, inline=True)
    embeded.add_field(name="Server Region:", value=server.region, inline=True)
    embeded.add_field(name="Verification Level:", value=server.verification_level, inline=True)

    embeded.add_field(name="Nombre de rôle:", value=roles, inline=True)
    embeded.add_field(name="Nombre d'émojis:", value=emojis, inline=True)
    embeded.add_field(name="Nombre de Channel:", value=channels, inline=True)

    await ctx.send(embed=embeded)`