#discord-bots

1 messages ยท Page 684 of 1

small igloo
#

lol finnaly u wake up

visual island
magic ore
#

that's how you get the author's ID yes

unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied mute to @small igloo until <t:1639621077:f> (9 minutes and 58 seconds) (reason: mentions rule: sent 6 mentions in 10s).

visual island
#

..

pliant gulch
#

๐Ÿ‘€

visual island
#

they should be unmuted already

small igloo
bitter perch
#

<t:UNIX:formatter>

small igloo
boreal ravine
#

the numbers are unix/epoch time whatever you wanna call them

wicked atlas
small igloo
#

oh nice it works

#

<t:1623981015>

#

hm ok ok, thanks

peak loom
#

I keep getting this and I can't fix it.

upbeat otter
#

aww, ilysm

sick birch
#

A tiny snippet of the error doesn't help us understand what the error is trying to say

peak loom
upbeat otter
#

message argument does everything

sick birch
#

on_message only comes with message

#

ctx is only for commands

upbeat otter
small igloo
small igloo
#

also @sage otter sup

peak loom
upbeat otter
small igloo
peak loom
#

I'm on 3 hours of sleep/

upbeat otter
sage otter
#

Relatable.

small igloo
small igloo
peak loom
upbeat otter
sage otter
peak loom
small igloo
small igloo
upbeat otter
peak loom
upbeat otter
#

!ot

unkempt canyonBOT
small igloo
peak loom
upbeat otter
small igloo
peak loom
small igloo
peak loom
small igloo
peak loom
peak loom
upbeat otter
peak loom
peak loom
small igloo
drifting tulip
#

How can i make a channel private for everyone. Obviously not for people with administration permissions.

peak loom
peak loom
#

It's not hacking.

small igloo
#

lol @upbeat otter what is it just npw

#

now

upbeat otter
upbeat otter
peak loom
small igloo
small igloo
small igloo
sick birch
#

ethical hacking can actually be a great way to learn new concepts and strengthen existing ones

upbeat otter
sick birch
#

but yeah

#

ot

small igloo
upbeat otter
small igloo
sage otter
#

Making a permission overwrite for the guilds default role

small igloo
#

hmm, ok i almost forgor to ask again, why the coin is empty

drifting tulip
#

But i want to make it available for the person that invoked the command

sage otter
#

Create an overwrite then

#

!d discord.TextChannel.set_permissions

unkempt canyonBOT
#

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

Sets the channel specific permission overwrites for a target in the channel.

The `target` parameter should either be a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") or a [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") that belongs to guild.

The `overwrite` parameter, if given, must either be `None` or [`PermissionOverwrite`](https://discordpy.readthedocs.io/en/master/api.html#discord.PermissionOverwrite "discord.PermissionOverwrite"). For convenience, you can pass in keyword arguments denoting [`Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions") attributes. If this is done, then you cannot mix the keyword arguments with the `overwrite` parameter.

If the `overwrite` parameter is `None`, then the permission overwrites are deleted.

You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this...
drifting tulip
#

!d discord.Message.edit

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.
upbeat otter
mild birch
#

what does await client.process_commands do?

boreal ravine
#

!d discord.ext.commands.Bot.process_commands @mild birch

unkempt canyonBOT
#

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

This function processes the commands that have been registered to the bot and other groups. Without this coroutine, none of the commands will be triggered.

By default, this coroutine is called inside the [`on_message()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_message "discord.on_message") event. If you choose to override the [`on_message()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_message "discord.on_message") event, then you should invoke this coroutine as well.

This is built using other low level tools, and is equivalent to a call to [`get_context()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") followed by a call to [`invoke()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke").

This also checks if the messageโ€™s author is a bot and doesnโ€™t call [`get_context()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.get_context "discord.ext.commands.Bot.get_context") or [`invoke()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Bot.invoke "discord.ext.commands.Bot.invoke") if so.
fluid harbor
#

Hey

drifting tulip
#

!d discord.Guild.get_member

upbeat otter
upbeat otter
fluid harbor
# upbeat otter haii
from flask import Flask
from threading import Thread

app = Flask(__name__)

@app.route('/')
def main():
    return {"hello": "everything is ok"}
def run():
    app.run(host="0.0.0.0",port=8080)
def a():
    server = Thread(target=run)
    server.start()โ€Š

Showing invalid identifier error?

drifting tulip
fluid harbor
upbeat otter
upbeat otter
fluid harbor
#

No

upbeat otter
#

yes

fluid harbor
#

It is for discord bot hosting

drifting tulip
#

Doesn't mean anything.

fluid harbor
#

Oh

drifting tulip
#

mhm

fluid harbor
#

Idk. If you can give me a code for hosting that would be nice

drifting tulip
#

that's probably the error

boreal ravine
#

If the bot gets a user and it returns this, is it still a discord.User object or no? or is it just a string

upbeat otter
fluid harbor
upbeat otter
fluid harbor
upbeat otter
slate swan
fluid harbor
#

from flask import Flask
from threading import Thread

app = Flask(__name__)

@app.route('/')
def main():
    return "hello"
def run():
    app.run(host="0.0.0.0",port=8080)
def a():
    server = Thread(target=run)
    server.start()โ€Š

It still shows same error

slate swan
#

Very random and funny question if i say so myself

fluid harbor
upbeat otter
full valley
#

So I have a queue command for players to q up for a game

# !q command -> Puts players into queue
@bot.command(name="queue", aliases=["q"], description="Join the queue")
@commands.check(is_issuer_in_game)
@commands.has_any_role(verified_role, 908784013181878342)
async def queue(ctx):
    try:
        if ctx.channel.id in allowed_channels:
            ...
------>        qtimer_tasks[game_id].append(asyncio.create_task(qtimer(timedplayer, game_id, qsize, channel)))
               print(qtimer_tasks)```

qtimer function is a timer until the player gets disconnected from the queue:
```py
async def qtimer(timedplayer, gameid, qsizee, channel):
    try:
        await asyncio.sleep(15)
        if gameid not in games:
            playerqueue.remove(timedplayer.mention)
            lobby.remove(timedplayer.id)
            if len(playerqueue) > 0:
                embed = discord.Embed(
                    title=f"**{len(playerqueue)} of {qsizee} players are in the queue**",
                    description=str(timedplayer.mention) + " was kicked from the queue! (Timeout)",
                    color=0xE74C3C)
            else:
                embed = discord.Embed(
                    title="**There are no players remaining in the queue**",
                    description=str(timedplayer.mention) + " was kicked from the queue! (Timeout)",
                    color=0xE74C3C)
            embed.set_footer(text=f"CBell 6 Mans | Created by Heptix",
                             icon_url="https://i.imgur.com/1utxX7d.png")
            await channel.send(embed=embed)
    except Exception:
        print(traceback.format_exc())```

however, the task isnt completing as I am not getting kicked from the queue after 15 seconds?
Im not getting any errors either, only console line telling me

> ```defaultdict(<class 'list'>, {99: [<Task pending name='Task-51' coro=<Command.__call__() running at C:\Users\~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py:358>>]})```
upbeat otter
#

umm....

slate swan
upbeat otter
#

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

slate swan
#

Or sm

upbeat otter
slate swan
full valley
fluid harbor
slate swan
#

Lol

fluid harbor
#

Because they helped me

upbeat otter
upbeat otter
slate swan
upbeat otter
#

Girls dont help loool

slate swan
fluid harbor
slate swan
fluid harbor
#

from flask import Flask
from threading import Thread

app = Flask(__name__)

@app.route('/')
def main():
    return "hello"
def run():
    app.run(host="0.0.0.0",port=8080)
def a():
    server = Thread(target=run)
    server.start()โ€Š

It still shows same error

upbeat otter
slate swan
fluid harbor
#

Lol

upbeat otter
slate swan
#

Im a different human bean

fluid harbor
upbeat otter
slate swan
upbeat otter
fluid harbor
slate swan
upbeat otter
upbeat otter
slate swan
slate swan
fluid harbor
#

server.start?

upbeat otter
upbeat otter
#

just write that line again

#

to make things simple

fluid harbor
slate swan
#

@fluid harbor

something.something()#
``` theirs a invalid character
forest bramble
#

I'm sorry if this is the wrong channel (I don't know where else to post.)
I want to develop a bot for my discord server. Is there an easy way that does not involve complex coding?
My knowledge of Python is less. Can anyone help me?
I will be awaiting replies.

fluid harbor
#

from flask import Flask
from threading import Thread

app = Flask(__name__)

@app.route('/')
def main():
    return "hello"
def run():
    app.run(host="0.0.0.0",port=8080)
def a():
    server = Thread(target=run)
    server.start()โ€Š

So what to remove or add?

slate swan
forest bramble
upbeat otter
slate swan
forest bramble
boreal ravine
slate swan
#

I think me bot can make bots idk

fluid harbor
#

Uh

slate swan
fluid harbor
#

???

upbeat otter
forest bramble
fluid harbor
#

from flask import Flask
from threading import Thread

app = Flask(__name__)

@app.route('/')
def main():
    return "hello"
def run():
    app.run(host="0.0.0.0",port=8080)
def a():
    server = Thread(target=run)
    server.start()โ€Š

What to add or remove.........

.....

#

............

boreal ravine
unkempt canyonBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

forest bramble
#

k

boreal ravine
#

hey

fluid harbor
boreal ravine
slate swan
fluid harbor
#

Hm

upbeat otter
#

stop typehinting the bot

#

and then try

#

your main file ss too

slate swan
#

What?

upbeat otter
#

nothing, imma keep quiet

slate swan
fluid harbor
slate swan
#

@upbeat otter what type hint are you talking about?

boreal ravine
slate swan
#

Because in __init__() it is required

upbeat otter
fluid harbor
slate swan
upbeat otter
fluid harbor
upbeat otter
slate swan
#

How is that related to the topic if the channel

fluid harbor
#

Sorry

slate swan
upbeat otter
slate swan
upbeat otter
#

I was saying that typehinting bot wasnt necessary

slate swan
#

Yes you are correct lol

upbeat otter
#

smh

slate swan
upbeat otter
slate swan
#

Any question?

#

About it?

#

We would gladly help you understand

#

You dont load extension is to load cogs

#

Mhmm

upbeat otter
slate swan
maiden fable
#
# in cog file
def setup(bot):
    bot.add_cog(Cog(...)) 
# in main bot file
bot.load_extension("cog.name") 
boreal ravine
#

arguing for what

slate swan
#

Dont quite understand anybody here

upbeat otter
maiden fable
#

Then what's the error

upbeat otter
boreal ravine
#

cog has no setup function even though it has one

maiden fable
maiden fable
boreal ravine
maiden fable
#

Oops wrong reply

upbeat otter
boreal ravine
#

are you sure your running the right file? maybe you have another bot with the same file and your pc is running that one

maiden fable
slate swan
upbeat otter
maiden fable
#

@hidden hazel show a pic of the file

upbeat otter
maiden fable
#

No, the whole file

upbeat otter
#

lol

maiden fable
#

Bro no, the cog file

maiden fable
#

Probably not

#

Yea

#

Uhhh, can u show the main bot file where u r loading the Cogs?

#

That should have worked

#

So commands cog gets loaded, right?

slate swan
upbeat otter
maiden fable
#

So that tells there's a problem in your listeners file, not in the main bot file

#

Did u try restarting the bot?

slate swan
maiden fable
boreal ravine
#

@hidden hazel are you running the latest file of your bot

maiden fable
#

Try starting it again

#

Huhhhhh

#

Show

boreal ravine
#

because its outside your class

maiden fable
#

It should be outside

boreal ravine
#

yep

maiden fable
#

BTW

#

Imagine a new way of loading cogs built inside dpy itself

#

Like

upbeat otter
boreal ravine
unkempt canyonBOT
#

load_extension(name, *, package=None)```
Loads an extension.

An extension is a python module that contains commands, cogs, or listeners.

An extension must have a global function, `setup` defined as the entry point on what to do when the extension is loaded. This entry point must have a single argument, the `bot`.
maiden fable
#

Like in the dpy source code, it's already written

class Cog(...):
    @classmethod
    def setup(cls, bot):
        bot.add_cog(cls(...)) 

And the library just does Cog.setup(self)

boreal ravine
maiden fable
boreal ravine
#

hm

maiden fable
#

Idts

upbeat otter
#

use try and except when you load the extensions

maiden fable
#

But it goes get loaded

maiden fable
maiden fable
#

Yea me too

#

Do one thing. Restart your IDE

upbeat otter
maiden fable
#

Woke*

#

๐Ÿ˜

slate swan
#

Delete the type hint cause why not

maiden fable
#

No need

#

I do that most times

slate swan
#

No need for it either

upbeat otter
maiden fable
#

Well ๐Ÿคทโ€โ™‚๏ธ

slate swan
maiden fable
#

Bruhhhhh ๐Ÿ˜

slate swan
#

๐Ÿšถ

#

Bye

maiden fable
#

๐Ÿคฃ

upbeat otter
#

me too, bye

maiden fable
#

Lmfaooo

upbeat otter
#

wrong gif nvm

maiden fable
#

Get some sleep y'all, imma play some games help everyone here

upbeat otter
#

go play

maiden fable
#

Oh well I got one tomorrow, soo uhhh

#

Yea cool

upbeat otter
maiden fable
#

Thanks

slate swan
#

My grades are coming soon and if i fail again no pc and programming for me for 5months๐Ÿšถ

#

๐Ÿ˜†

#

Wdym

#

Your token just resets for no reason

upbeat otter
#

@maiden fable your about me full when?

#

noice

maiden fable
upbeat otter
slate swan
upbeat otter
slate swan
#

Your token is none

upbeat otter
slate swan
upbeat otter
slate swan
#

Now i will cry myself to sleep๐Ÿšถ

upbeat otter
slate swan
#

Bye๐Ÿšถ

#

Its None lol

#

Thats like saying

str("")

๐Ÿšถ

#

Maybe it got reset ๐Ÿšถ

#

๐Ÿ•ด๏ธ

boreal ravine
#

how do i make a guild mark as read in my bot

slate swan
#

You dont you regenerate it and ctrl c ctrl v it

#

Or just press the copy button๐Ÿšถ

upbeat otter
slate swan
slate swan
#

Yes but tokens arent ints their complex so bad example

#

REALLY ๐Ÿ˜ฑ

#

Just type random stuff lol

#

Random stuff and not random ints

#

:levitate:

#

OMG REALLY ๐Ÿ˜ฑ

#

Im joking i know lol

#

Just an example if you try to convert or edit something that's none

upbeat otter
#

Sure

slate swan
#

If your using replit yes

#

Then why

#

๐Ÿ•ด๏ธ

upbeat otter
maiden fable
#

Me who uses a python file to save the token ๐Ÿ˜

slate swan
maiden fable
slate swan
cerulean canyon
#

Bro holy shit

#

light mode gives me aids omg im not even kidding

#

my eyessssssssssssssssssss holy shit

slate swan
#

Make it full brightness

#

your problem?

#

hm , make sure you use the same variable name and capitalisation when you do it

#

what ide/editor are you using?

#

oh , do you use the play like button on the right top to run your code?

#

dont do that , use this instead

#

run without debugging option

#

may i see your .env file , with the token removed ofc

shadow wraith
slate swan
#

it should be TOKEN =

#

since you use getenv('TOKEN')

#

yea just rename it , and use the run option i told , should work foinu

#

and where did you run it from?\

#

nah i mean , the play button
or the debugger option i told

shadow wraith
#

๐Ÿ•ด๏ธ do people do await bot.get_channel

#

if you do then im ๐Ÿšถ rn

slate swan
shadow wraith
#

that's reasonable

slate swan
#

lemme try doing it myself , brb

shadow wraith
#

i think it has to be awaited to use .send()

#

which is a quicker method

slate swan
#

ok so i have this in my bot file py Kakashi.run(getenv('TOKEN'))
this is my .env file

TOKEN ='token here'```and it works like a charm
slate swan
#

get() is async but fetch isnt

#

what did you name your env file? .env ill suppose , right?

slate swan
slate swan
slate swan
slate swan
#

get() is async but fetch isnt

#

READ IT AGAIN

shadow wraith
#

dawg bot.get_channel and get() are the same jk

slate swan
#

Yesyert

#

jk

shadow wraith
#

actually idk, i have never used get() before

slate swan
#

Same

pliant gulch
#

If you get really simple, yea get and get_channel are basically the same

slate swan
#

What was that๐Ÿ˜ณ

pliant gulch
#

Or they do the same thing/can do the same thing

shadow wraith
#

because i did

#

!e
import random
element = [1, 2, 3]
print(f"{element[random.randint(0, 2)]}")

unkempt canyonBOT
#

@shadow wraith :white_check_mark: Your eval job has completed with return code 0.

1
shadow wraith
#

and he kept telling me to use random.choice ๐Ÿ’€, if it does the same thing it does the same thing, andy told smth important

pliant gulch
#

Well, yea the eval code you sent makes no sense for you to index here

#

Indexing is fine, but you don't need to use it when you don't need to

#

Its a bit implicit imo

slate swan
#

Whats indexing again jam_cavedude

#

Iterating?

#

๐Ÿšถ

jade tartan
#

But i havent added a cog yet so

spring flax
unkempt canyonBOT
#

@spring flax :white_check_mark: Your eval job has completed with return code 0.

one
slate swan
#

Remember now lol

spring flax
#

picking?

slate swan
prisma spoke
#
    transcript_file = nextcord.File(io.BytesIO(transcript.encode()),
                                    filename=f"transcript-{ctx.channel.name}.html")
    await ctx.send(file=transcript_file)
```i want this it show like this in embed hyper link format how to do so?
#

its a file so if i do text it doesnt work

lament mesa
#

As far as I know [text](url) are only for hyperlinks.

prisma spoke
tawdry perch
#

Show code?

lament mesa
#

maybe you could use the pastbin api and upload your file there and send the link of the uploaded file

prisma spoke
#

it is a kind of ss

#

ig it can be done like only if i have a website of my own which is hosted

analog sparrow
#

I've been trying to make a useful discord bot for a while, but I can't get a good idea of what people would want to use, does anyone here have any ideas on a useful discord bot I could make?

lament mesa
spring verge
#

I had a question

#

over here as u can see we are tabulating text

#

similarly is there a way to tabulate images?

#

like the avatar

analog sparrow
tawdry perch
#

I don't really have concept ideas

slate swan
#

all the bots available rn aren't FULLY customizable

analog sparrow
#

what do you mean by fully? (to what extent? you can change any messages send, you can change any logic, or you can change the code?)

untold token
#

Pillow

spring verge
#

so I can use it to draw on img

untold token
#

You need pil to draw lmao

astral cobalt
#

If I have a function that I want to call using 2 different aliases but when a certain alias is called it does a different task how would I do that? @client.command(name="call1", aliases=['call2']) async def call1(ctx): if(call1): do this if(call2): do this instead Something like this

untold token
#

Well just create an another command instead

astral cobalt
#

Yeah I could do that but they are esentially the same thing but changing one variable inside

#

I feel like the wouldent be very efficient

#

Basically I wanna change a value baised on what the input it

untold token
#

The thing is, aliases will call function which you have made an alias too

spring verge
#

or can u?

untold token
#

You could just take an argument instead

untold token
spring verge
#

I was using tabulate module for text

spring verge
untold token
#

Tabulate only generates text

spring verge
#

yea thats why

untold token
#

How will it work on an image

spring verge
#

bro thats why I asked the question

untold token
#

You need PIL to draw the image

spring verge
untold token
#

Use tabulate to generate the text

#

and use pil to take that text and draw on it on the avatar

spring verge
#

to "generate text"

untold token
#

Use both

#

you have to use PIL in order to write or read text from images and based on that you can use tabulate to do stuff and then use PIL again to work on the image

untold token
#

Oh wait, what are you exactly try to do

manic wing
#

!d discord.ext.commands.Context.invoked_with || this shows the alias it was invoked with, you can just do if ctx.invoked_with == โ€ฆ

unkempt canyonBOT
untold token
#

Hm that would work too

#

Also if they were using dpy 2.0 they could use Flags

untold token
manic wing
#

i gave the most efficient way

untold token
#

Flags would be better

#

But okay

manic wing
upbeat otter
spring verge
# untold token What are you trying to do?

I mean I dont wanna discuss it further cuz its really not helping me .. not ur fault tho.. I was just trying to create leadberboard using tabulate text etc which all worked but now I want to tabulate avatars as well the same way I am doing for text in my leaderboard

#

I will try to figure it out ๐Ÿ‘

untold token
untold token
#

How are you generating the data

manic wing
spring verge
#

u mean the user ids or

#

the avatar

#

btw I am generating avatar by fetching user object from user id

#

and I take the user id from my db

untold token
#

So yeah it would be better imo

#

But your way works too

manic wing
untold token
untold token
spring verge
#

but avatars cant be created as table of text

untold token
#

OH

#

OH

#

You mean reading the image?

spring verge
#

Imma just share the github code one sec

untold token
#

Alright

manic wing
spring verge
#

so this is the general code I am talking about .. now as u can see here u open a template and then add tabulated text on the image by drawing

untold token
spring verge
#

all of that I was able to do but what if I want to create another table of user avatars near the names of users

#

to make my leaderboard better

manic wing
upbeat otter
#

Dont fight please ,-,

untold token
#

I gave a suggestion that can be useful for them, about command flags, yes they didn't ask for it exactly, but what's the harm in knowing about it. Stop making bullshit comparison.

untold token
upbeat otter
#

Good

untold token
#

Like that?

spring verge
untold token
#

Ah I see

#

So text and image like an avatar, in an embed

#

So something like

spring verge
#

brb

untold token
#

Okay

spring verge
verbal cairn
#
class FullMenu(disnake.ui.View):
    message: disnake.Message

    def __init__(self, embeds: list[disnake.Embed]):
        super().__init__(timeout=90.0)
        self.embeds = embeds
        self.embed_count = 0

    async def on_timeout(self):
        await self.message.edit(view=None)

    @disnake.ui.button(label="", emoji=":rewind:", style=disnake.ButtonStyle.blurple)
    async def first_page(self, button: disnake.ui.Button, interaction: disnake.MessageInteraction):
        if self.embed_count == 0:
            pass
        else:
            self.embed_count == 0
            embed = self.embeds[self.embed_count]
            embed.set_footer(text=f"Page 1 of {len(self.embeds)}")
            await interaction.response.edit_message(embed=embed)

    @disnake.ui.button(label="", emoji=":arrow_backward:", style=disnake.ButtonStyle.blurple)
    async def back_a_page(self, button: disnake.ui.Button, interaction: disnake.MessageInteraction):
        if self.embed_count == 0:
            pass
        else:
            self.embed_count -= 1
            embed = self.embeds[self.embed_count]
            embed.set_footer(text=f"Page {self.embed_count + 1} of {len(self.embeds)}")
            await interaction.response.edit_message(embed=embed)

    @disnake.ui.button(label="", emoji=":arrow_forward:", style=disnake.ButtonStyle.blurple)
    async def next_page(self, button: disnake.ui.Button, interaction: disnake.MessageInteraction):
        if self.embed_count == (len(self.embeds) - 1):
            pass
        else:
            self.embed_count += 1
            embed = self.embeds[self.embed_count]
            embed.set_footer(text=f"Page {self.embed_count + 1} of {len(self.embeds)}")
            await interaction.response.edit_message(embed=embed)

    @disnake.ui.button(label="", emoji=":fast_forward:", style=disnake.ButtonStyle.blurple)
    async def last_page(self, button: disnake.ui.Button, interaction: disnake.MessageInteraction):
        if self.embed_count == (len(self.embeds) - 1):
            pass
        else:
            self.embed_count == (len(self.embeds) - 1)
            embed = self.embeds[self.embed_count]
            embed.set_footer(text=f"Page {len(self.embeds)} of {len(self.embeds)}")
            await interaction.response.edit_message(embed=embed)
spring verge
#

see this image leaderboard

verbal cairn
#

my first page and last page buttons dont work properly

#

i cant figure out why tho

untold token
unkempt canyonBOT
#

Hey @untold token!

It looks like you tried to attach file type(s) that we do not allow (). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

spring verge
untold token
#

Oops

untold token
#

I see

spring verge
#

yes everything is there in my leaderboard except the avatars

placid skiff
verbal cairn
#

the first / last page buttons just go to the last page

untold token
#

Well when you generate the lb, maybe you can add some kind ID system that like

  1. ID: data

And when you are generating the image, compare the ID and paste the image with right size and send it

verbal cairn
#

but dont set the embed count

untold token
#

You can use user IDs ofc

placid skiff
#

or false lol

spring verge
#

thats the main problem

slate swan
#

can anybody help me pls

#

what u typing so long

untold token
slate swan
#

@untold token can u help me

untold token
#

To generate images , you need to loop

placid skiff
# verbal cairn yeah that fixed it ty

np. If i can suggest another thing, in your code you are checking for example if the page is equal to 0 or equal to the length but usually, for convenience, it is better to check if the variable is not equals to something, so you don't need the pass statement, for example:

if self.embed_count != 0:
  #do your stuff
if self.embed_count != (len(self.embeds) -1):
  #your other stuff

nothing change of course, but the code will look a little bit better

#

you will not even need to use the else statement doing it like this

verbal cairn
boreal ravine
boreal ravine
verbal cairn
#

I dont see a label kwarg?

boreal ravine
#

wtf

boreal ravine
verbal cairn
#

I was testing stuff with it idk

#

didnt wanna retype the label each time

crimson sparrow
#

everytime I respond back with the response type 7 in my discord components using my bot keeps returning that this interaction took too long to respond or you have already responded to it, but when I switch the token to a different bot using the exact same bot everything works fine

(I am using a third party package for the discord packages -- discord-components)

slate swan
#

` if message.content.lower() == '>register':
with open("/Users/bai/Documents/Personal Things/PythonDiscord/userprofile.txt",'a') as f:
f.write(str(message.author.id) + '\n')
f.write("UserBal: 0" + '\n')

    if message.content.lower() == '>bal':
        with open("/Users/bai/Documents/Personal Things/PythonDiscord/userprofile.txt",'r') as f:
            print(f.readlines())
            if str(message.author.id) in f.read():
                print('true')              `
#

im trying to let python read the text file

#

First is the user id
and then the user bal

#

all the other parts work, except for the last 2 lines

full valley
#

Anyone here decent with asyncio.tasks shrug

#

Been making help channel after help channel but no one has responded. I feel I have given all the necessary information

boreal ravine
slate swan
#

โ€ฝ?????ยฟ?????

#

bro

#

what

#

4096gb

compact harbor
#

Don't use quotations in .env file..
Use,

TOKEN= UHD21BXJSK6_31BDDNMZNS```
Like that...
slate swan
compact harbor
slate swan
compact harbor
#

In env file the key must be uppercase, such as
TOKEN, not Token

tawdry perch
tawdry perch
#

but in theory it should not affect my code at all

placid skiff
#

Have you stolen a NASA a PC? ๐Ÿ˜†

slate swan
#

bro owns a whole datacentre in 1 pc

tiny ibex
#

WTF

placid skiff
#

I want it too hahaha

tiny ibex
#

4096 GB

astral cobalt
#

Anyone know why discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: ffmpeg was not found. is popping up?

#

Im trying to get my bot to play an mp3

tawdry perch
#

music bot..?

astral cobalt
#

No just an mp3 file

tiny ibex
#

Simply says that

placid skiff
#

check the file directory

tawdry perch
#

you don't have ffmpeg installed?

tiny ibex
#

Install ffmpeg

placid skiff
#

and the path in your code

#

ah lol it wasn't the file

#

cancel everything

tiny ibex
astral cobalt
#

Ohhhh I though it was saying it couldent actually find the file

#

Okay sweet thank you

#

@tiny ibex Still says discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: ffmpeg was not found. even though I imported it

maiden fable
astral cobalt
#

I cant just use pip?

prisma spoke
#

once my bot reatarts...if i used buttons in my bot...why does it show interaction failed? how can i solve that?
i need to set the button roles again so that it works
anyway to solve that?

tiny ibex
#

@astral cobalt

astral cobalt
#

same thing for mac?

#

but the mac version instead of windows

#

do I just clone the git to the folder my bot is in?

verbal cairn
#

anyone know how I can update the options in a dropdown menu when a command is used, and how I can change the view to the updated options view

maiden fable
verbal cairn
maiden fable
#

Where u wanna edit the message with a new view

compact harbor
#

!pypi ffmpeg-python

unkempt canyonBOT
tiny ibex
#

Just my wish

#

ยฏ_(ใƒ„)_/ยฏ

gleaming hatch
#

(Discord.py) My mind is melting while trying to understand Cooldown and CooldownMapping ๐Ÿคฆ

#

I wanted to detect spam messages that is sent to every channel...

#

And CooldownMapping isn't documented, how can i learn about these or could someone explain me?

unkempt canyonBOT
#

Cooldowns in discord.py

Cooldowns can be used in discord.py to rate-limit. In this example, we're using it in an on_message.

from discord.ext import commands

message_cooldown = commands.CooldownMapping.from_cooldown(1.0, 60.0, commands.BucketType.user)

@bot.event
async def on_message(message):
    bucket = message_cooldown.get_bucket(message)
    retry_after = bucket.update_rate_limit()
    if retry_after:
        await message.channel.send(f"Slow down! Try again in {retry_after} seconds.")
    else:
        await message.channel.send("Not ratelimited!")

from_cooldown takes the amount of update_rate_limit()s needed to trigger the cooldown, the time in which the cooldown is triggered, and a BucketType.

slate swan
#

this may be helpful

gleaming hatch
#

So, what CooldownMapping and get_bucket does? And what is a bucket

#

Sorry if i am being dumb, my mind is melting right now :(.

lament depotBOT
#
You have to stop.

@dapper cobalt, please enable your DMs to receive the bookmark.

dapper cobalt
prisma spoke
#
class Close(nextcord.ui.View):
    def __init__(self):
        super().__init__()
        self.value = None

    @nextcord.ui.button(label = "Close", style=nextcord.ButtonStyle.red)
    async def tClose(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
        if interaction.user.guild_permissions.manage_messages:
            await interaction.channel.delete()
        elif interaction.user.guild_permissions.manage_messages is not True:
            await interaction.channel.set_permissions(interaction.user, view_channel=False)

        self.value=True

class Tickett(nextcord.ui.View):
    def __init__(self):
        super().__init__()
        self.value = None

    @nextcord.ui.button(label = "Paid Ticket", style=nextcord.ButtonStyle.gray)
    async def inv(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
        categ = nextcord.utils.get(interaction.guild.categories, id=918104010135834674)
        await interaction.response.send_message("Creating a ticket for you, this may take a while!", ephemeral=True)
        ticket_channel = await categ.create_text_channel(name=f"{button.label}{interaction.user.name}")
        embed=nextcord.Embed(description=f"<#{ticket_channel.id}> - Your ticket has been created")
        await interaction.edit_original_message(embed=embed)
        await ticket_channel.set_permissions(interaction.user, read_messages=True, send_messages=True)
        view=Close()
        await ticket_channel.send(f"{interaction.user.mention}")
        embed = nextcord.Embed(title=f"Support Needed!", description=f"A ticket opened by **{interaction.user.name}**,\n Server Display name is **{interaction.user.display_name}**\n Support will be with you soon!\, Please describe your problem in the chat!\n The **Close button** can only be used by staffs with manage messages perms!", color=0xFF0000 )
        await ticket_channel.send(embed=embed, view=view)
        
        self.value=True```
#

i have this ticket sys right here...i want that in the class of "Tickett" the interaction.user...who opened the channel...his perms of view_channel shud be false whenever someone clicks the close button

#

how to do it?

small igloo
#

sup

valid barn
#

how can i get a list of all the command author's roles?

leaden jasper
#

how can i only get channels that my bot can see, because for channel in ctx.guild.channels shows every channel in the server

leaden jasper
unkempt canyonBOT
#

property roles: List[Role]```
A [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role") that the member belongs to. Note that the first element of this list is always the default [โ€˜@everyone](mailto:'%40everyone)โ€™ role.

These roles are sorted by their position in the role hierarchy.
valid barn
#

thx

#

will it return each of the role name or the whole role itself

leaden jasper
#

it will return a list

#

if they have no roles it will return []

upbeat otter
leaden jasper
#

empty list

#

yep

#

!d discord.Role

unkempt canyonBOT
#

class discord.Role```
Represents a Discord role in a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild")...
valid barn
#

how can i make it return only name tho

leaden jasper
unkempt canyonBOT
leaden jasper
#
for role in ctx.author.roles:
  print(role.name)
#
await ctx.send(', '.join([role.name for role in ctx.author.roles]))
valid barn
valid barn
leaden jasper
#
listVariable = [role.name for role in ctx.author.roles]
#

? like that

valid barn
#

yeah i think so

valid barn
upbeat otter
leaden jasper
#

outside of wut loop?

valid barn
#

the for loop

upbeat otter
leaden jasper
#

the for loop is in one line

boreal ravine
leaden jasper
#

how can i only get channels that my bot can see, because for channel in ctx.guild.channels shows every channel in the server

upbeat otter
leaden jasper
#

i can see private channels

boreal ravine
#

are you sure it doesnt have admin or anything

leaden jasper
leaden jasper
#

it doesn't have admin

upbeat otter
leaden jasper
#

ctx.guild.channels just lists all channels

#

even if u cant see them

boreal ravine
# leaden jasper yep

no idea but you could loop through the the guilds channels permissions and see if the bot has the view_channel permission and if it does, append it to a list or something

leaden jasper
visual island
boreal ravine
#

^^ you can iterate through that and check if your bot has a certain permission

leaden jasper
#

ok ill use that ty

#

how to check if a channel is a category

visual island
#

isinstance(channel, CategoryChannel)

leaden jasper
#

oh okay

#

thanks

valid barn
#
    roles = [role.name for role in ctx.author.roles]
    print(roles)
    rolename = await client.wait_for('message', check = check, timeout = 20)
    if rolename in roles:
      await ctx.send(embed=discord.Embed(description="Ok!!"))
    else:
      await ctx.send(embed=discord.Embed(description="You don't have that role!"))

sends "you dont have that role" even though i do. i printed the list roles out and the role i wrote was there? whats the problem?

maiden fable
#

Try printing rolename

valid barn
#

oh wait i think i got it

#

i was supposed to write rolename.content instead?

maiden fable
#

Yea

#

rolename is a discord.Message object

valid barn
valid barn
slate swan
#

no

maiden fable
#

No it's a property

boreal ravine
#

imagine danny made that a method

valid barn
#

k

boreal ravine
#

and not a property

#

๐Ÿค”

valid barn
#

thx it works

#

now how do i get a role from its role name alone?

#

is there any other way than using utils?

boreal ravine
valid barn
#

ok how do i use it with utils

slate swan
#

you would have to loop thru guild.roles , but utils.get does the same already

slate swan
unkempt canyonBOT
#

discord.utils.get(iterable, **attrs)```
A helper that returns the first element in the iterable that meets all the traits passed in `attrs`. This is an alternative for [`find()`](https://discordpy.readthedocs.io/en/master/api.html#discord.utils.find "discord.utils.find").

When multiple attributes are specified, they are checked using logical AND, not logical OR. Meaning they have to meet every attribute passed in and not one of them.

To have a nested attribute search (i.e. search by `x.y`) then pass in `x__y` as the keyword argument.

If nothing is found that matches the attributes passed, then `None` is returned.

Examples

Basic usage...
slate swan
#

so basically utils.get(guild.roles , name='role name')

valid barn
#

k thx

#

do i use await?

maiden fable
#

No

valid barn
#

therole = utils.get(ctx.guild.roles , name='role name') like this?

#

@maiden fable@slate swan??

slate swan
#

sure

valid barn
#

it says utils is undefined

visual island
#

discord.utils

valid barn
#

from discord import utils?

maiden fable
#

Yea

spring verge
#

is there a way to tell with pillow where the text is ending? like over here how to tell pillow that I want to put discriminator after the username

#

I know I could just join the two strings

#

but then I also want different fonts for them

valid barn
#

code:```py
therole = utils.get(ctx.guild.roles , name=rolename)
print(therole)

```py
None``` why?
tawdry perch
#

wrong role name

valid barn
# tawdry perch wrong role name
roles = [role.name for role in ctx.author.roles]
print(roles)
rolename = await client.wait_for('message', check = check, timeout = 20)
if rolename.content in roles:
   await ctx.send(embed=discord.Embed(description="Ok!!"))
   therole = utils.get(ctx.guild.roles , name=rolename)
   print(therole)

how it is wrong??

boreal ravine
spring verge
valid barn
boreal ravine
#

!ytdl this also

unkempt canyonBOT
#

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

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

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

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

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

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

no, is youtube_dl

final iron
slate swan
#

lmao i see this ytdl error everywhere today

#

how do i send a img to discord webhoook

mental wadi
#

is js better than python for good bots ?

slate swan
#

ye

sage otter
slate swan
#

!d discord.Webhook.send

unkempt canyonBOT
#

await send(content=..., *, username=..., avatar_url=..., tts=False, ephemeral=False, file=..., files=..., embed=..., embeds=..., allowed_mentions=..., view=..., thread=..., wait=False)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Sends a message using the webhook.

The content must be a type that can convert to a string through `str(content)`.

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.

If the `embed` parameter is provided, it must be of type [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") and it must be a rich embed type. You cannot mix the `embed` parameter with the `embeds` parameter, which must be a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`Embed`](https://discordpy.readthedocs.io/en/master/api.html#discord.Embed "discord.Embed") objects to send.
valid barn
#
shopp.append({'name', rolename.content, 'price':price.content, 'desc':desc.content})

it underlines this 'price':price.content, 'desc':desc.content}) and says invalid syntax why? ๐Ÿ˜ญ

vocal plover
#

because you put a comma after 'name' not a colon

#

that makes it a set, not a dict, so when you treat it as a dict later its seen as an error

slate swan
#

Good morning guys

tawdry perch
#

Good day

visual island
#

good night

slate swan
#

!d print spring dale senior school 10 times

unkempt canyonBOT
#

print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)```
Print *objects* to the text stream *file*, separated by *sep* and followed by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as keyword arguments.

All non-keyword arguments are converted to strings like [`str()`](https://docs.python.org/3/library/stdtypes.html#str "str") does and written to the stream, separated by *sep* and followed by *end*. Both *sep* and *end* must be strings; they can also be `None`, which means to use the default values. If no *objects* are given, [`print()`](https://docs.python.org/3/library/functions.html#print "print") will just write *end*.

The *file* argument must be an object with a `write(string)` method; if it is not present or `None`, [`sys.stdout`](https://docs.python.org/3/library/sys.html#sys.stdout "sys.stdout") will be used. Since printed arguments are converted to text strings, [`print()`](https://docs.python.org/3/library/functions.html#print "print") cannot be used with binary mode file objects. For these, use `file.write(...)` instead.
visual island
#

hmm?

valid barn
west shuttle
#

can i ask a question?

slate swan
#

thats what the channel is meant for

gaunt ice
#

oof

west shuttle
#

Lol

#

So i have a thanks counter... all good but when im trying to get the data its just showing []

gaunt ice
#

ur pfp is pog

west shuttle
slate swan
#

also , show related code

west shuttle
#

Wait

west shuttle
# slate swan also , show related code
    @commands.command()
    async def thanks(self, ctx, member: discord.Member):
        thanks = await self.db.execute("SELECT * from thxcounter where user_id = ?",(member.id,))
        counter = await thanks.fetchall()
        print(counter)
        em = discord.Embed(
            title=f"{member}'s thanks",
            description=f"**You have a total of `{counter}` thanks!**")
        await ctx.send(embed=em)
visual island
#

have you commit when updating the db?

slate swan
west shuttle
west shuttle
slate swan
#

( also ,as per your code the +1 changes the thanks to 1 , not add 1 to it.)

slate swan
visual island
slate swan
#

add one at the last

visual island
#

await self.db.cursor().fetchall() try that

west shuttle
visual island
visual island
#

show updated code

west shuttle
# visual island show updated code
@commands.command()
    async def thanks(self, ctx, member: discord.Member):
        thanks = await self.db.execute("SELECT * from thxcounter where user_id = ?",(member.id,))
        counter = await self.db.cursor().fetchall()
        print(counter)
        em = discord.Embed(
            title=f"{member}'s thanks",
            description=f"**You have a total of `{counter}` thanks!**")
        await ctx.send(embed=em)
visual island
#

what is self.db? Cursor object? Or Connection?

west shuttle
#
import discord
from discord.ext import commands, tasks
import aiosqlite

class thanks(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.db = None
        self.bot.loop.create_task(self.connect_database())
tawdry perch
#

erm.. how should I handle this? ```py
disnake.ext.commands.errors.NoEntryPointError: Extension 'MyBot.cogs.moderation.init' has no 'setup' function

visual island
#

show connect_database() method

west shuttle
visual island
tawdry perch
#

oo

visual island
tawdry perch
visual island
tawdry perch
#

hm

visual island
#

will pass the rest of the code inside the loop and go to the next elem

west shuttle
tawdry perch
snow flare
#

So I am using pycord to create a discord bot, and I am trying to implement a verification for the users, through a message, under which you have to react with a tick.
But when I use the on_row_reaction_add function, I get a correct payload with the channel id, guild id, user id, and everything else. But when I try to get the member that made the reaction using the user_id from the payload, it just returns None. This is how I try to get the member:

member = self.get_user(payload.user_id)
visual island
loud junco
loud junco
#

why is it not an emoji =.=

snow flare
visual island
#

what type is user_id? INTEGER?

loud junco
#

ya

west shuttle
snow flare
visual island
unkempt canyonBOT
#

Using intents in discord.py

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

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

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

from discord import Intents
from discord.ext import commands

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

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

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

west shuttle
snow flare
visual island
visual island
loud junco
snow flare
#

@visual island I've added the intents, and still doesn't work. For some reason it still returns None

loud junco
#

this is working tho

west shuttle
loud junco
#

wait.. u cant do that with custom emoji???

visual island
# loud junco

probably youre using a message's id instead of the emoji's id. How did you copy the emoji id?

loud junco
#

lemme try again

visual island
visual island
west shuttle
loud junco
#

906181459172282412-921026726304317470

visual island
#

thats the message id

loud junco
#

this is the message id

#

ik

visual island
#

yea

loud junco
#

921026726304317470

#

this is emoji id right?

visual island
#

no

west shuttle
loud junco
tawdry perch
#

rip it can't load extensions with that method

visual island
visual island
loud junco
#

oo

#

i right clicked the emoji

#

the copy id below right?

west shuttle
#

go to server settings - emojis - copy id

visual island
#

type that thing

loud junco
#

:pogchop:

#

no nitro

west shuttle
loud junco
#

:pogchop:

visual island
visual island
tawdry perch
#

I keep getting "extesion alrd loaded", even after I stop the bot and restart it, why is that?

#

is it cached or smth

visual island
loud junco
#

๐Ÿฅฒ

#

what id is this emoji

visual island
#

cache should be restarted after you stop the program

loud junco
#

921028171145576478?

visual island
#

its not a custom emoji so None

tawdry perch
#

hm

loud junco
#

oo

valid barn
#

is there something like json but it uses lists instead of dicts?

visual island
#

no, but why

tawdry perch
#
ext = []

for folder in os.listdir('MyBot/cogs/moderation'):
    if folder.endswith('.py') and not folder.startswith("__"):
        bot.load_extension(f"MyBot.cogs.moderation.{folder[:-3]}")
        ext.append(f"MyBot.cogs.moderation.{folder[:-3]}")
    else:
        continue
 
    for subfolder in os.listdir('MyBot/cogs/other'):
        if subfolder.endswith('.py') and not subfolder.startswith("__"):
            bot.load_extension(f"MyBot.cogs.other.{subfolder[:-3]}")
            ext.append(f"MyBot.cogs.other.{subfolder[:-3]}")
        else:
            continue
visual island
visual island
tawdry perch
#

It works with nested loop, why is that bad?

visual island
#

"it works"? You said it raised extension already loaded

tawdry perch
#

I fixed it

#

I removed the bot.load_extension from loop, and loaded ext which is a list

visual island
tawdry perch
#

hm I see, so I should keep them seperate?

visual island
#

yes

heavy folio
tawdry perch
#

what is "jishaku"?

heavy folio
#

!pypi jishaku

unkempt canyonBOT
slate swan
tawdry perch
#

ye

visual island
slate swan
#

!pypi disnake-jishaku

unkempt canyonBOT
tawdry perch
#

I was just curious of what that was because I have seen it few times

west shuttle
slate swan
#

its a bot extension maintained by kraots

visual island
slate swan
#

one of the things it can do

heavy folio
#

you can also reload/unload extensions and many other stuff

slate swan
#

log out to

heavy folio
#

for some reason logout doesnt work for me smoetimes smilingthroughit

slate swan
#

weird mine does

heavy folio
#

it just auto logs back in after awhile

tawdry perch
slate swan
#

check the pypi

tawdry perch
#

nice

heavy folio
# visual island whats the issue

if i do .help command_name, it responds with plain text (although i have this:```py
async def send_command_help(self, command):
embed = discord.Embed(title=self.get_command_signature(command))
embed = discord.Embed(
title="Help",
color=COLOR,
timestamp=datetime.datetime.now()
)
embed.set_author(
name=self.context.bot.user.name,
icon_url=self.context.bot.user.display_avatar.url
)

    alias = command.aliases
    if alias:
        embed.add_field(name="Aliases", value=", ".join(alias), inline=False)

    channel = self.get_destination()
    await channel.send(embed=embed)

```if i do .help without args then it'll send the embed (as it should)

slate swan
#

it will show all the commands

tawdry perch
#

so it's like disnake, but different name

slate swan
tawdry perch
#

and + features*

#

jishaku

slate swan
#

no its an extension

tawdry perch
#

oo

slate swan
#

for bot developers

#

you load it as a cog

west shuttle
heavy folio
tawdry perch
#

so it wont change my code?

slate swan
#

bot.load_extension("jishaku") even if you download the disnake version

slate swan
tawdry perch
#

nice

slate swan
#

yep

tawdry perch
#

maybe I could add that

visual island
slate swan
heavy folio
#

hmm

visual island
heavy folio
#

let's see

tawdry perch
unkempt canyonBOT
#
Not in my house!

Sorry, you can't do that here!

west shuttle
tawdry perch
#

brehh

visual island
heavy folio
#

also how do i hide jishaku from help

visual island
west shuttle
heavy folio
#

it should be like this ^

visual island
#

also slice it to 0

lament mesa
tawdry perch
#

indexing that output is fun

west shuttle
#

i guess i have a solution

#

igtg

visual island
# heavy folio nope

for the Help field use command.description (I personally use command.callback.__doc__ hehe). And for the Aliases field your current code is right, just the command has no aliases

sage otter
#

For the doc string?

visual island
#

yep

sage otter
#

Command.help does the same thing.

#

!d discord.ext.commands.Command.help

unkempt canyonBOT
sage otter
#

Thatโ€™s what I use atleast for doc strings.

visual island
#

it doesn't include indentation stuff iirc

sage otter
#

oh?