#discord-bots

1 messages Β· Page 276 of 1

agile latch
#

@formal basin

#

I love you

formal basin
#

no homo

agile latch
#

man at this point full homo

#

nah but fr thx for the help

vestal yew
#

bruh askljdksaldjaslkdasdk

formal basin
#

no homo

agile latch
#

no homo

formal basin
agile latch
#

I mean I know the very rudimentary stuff, I just don't know anything about the discord library

#

or any library

formal basin
#

ok

agile latch
#

because you helped me I will upvote your bot

formal basin
vestal yew
#

zagzag Do you think this logging event I created will do the job?

@Bot.event
async def on_message(message):
author_name = message.author.name
if isinstance(message.channel, nextcord.DMChannel):
log_folder = os.path.join("logs", "DM")
log_file = os.path.join(log_folder, f"{message.author.name}.txt")

else:
    log_folder = os.path.join("logs", message.guild.name)
    log_file = os.path.join(log_folder, "mesaj-log.txt")
    
if not os.path.exists(log_folder):
    os.makedirs(log_folder)

with open(log_file, "a", encoding="utf-8") as f:
    f.write(f"[{current_time}] {author_name}: {message.content}\n")

await Bot.process_commands(message)
formal basin
agile latch
#

:)

#

oh wait I had 2 problems

agile latch
#

so you fixed the 1st one, 2nd one is, I want the recognised word to be isolated and not just part of another word, the key word is "ip" and it works if I say "nipple" for an example

#

which is not ideal

formal basin
#

one second

agile latch
#

πŸ‘

formal basin
#

ok back

agile latch
#

wb

formal basin
#

show your code

agile latch
formal basin
#

that is the whole on_message

#

??

agile latch
#

erm

#

I guess

formal basin
#

wdym

unique lichen
#

btw that file = file doesnt work for paginator lib 😭 i can link up that lib if u wanna have a look

formal basin
#

is that all the code in the on_message event?

agile latch
#

yea

buoyant quail
naive briar
#

!e

print("cat" in "cat")
print("cat" in "copycat")

print("cat" == "cat")
print("cat" == "copycat")
unkempt canyonBOT
#

@naive briar :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | True
002 | True
003 | True
004 | False
formal basin
# agile latch

this code here will just do this: when you type "ip" its gonna send this "The server IP is: hello.com"

naive briar
#

Just use == instead

unique lichen
#

like its based on discord.oy2.0

formal basin
agile latch
formal basin
#

ok as @naive briar said just switch the in with ==

naive briar
agile latch
#

god yall are really making me feel like a dumbass but, where do I put the == πŸ’€

unique lichen
naive briar
#

Making your own custom paginator might not be as hard as you'd think

naive briar
formal basin
unique lichen
#

i am trying to send local images inside paginator embeds

standard solution is using .send(file=f , embed=) thing

#

but i cant use that

naive briar
#

Already know it

agile latch
#

oh how I adore you @formal basin and you too @naive briar

formal basin
#

all fixed?

agile latch
#

all fixed

formal basin
#

thats good

agile latch
#

I shall get reading on more python before I try to put my next feature in

#

but expect me to come back here soon :)

formal basin
#

yeah I recommend

slate swan
unique lichen
naive briar
#

Yes?

naive briar
unique lichen
#

Can anybody else tlel how to add local images to embed directly

naive briar
#

What Discord library is this?

slate swan
vestal yew
#

@formal basin help me

naive briar
slate swan
naive briar
#

Well, I guess only libraries that uses the discord module name count

vestal yew
#

from nextcord.ext import commands

class SohbetCevaplama(commands.Cog):
def init(self, Bot):
self.Bot = Bot

@commands.command()
async def selam(self, ctx):
    await ctx.send("Merhaba!")

def setup(Bot):
Bot.add_cog(SohbetCevaplama(Bot))


initial_extensions = ["commands.sohbet_cevaplama.py"]

if name == "main":
for extension in initial_extensions:
try:
Bot.load_extension(extension)
except Exception as e:
print(f"Failed to load extension {extension}: {e}")

error :
Failed to load extension commands.sohbet_cevaplama.py: path attribute not found on 'commands.sohbet_cevaplama' while trying to find 'commands.sohbet_cevaplama.py'

naive briar
#

Those are module names that py-cord also uses

#

So it's not clear enough

slate swan
unique lichen
slate swan
#

really trying to think

#

using all proccessing power

slate swan
vestal yew
#

vitness

buoyant quail
vestal yew
#

help me :,)

buoyant quail
#

what

unique lichen
frosty beacon
#

can i add decorator to the commands.Cog.listener("on_message")

from discord.ext import commands
def validation():
    async def predicate(message) -> bool:
        return (
            message.author.id in wishlisted,
            message.guild.id in wishlisted_guilds,
            message.channel.id in wishlisted_channels,
        )
    return commands.check(predicate)

class Test(commands.Cog):
    def __init__(self, bot: commands.Bot) -> None:
        self.bot = bot

    @commands.Cog.lister("on_message")
    @validation
    async def on_message(self, message: Message) -> None:
        # if validation fails this will not be called
        pass
async def setup(bot: commands.Bot):
  await bot.add_cog(Test(bot))
buoyant quail
naive briar
vale wing
#

Cog.lister when the when

naive briar
vale wing
#

And you implement them by overriding method

#

Not by adding a deco

frosty beacon
slate swan
vale wing
naive briar
slate swan
naive briar
#

Try to start the bot

vale wing
#

The "workaround" is putting if condition into listener itself

frosty beacon
vale wing
#

Yeah it's simple if condition

frosty beacon
#

some times they delete it

slate swan
frosty beacon
buoyant quail
#

That library isn't providing any way of giving file in the send

naive briar
slate swan
#

oki

unique lichen
naive briar
#

It does

#

That library doesn't

slate swan
# naive briar Try `pip freeze`, you might have multiple Discord libraries
aiohttp==3.7.4.post0
aiosignal==1.3.1
altgraph==0.17.3
async-timeout==3.0.1
attrs==22.2.0
beautifulsoup4==4.11.2
browser-cookie3==0.19.1
bs4==0.0.1
certifi==2022.12.7
chardet==4.0.0
charset-normalizer==3.0.1
colorama==0.4.6
discord-py-interactions==5.6.0
discord-py-slash-command==4.2.1
discord-typings==0.6.0
discord-ui==5.1.6
discord-webhook==1.1.0
discord.py==1.7.3
discordwebhook==1.0.3
emoji==2.4.0
frozenlist==1.3.3
idna==3.4
lz4==4.3.2
multidict==6.0.4
pefile==2023.2.7
Pillow==10.0.0
psutil==5.9.4
py-cord==2.0.0b1
pycryptodomex==3.18.0
pyinstaller==5.13.0
pyinstaller-hooks-contrib==2023.6
pystyle==2.9
pywin32-ctypes==0.2.2
requests==2.28.2
rgbprint==4.0.2
robloxpy==0.2.21
soupsieve==2.4
tomli==2.0.1
typing_extensions==4.6.3
urllib3==1.26.14
yarl==1.8.2
frosty beacon
naive briar
#

Don't worry about it

slate swan
#

oki

unique lichen
naive briar
#

That's still easy

slate swan
#

@naive briar Thanks for your help, im not gonna continue with this because its currently nearly 5am and i need sleep. sorry but i thank you very very much

naive briar
slate swan
#

ill fix it up in 4-5 days

#

ill make a txt file to do that

unique lichen
naive briar
#

Is that hard? I don't think so

slate swan
#

Ill be back in 4-5 days thanks @naive briar

livid hedge
#

hello, I have a simple question. Creating a bot is it a bad practice to extend the discord.py User class? Suppose you are creating a game and you have players inside. Is it a bad practice to extend the user class? class Player(discord.User)

naive briar
slate swan
unique lichen
naive briar
#

Someone sent you a FAQ like twice about this

vale wing
#

@frosty beacon there are two ways
Assume you have a function that checks condition

def check_friends(msg: discord.Message) -> bool:
    return msg.guild.id == your_guild_id

You can do that without decorator:

@Cog.listener()
async def on_message(self, msg: discord.Message):
    if not check_friends(msg):
        return
    ...  # the rest of code

And you can do that with decorator

def check_friends_deco(func: Awaitable):
    async def pred(self: Cog, msg: discord.Message):
        if not check_friends(msg):
            return
        await func(self, msg)  # i'm not even sure if these are correct args bruh
    return pred

@Cog.listener()
@check_friends_deco
async def on_message(self, msg: discord.Message):
    ...  # rest of the code

Decide for yourself which method is better lol

unique lichen
frosty beacon
naive briar
vale wing
#

Just fork that library or copy its source into your project lol

#

Or even better write your own paginator

naive briar
#

Yeah, it doesn't seem too hard to add the support anyway

unique lichen
vale wing
unique lichen
# vale wing Or even better write your own paginator

i don't know how to.... anyways i am saying how do you add "pages" and files together? sorry if i am explaining it badly but i am saying

if page1 has image1
and page2 has image2 , how to add both images without causing issues as files

naive briar
vale wing
unique lichen
#

to make clicking next sort of thing

vale wing
#

Perfect solution for your case, you only need to add a field into EmbedPaginatorEntry and alter _get_current_embed function to return file as well to use in update

unique lichen
#

thank you so much for help , that makes sense now

left dew
#

in a message content im checking if any of the words from items are in the message. however if i type in small, it should send an error message but it continues. how do i make it check for the full string and not just the single word?

items = ["small-set", "phantom-set"]
found_items = [item for item in items if any(word in message.content.lower() for word in item.split("-"))]
        if found_items:```
naive briar
#

!e pithink

message_content = "small"
items = ["small-set", "phantom-set"]
found_items = [item for item in items if any(word in message_content.lower() for word in item.split("-"))]

print(found_items)
unkempt canyonBOT
#

@naive briar :white_check_mark: Your 3.11 eval job has completed with return code 0.

['small-set']
spice drum
#

how can i make a discord chatbot with python?

turbid condor
spice drum
#

what do you mean?

naive briar
#

Often you'd need to have a model to process inputs and predict the response

turbid condor
#

Do you have a basic knowledge of ai and machine learning?

spice drum
#

I wanted to use the package: Chatterbot.

naive briar
#

!pip chatterbot

unkempt canyonBOT
agile latch
#

hey so I'm running my python bot using pterodactyl

#

and it seems like whenever I try to hit the "restart" option it just doesn't do that, it says it's doing it but nothing happens, I always have to kill the process

#

anyone run into something similar before ?

turbid condor
#

I think that's not a discord issue it's related to the service you using

#

So i suggest asking them instead

agile latch
#

worth a shot

#

I was thinking that maybe its because of the async processes ?

#

preventing it from restarting unless I kill the program

wispy pasture
#

https://srcb.in/8fXzzWJI61
this is a ticket bot and i m trying to use dropdown menus and buttons to make it

the error which i got is:

Traceback (most recent call last):
  File "/home/container/main.py", line 67, in <module>
    class CreateSelect(View):
  File "/home/container/main.py", line 80, in CreateSelect
    @CreateSelect.ticket.select  # Corrected decorator usage
NameError: name 'CreateSelect' is not defined```
winter hare
#

how would i make it to where the mention member's balance is shown in the values and not the member who sent the command

code:

@client.command(aliases=['bal'])
async def balance(ctx,member:discord.Member=None):
    await open_account(ctx.author)
    user = ctx.author
    users = await get_bank_data()
    if member is None:
        member = ctx.author

    if member is not None:
        member = member

    wallet = users[str(user.id)]['Wallet']
    bank = users[str(user.id)]['Bank']
    total = wallet + bank
    

    em = discord.Embed(title=f"{member.name}'s balance", color=discord.Color.random())
    em.add_field(name=':wt: Wallet Balance', value=f' :cn: {wallet}', inline=False)
    em.add_field(name=':bk: Bank Balance', value=f' :cn: {bank}', inline=False)
    em.add_field(name=':co: Total Balance',value=f' :cn: {total}', inline=False)
    await ctx.send(embed=em)
naive briar
#

Your member variable is unused

#

Well, maybe not

#

But you're getting wallet, bank data from using the user variable, not the member

winter hare
#

so change user to member?

#

ok solved

slate swan
#

okok, I need help, I want to start making an economy type system, but idk how to start, I've not done anything for it yet

hasty pike
#

How do i do reference=original_message() in button interaction reply

gilded cedar
#

how does User.global_name,
User.display_name and Member.display_name works? (discord.py version 2.3.0 update is pretty new and couldnt understand how it works)

buoyant quail
upbeat gust
upbeat gust
unkempt canyonBOT
#

discord/user.py lines 271 to 281

@property
def display_name(self) -> str:
    """:class:`​str`​: Returns the user's display name.

    For regular users this is just their global name or their username,
    but if they have a guild specific nickname then that
    is returned instead.
    """
    if self.global_name:
        return self.global_name
    return self.name```
buoyant quail
#

global_name is just an optional string variable

gilded cedar
#

hmm

slate swan
#

you can read their description on the docs

unkempt canyonBOT
#

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

!d discord.Member.global_name

unkempt canyonBOT
#

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

!d discord.Member.display_name

unkempt canyonBOT
#

property display_name```
Returns the user’s display name.

For regular users this is just their global name or their username, but if they have a guild specific nickname then that is returned instead.
slate swan
#

!d discord.Member.nick

unkempt canyonBOT
#

The guild specific nickname of the user. Takes precedence over the global name.

agile latch
#

Hey I'm working on a message purging feature for my bot

#

But there seems to be a problem, I followed a tutorial to get most of this down, checked and double checked, there's no errors or whatnot but I'm still running into issues

upbeat gust
#

Have you tried reading the error\

agile latch
#

I have

upbeat gust
#

and..?

agile latch
#

I did not understand

#

:D

upbeat gust
#

it quite clearly says "Missing Permissions"

slate swan
#

Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

agile latch
#

I see

#

It was indeed the problem

upbeat gust
#

:/

agile latch
#

:/

#

That's embarrassing

vestal harness
#

Hey all -- I'm diving into discord bot development. One of the things I can't suss out if there's a meaningful difference between app_commands and just doing commands.Bot. What are the major differences between the two?

upbeat gust
vestal harness
upbeat gust
#

they arent exactly related in any way

finite geyser
#

!d discord.ui.Select

unkempt canyonBOT
#

class discord.ui.Select(*, custom_id=..., placeholder=None, min_values=1, max_values=1, options=..., disabled=False, row=None)```
Represents a UI select menu with a list of custom options. This is represented to the user as a dropdown menu.

New in version 2.0.
finite geyser
slate swan
#

.ext.commands are only for prefixed commands

finite geyser
slate swan
#

proove me wrong

finite geyser
#

alr

slate swan
#

if he means hybrid commands then thats funny

pale zenith
#

Stupid bot

slate swan
#

!d discord.ext.commands.Bot.hybrid_command

unkempt canyonBOT
#

@hybrid_command(name=..., with_app_command=True, *args, **kwargs)```
A shortcut decorator that invokes [`hybrid_command()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.hybrid_command "discord.ext.commands.hybrid_command") and adds it to the internal command list via [`add_command()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.add_command "discord.ext.commands.Bot.add_command").
pale zenith
#

Does one always need the full qualified name?

finite geyser
#
import discord
from discord.ext import commands

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

@bot.tree.command(name="test")
async def test(int: discord.Interaction):
    await interaction.response.send_message("Test Message Submittes")
bot.run(":)")
buoyant quail
#

hybrid commands are importing app_commands for making slashes

upbeat gust
slate swan
upbeat gust
#

hi leo

slate swan
#

if you only use app commands you can just use Client

pale zenith
#

Hello chrispy

#

Long time eh

finite geyser
slate swan
#

do you even read what im saying?

unkempt canyonBOT
#

discord/ext/commands/bot.py line 176

self.__tree: app_commands.CommandTree[Self] = tree_cls(self)  # type: ignore```
upbeat gust
slate swan
#

the difference between Client and Bot is that Bot can define prefixed commands

finite geyser
slate swan
#

cause its not

finite geyser
#

but I am saying its present

buoyant quail
#

It uses app_commands for it

slate swan
finite geyser
#

yeah but I meant its present in discord.ext.commands too

slate swan
#

dam bros really not getting it

pale zenith
#

I mean, ext.commands does expand on the app commands framework by allowing app commands to be defined in cogs, but the underlying handler is still the CommandTree

upbeat gust
finite geyser
#

huh read it

slate swan
#

discord.Client can create slash commands only
discord.ext.commands.Bot can create all that Client can + prefixed commands

upbeat gust
wispy pasture
#

how to send various buttons in 1 embed:

    bot.add_view(CreateSelect())
    bot.add_view(CloseButton())
    bot.add_view(TrashButton())
    bot.add_view(one_star())
    bot.add_view(two_star())
    bot.add_view(three_star())
    bot.add_view(four_star())
    bot.add_view(five_star())

#one star
class one_star(View):
    def __init__(self):
        super().__init__(timeout=None)
    @button(label="⭐")
    async def close(self, interaction: discord.Interaction, button: Button):
        await interaction.channel.send("⭐ Review!")

#two star
class two_star(View):
    def __init__(self):
        super().__init__(timeout=None)
    @button(label="⭐")
    async def close(self, interaction: discord.Interaction, button: Button):
        await interaction.channel.send("⭐⭐ Review!")

#three star
class three_star(View):
    def __init__(self):
        super().__init__(timeout=None)
    @button(label="⭐")
    async def close(self, interaction: discord.Interaction, button: Button):
        await interaction.channel.send("⭐⭐⭐ Review!")

#four star
class four_star(View):
    def __init__(self):
        super().__init__(timeout=None)
    @button(label="⭐")
    async def close(self, interaction: discord.Interaction, button: Button):
        await interaction.channel.send("⭐⭐⭐⭐ Review!")

#five
class five_star(View):
    def __init__(self):
        super().__init__(timeout=None)
    @button(label="⭐")
    async def close(self, interaction: discord.Interaction, button: Button):
        await interaction.channel.send("⭐⭐⭐⭐⭐ Review!")

#other code balh balh balh
        
#commands
@tree.command(name="review", description="review")
async def slash_command(interaction: discord.Interaction):   
    await ctx.send(
        embed = discord.Embed(
            desription="Please give us  review"
        ),
        view= one_star(), two_star(), three_star(), four_star(), five_star()
    ) ```

now i want to send those rating buttons in the embed... how can i?
finite geyser
slate swan
#

you said .ext.commands is responsible for slash commands

pale zenith
finite geyser
slate swan
pale zenith
#

Rather than making a bunch of views

wispy pasture
finite geyser
wispy pasture
upbeat gust
wispy pasture
slate swan
#

in this example there are two buttons defined

pale zenith
finite geyser
pale zenith
#

You can't have two things named the same you would just overwrite the first one

upbeat gust
wispy pasture
slate swan
#

oh thats not an answer

hasty pike
#

He answered to my question i was just confirming 😭

slate swan
#

then no such method does not exist

hasty pike
#

Then how do i do it

#

Or it's not possible?

slate swan
#

!d discord.InteractionResponse

unkempt canyonBOT
#

class discord.InteractionResponse```
Represents a Discord interaction response.

This type can be accessed through [`Interaction.response`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.Interaction.response "discord.Interaction.response").

New in version 2.0.
slate swan
hasty pike
#

How long can i edit my bot's message?

#

Is there any limit?

upbeat gust
hasty pike
#

Alright

#

And how can i edit using command?

#

And message id

buoyant quail
#

!d discord.TextChannel.fetch_message

unkempt canyonBOT
#

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

Retrieves a single [`Message`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Message "discord.Message") from the destination.
buoyant quail
#

Looks like only message id is not enough
Only messageable objects have fetch_message, you need a channel or smth like that too

upbeat gust
#

!d discord.PartialMessage.edit

unkempt canyonBOT
#

await edit(*, content=..., embed=..., embeds=..., attachments=..., 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 2.0: Edits are no longer in-place, the newly edited message is returned instead.

Changed in version 2.0: This function will now raise [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.11)") instead of `InvalidArgument`.
upbeat gust
#

!d discord.TextChannel.get_partial_message

unkempt canyonBOT
#

get_partial_message(message_id, /)```
Creates a [`PartialMessage`](https://discordpy.readthedocs.io/en/latest/api.html#discord.PartialMessage "discord.PartialMessage") from the message ID.

This is useful if you want to work with a message and only have its ID without doing an unnecessary API call.

New in version 1.6.

Changed in version 2.0: `message_id` parameter is now positional-only.
upbeat gust
#

Use this instead of fetch_message, uses one less api call

upbeat gust
buoyant quail
#

i see

wispy pasture
#

well i think i added the sync:
https://srcb.in/EEiKplgARV

Traceback (most recent call last):
  File "/home/container/main.py", line 233, in <module>
    async def slash_command(ctx, interaction: discord.Interaction): 
  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 290, in decorator
    result = hybrid_command(name=name, *args, with_app_command=with_app_command, **kwargs)(func)
  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/hybrid.py", line 893, in decorator
    return HybridCommand(func, name=name, with_app_command=with_app_command, **attrs)  # type: ignore  # ???
  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/hybrid.py", line 509, in __init__
    HybridAppCommand(self) if self.with_app_command else None
  File "/home/container/.local/lib/python3.10/site-packages/discord/ext/commands/hybrid.py", line 306, in __init__
    super().__init__(
  File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 666, in __init__
    self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
  File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 374, in _extract_parameters_from_callback
    param = annotation_to_parameter(resolved, parameter)
  File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/transformers.py", line 834, in annotation_to_parameter
    (inner, default, validate_default) = get_supported_annotation(annotation)
  File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/transformers.py", line 793, in get_supported_annotation
    raise TypeError(f'unsupported type annotation {annotation!r}')
TypeError: unsupported type annotation <class 'discord.interactions.Interaction'>```
buoyant quail
#

What is ctx here?

#

Or interaction

#

There won't be two at once

wispy pasture
buoyant quail
#

You are making function with 2 parameters

#

ctx and interaction

wispy pasture
#

so that cant be done?

buoyant quail
#

so first will be actually interaction

#

and second discord.py will try to use as input from user

buoyant quail
turbid condor
#

Hybrid only uses ctx

wispy pasture
#

but if i dont add ctx, i get the error "ctx is undefined"

turbid condor
#

No need for interaction

wispy pasture
turbid condor
#

U synced it?

wispy pasture
#

yeah it think i did

turbid condor
#

Can u show the code where u syncing

buoyant quail
#

You have all of them with the same name on_rating_close

turbid condor
#

Give every button function a different name

wispy pasture
buoyant quail
#

on_bot_ready event doesn't exist i believe

turbid condor
#

Guy got me confused

buoyant quail
wispy pasture
turbid condor
#

As you are sending the whole view i believe

#

Not just buttons individually

wispy pasture
#

hmm alright

turbid condor
wispy pasture
# turbid condor Just change the function names

okay so this is the code:

class one_star(View):
    def __init__(self):
        super().__init__(timeout=None)
    @button(label="⭐")
    async def close(self, interaction: discord.Interaction, button: Button):
        await interaction.channel.send("⭐ Review!")

#two star
class two_star(View):
    def __init__(self):
        super().__init__(timeout=None)
    @button(label="⭐")
    async def close(self, interaction: discord.Interaction, button: Button):
        await interaction.channel.send("⭐⭐ Review!")

#three star
class three_star(View):
    def __init__(self):
        super().__init__(timeout=None)
    @button(label="⭐")
    async def close(self, interaction: discord.Interaction, button: Button):
        await interaction.channel.send("⭐⭐⭐ Review!")

#four star
class four_star(View):
    def __init__(self):
        super().__init__(timeout=None)
    @button(label="⭐")
    async def close(self, interaction: discord.Interaction, button: Button):
        await interaction.channel.send("⭐⭐⭐⭐ Review!")

#five
class five_star(View):
    def __init__(self):
        super().__init__(timeout=None)
    @button(label="⭐")
    async def close(self, interaction: discord.Interaction, button: Button):
        await interaction.channel.send("⭐⭐⭐⭐⭐ Review!")```

how do  make it send under 1 embed?
wispy pasture
cloud dawn
#

At least the setup_hook but preferably also when a command decorator/ function arg/kwarg has changed else don't resync.

turbid condor
cloud dawn
turbid condor
#

Then why make different classes for each

wispy pasture
wispy pasture
cloud dawn
turbid condor
#

Just make them all under one class like

class star(View):
    def __init__():

    @discord.....
    async def.....

    @discord.....
     async def.....
#

Do them like this

#

Then send this view

turbid condor
#

That's the decorator you using

cloud dawn
#

If it's just the rating that changes you can also just make a list comp of buttons.

wispy pasture
buoyant quail
turbid condor
#

In your case it will @buttons

wispy pasture
turbid condor
#

What u thought i was trolling XD

wispy pasture
turbid condor
#

Just create a command

wispy pasture
#

done

#

cmd made

turbid condor
#

Can you show it

wispy pasture
cloud dawn
#

lol

#

He prob meant the sync command.

turbid condor
#

I mean for sync

wispy pasture
#

i~ i never made a sync cmd?

turbid condor
#

Then make it

#

And make sure only owner can use it

wispy pasture
#

uhhh... how? like what to add?

turbid condor
#

Same way u create any other command

#

U just need to put the sync line in there

#

shouldn't be that hard i think

wispy pasture
#

ah okay okay

#

now makes sense.....

vestal yew
#

@Bot.slash_command(description="Kişiyi sunucudan banlar")
@commands.has_permissions(ban_members=True)
async def ban(ctx, member: nextcord.Member, *, reason=None):
if member == ctx.author:
await ctx.send("Kendinizi yasaklayamazsΔ±nΔ±z!")
else:
try:
await member.ban(reason=reason)
if reason:
await ctx.send(f"{member.mention} başarıyla yasaklandı! Sebep: {reason}")
else:
await ctx.send(f"{member.mention} başarıyla yasaklandı!")
except commands.MissingPermissions:
await ctx.send("Yeterli yetkiniz yok.")
except commands.BotMissingPermissions:
await ctx.send("Botun yeterli yetkisi yok.")
except nextcord.HTTPException as e:
await ctx.send(f"Hata oluştu: {e}")

@ban.error
async def ban_error(ctx, error):
if isinstance(error, commands.MissingPermissions):
if ctx.author.id == 924899524860850186:
await ctx.reinvoke()
else:
await ctx.send("Bu komutu kullanma yetkiniz yok.")
elif isinstance(error, commands.MemberNotFound):
await ctx.send("LΓΌtfen bir ΓΌye etiketleyin.")
elif isinstance(error, commands.BadArgument):
await ctx.send("LΓΌtfen bir geΓ§erli ΓΌye etiketleyin.")

#

@wispy pasture

#

@turbid condor

#

I am running my code, but I am getting an unresponsive application error. Can you help

vestal yew
turbid condor
#

So it only says the app did not respond?

#

@vestal yew

vestal yew
turbid condor
#

Ok try removing that error handler

#

That might be eating up the error

#

And then see what it prints

turbid condor
turbid condor
#

U sure cuz i never worked with nexcord

cloud dawn
#

Me too hence I checked

turbid condor
#

So welp we found the issue then i guess

vestal yew
#

my other commands are working.

turbid condor
vestal yew
cloud dawn
#

Yeah you can use whatever but it's just... different.

turbid condor
#

Welp then remove that error handler then and see

buoyant quail
#

It might have the same function
For example in disnake send for interaction is implemented as response + followup

turbid condor
#

I see

cloud dawn
turbid condor
#

This why i like dpy since there is a clear difference in every argument

vestal yew
#

Ignoring exception in command <nextcord.application_command.SlashApplicationCommand object at 0x0000026FE8066B10>:
Traceback (most recent call last):
File "C:\Users\Bayram\AppData\Local\Programs\Python\Python311\Lib\site-packages\nextcord\application_command.py", line 895, in invoke_callback_with_hooks
await self(interaction, *args, **kwargs)
File "c:\Users\Bayram\Desktop\Yongsun.py\yongsun.py", line 135, in ban
if member == ctx.author:
^^^^^^^^^^
AttributeError: 'Interaction' object has no attribute 'author'

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

nextcord.errors.ApplicationInvokeError: Command raised an exception: AttributeError: 'Interaction' object has no attribute 'author'

bruuuuhhhhhh

cloud dawn
#

it's interaction so it's user

#

Very cursed to call it ctx then lel

vestal yew
#

I will solve this issue right away.

buoyant quail
turbid condor
#

Idk why ppl test there code with error handler enabled it's my fifth time today

finite geyser
cloud dawn
#

Just use a global error handler, all you need.

turbid condor
turbid condor
cloud dawn
turbid condor
buoyant quail
cloud dawn
turbid condor
#

Yeah that's for a tree

finite geyser
#

which one is better dropdown menu roles or old reaction roles?

buoyant quail
#

I believe you don't have multiple trees

cloud dawn
buoyant quail
turbid condor
#

So I won't call that global

finite geyser
finite geyser
turbid condor
buoyant quail
cloud dawn
turbid condor
finite geyser
#

just asking so that I can decide which one should I add

turbid condor
finite geyser
#

ah alright

#

I am adding all 3

buoyant quail
cloud dawn
turbid condor
#

But still it's better to know the actual case

#

Rather than thinking about majority

cloud dawn
#

A lot of people here don't care about the actual case. They just want their code to work lol

turbid condor
#

On_error only for event

cloud dawn
#

I mean a interaction is an event so technically...

#

!d discord.on_interaction

unkempt canyonBOT
#

discord.on_interaction(interaction)```
Called when an interaction happened.

This currently happens due to slash command invocations or components being used.

Warning

This is a low level function that is not generally meant to be used. If you are working with components, consider using the callbacks associated with the [`View`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.ui.View "discord.ui.View") instead as it provides a nicer user experience.

New in version 2.0.
cloud dawn
#

So you could make a global error handler.

turbid condor
#

Can't say when it triggers incase after interaction is completed or same time the interaction happens

#

If it's after completion then u can't since incase of interaction fail there is no interaction that happened

cloud dawn
#

Hence why you have interaction id's and expires at attrs.

#

Or command_failed

buoyant quail
#

Even though prefix and slash commands are called from event, on_error is not called. just checked
@bot.command() - drops error
@bot.tree.command() - drops error
@bot.listen("on_message") - goes in on_error

hasty pike
#

I can store message id this way right?

buoyant quail
#

sure

final iron
slate swan
#

can some1 help me with my code?

clever scaffold
slate swan
#

how do i fix that]

#

i do js so i dont know this πŸ˜‚

clever scaffold
slate swan
#

ok and i cant do / command?

clever scaffold
#
def test(a = None):
  print(a)

test(b="Hello")

it will return same error

clever scaffold
slate swan
buoyant quail
#

bot.add_command is a function, not decorator

slate swan
#

but when i do @bot.slash_command it doesnt say its a attribute

buoyant quail
#

and usually you don't use it

#

you want @bot.command() i believe

#

for slashes you need another thing

#

if it's a bot then @bot.tree.command() will be enough (+ you need to sync it)
and changing your command to use interaction methods, not context

slate swan
clever scaffold
slate swan
#

no stick to py

naive briar
#

You mean no, stick to py

slate swan
buoyant quail
# slate swan

As it says, there is no Option in discord
Use what it has

#

I guess you want SelectOption

#

but you are typehinting with it... so i am not sure

slate swan
#

thanks so much for the help btw

slate swan
#

wait im getting the same error πŸ’€

naive briar
#

No one appreciate this kind of reaction

slate swan
#

ma fault

slate swan
#

oh

#

most common ones are discord.py nextcord disnake py-cord can you check if you have installed any of those

#

oh i use py-cord

#

You cant use two at once

#

oh so uninstall what one?

#

ok

#

thats the line im getting a error on

#

yes i agree yert

buoyant quail
#

!resources

unkempt canyonBOT
#
Resources

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

slate swan
#

alr bet

buoyant quail
#

the only answer i can give here

slate swan
#

Nah Bros just straight copied from the docs

#

Even with class keyword

#

πŸͺ¦

main holly
#

yo

slate swan
main holly
#

how do i make logs

upbeat ice
buoyant quail
#

1.7.2 :p

upbeat ice
#

yeah bookmarks a little dated it seems lol

slate swan
#

alr im advancing now

buoyant quail
#

SelectOption is not related to slashes

#

It's not a converter

slate swan
#

oh got it so what should i put instead of selectOption?

#

Choice?

#

what you expect it to do

buoyant quail
#

Descriptions in dpy are made with separate decorator

unkempt canyonBOT
#

examples/app_commands/basic.py lines 47 to 54

@client.tree.command()
@app_commands.describe(
    first_value='The first value you want to add something to',
    second_value='The value you want to add to the first value',
)
async def add(interaction: discord.Interaction, first_value: int, second_value: int):
    """Adds two numbers together."""
    await interaction.response.send_message(f'{first_value} + {second_value} = {first_value + second_value}')```
buoyant quail
#

if that's what you want

slate swan
#

Yeah and choices are made with decorator too

#

to like when you do a /ban command it pops up with a user selection

#

that

#

Then annotate argument as discord.Member

#

but not a ban command

slate swan
#

?

buoyant quail
#

Then annotate it with anything else you want

slate swan
#

use it as a integer like 1= one file in the popup and 2= another file

#

Use choices then

buoyant quail
#

!d discord.app_commands.choices

unkempt canyonBOT
#

@discord.app_commands.choices(**parameters)```
Instructs the given parameters by their name to use the given choices for their choices.

Example...
slate swan
#

!d discord.app_commands.choices

hushed galleon
upbeat ice
# hushed galleon looks pretty neat, but im a bit concerned about the fact they don't handle webho...

yeah i didn't notice that at first - although the source code for this project is so simple you probably could rewrite the posting part to use AsyncDiscordWebhook https://github.com/lovvskillz/python-discord-webhook#async-support

GitHub

execute discord webhooks. Contribute to lovvskillz/python-discord-webhook development by creating an account on GitHub.

hushed galleon
stark socket
#

image i have an account who is onwer of 10 servers is there a way to invite the same bots programaticly for these servers with oauth2? ( i mean bots that are not mine like music bots or m6 for example)

slate swan
#

this choice thingy ma jig is gonna make my head explode

buoyant quail
#

If you will make a bot that will open a link, choose server and solve discord antibot captcha for you...

naive briar
#

Overkill

buoyant quail
#

Very interesting challenge though

stark socket
#

yea pretty interesting challenge, what is even more interesting is i never done a captcha solver so maybe is time to try ; )

cold sonnet
#

y'all gonna have us solve the theory of everything as captcha

#

if it's so easy to make bots that solve captcha they're gonna make it harder

buoyant quail
#

it's hard even for humans

#

like smiling dogs among dogs

wispy pasture
#

Hey... What's the method to edit a bots reply which was sent in an embed with buttons?? interaction.response.edit?

upbeat ice
#

interaction.response.edit_message is what you are looking for

hasty coral
#

I am unfamiliar with the use of slash commands. Please can someone explain why my bot doesn't kick the user?

@bot.tree.command(name="kick", description="Kick a User")
@commands.has_permissions(kick_members=True)
@app_commands.describe(member = "user")
@app_commands.describe(reason = "reason")
async def kick(ctx: discord.Interaction, member: discord.Member, reason: str):
    if member == ctx.user:
        await ctx.response.send_message(f"{ctx.user.mention} you cannot kick yourself!")
    else:
        try:
            await member.kick(reason=reason)
            embed = discord.Embed(title="**User Kicked**", color=discord.Color.red())
            embed.add_field(name="Offender", value=f"{member.Mention}", inline=True)
            embed.add_field(name="Moderator", value=f"{ctx.user}", inline=True)
            embed.add_field(name="Reason", value=f"{reason}")
            await ctx.response.send_message(embed=embed)
        except discord.Forbidden:
            await ctx.response.send_message("I do not have permission to kick members.")


@kick.error
async def kick_error(ctx, error):
    if isinstance(error, commands.MissingPermissions):
        await ctx.response.send_message(f"{ctx.user.mention} You don't have permission to kick members.")
    elif isinstance(error, commands.BadArgument):
        await ctx.response.send_message(f"{ctx.user.mention} Invalid member provided.")
    else:
        await ctx.response.send_message(f"{ctx.user.mention} An error occurred while trying to kick the member.")```
slate swan
#

Well for a start you're using a prefix command decorator on a slash command

#

Otherwise not really without a traceback or knowing what it's doing instead

buoyant quail
#

and yeah an actual traceback would help
or at least what output you are getting

warm coral
#

i made this simple calculator please somone rate it btw im a begginer

clone_input = input("put anything and i will clone it !")

def clone_machine():
    print(clone_input)
    
clone_machine()

print("now for the calculator!")

first_number = int(input("type a number."))

second_number = int(input( "type a second number."))

print("i will give you the sum of the 2 numbers you typed")

question_ready = input("are you ready?")

if question_ready == "yes":
    print(first_number + second_number)
else:
    print("fuck you")
    
print("amazing right?")
print("now lets do a multiplication! ")

first_number = int(input("type a number."))

second_number = int(input( "type a second number."))
 
 
print("i will give you the multiplication of the 2 numbers you typed")

question_ready = input("are you ready?")

if question_ready == "yes":
    print(first_number * second_number)
else:
    print("fuck you")

print("bye")
slate swan
#

Cool, but this channel is specifically for discord bots

buoyant quail
#

That's a wrong channel for that

#

And also i don't like your answer for exiting the program

warm coral
#

im sorry

buoyant quail
#

For "are you ready?" question i mean

warm coral
#

yeah

#

if he didnt say yes

#

screw him :<

buoyant quail
warm coral
#

how to download the python package on vscode?

#

im really struggling

#

everytime i want to code

#

i go to an online compiler

buoyant quail
#

pip install package

warm coral
#

not working

#

do i replace packgae with discord?

buoyant quail
#

for example, yes

warm coral
#

package

#

stikk

#

still

#

not working

buoyant quail
#

what does it say

warm coral
#

idk what is this wite thing

buoyant quail
#

You need to write it not inside the python..

#

Use your terminal

slate swan
#

!repl

unkempt canyonBOT
#
Read-Eval-Print Loop (REPL)

A REPL is an interactive language shell environment. It first reads one or more expressions entered by the user, evaluates it, yields the result, and prints it out to the user. It will then loop back to the read step.

To use Python's REPL, execute the interpreter with no arguments. This will drop you into the interactive interpreter shell, print out some relevant information, and then prompt you with the primary prompt >>>. At this point it is waiting for your input.

Firstly you can start typing in some valid Python expressions, pressing <return> to either bring you to the eval step, or prompting you with the secondary prompt ... (or no prompt at all depending on your environment), meaning your expression isn't yet terminated and it's waiting for more input. This is useful for code that requires multiple lines like loops, functions, and classes. If you reach the secondary prompt in a clause that can have an arbitrary amount of expressions, you can terminate it by pressing <return> on a blank line. In other words, for the last expression you write in the clause, <return> must be pressed twice in a row.

Alternatively, you can make use of the builtin help() function. help(thing) to get help on some thing object, or help() to start an interactive help session. This mode is extremely powerful, read the instructions when first entering the session to learn how to use it.

Lastly you can run your code with the -i flag to execute your code normally, but be dropped into the REPL once execution is finished, giving you access to all your global variables/functions in the REPL.

To exit either a help session, or normal REPL prompt, you must send an EOF signal to the prompt. In *nix systems, this is done with ctrl + D, and in windows systems it is ctrl + Z. You can also exit the normal REPL prompt with the dedicated functions exit() or quit().

slate swan
#

you are in repl mode

warm coral
#

i write it in terminal @buoyant quail

slate swan
#

quit it

warm coral
slate swan
warm coral
#

ok thanks

plucky knoll
#

Hello, why can't I access Cog attrs when using app_commands? Could syncing tree in setup_hook be the reason?

...

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

    @app_commands.command(description="...")
    async def cmd(self, interaction: Interaction):
        self.bot  # AttributeError: 'Cog' object has no attribute 'bot'

...
slate swan
#

cause you have typo in the __init__ method

plucky knoll
#

I

warm coral
#

still @slate swan

plucky knoll
#

blame pycharm for that

upbeat ice
slate swan
plucky knoll
slate swan
#

try using pip3

warm coral
#

i installed python

#

the latest version

slate swan
#

what os?

warm coral
#

widown

#

windows

slate swan
#

you installed it from ms store?

warm coral
#

no

slate swan
warm coral
slate swan
#

!dashm

unkempt canyonBOT
#
Install packages with `python -m pip`

When trying to install a package via pip, it's recommended to invoke pip as a module: python -m pip install your_package.

Why would we use python -m pip instead of pip?
Invoking pip as a module ensures you know which pip you're using. This is helpful if you have multiple Python versions. You always know which Python version you're installing packages to.

Note
The exact python command you invoke can vary. It may be python3 or py, ensure it's correct for your system.

slate swan
#

try this

upbeat ice
#

was pip selected when you installed python?

warm coral
slate swan
upbeat ice
#

I thought pip was automatically selected

warm coral
upbeat ice
#

but I cant remember

slate swan
warm coral
#

yeah :<

#

i dont want to use the online compiler :<

slate swan
#

so how did you get to repl mode without python

jade flare
# warm coral

i had smth like this too, i installed it from the ms store and then it worked

slate swan
#

dont install from ms store trust me

#

more problems

warm coral
slate swan
jade flare
warm coral
#

i didnt run anything joe_3d

#

i just ran the commands u told me

#

to exit repl mode

slate swan
#

but before i told you

#

yeah i know i told you how to quit it im asking how did you enter it

#

scroll up a bit and see

warm coral
warm coral
#

i dont remember entering repl mode

slate swan
#

if i knew how you enter it i would knew how toinstall package

warm coral
#

with any commands in the terminal

#

maybe uninstall python and download it again?

#

and check the pip*

slate swan
#

anyways if you dont know how you got into repl try reinstalling python and make sure you check pip and Add python to PATH or something like that

warm coral
#

pip checked

slate swan
#

πŸ‘

warm coral
#

do i need to runt quit()?

#

run*

slate swan
#

what you see?

warm coral
slate swan
#

select python interpreter

#

and search for version you installed

upbeat ice
#

maybe buy a windows license too πŸ˜›

warm coral
#

done

warm coral
#

pip install discord right?

#

discord package is ,, pip install discord

grim robin
#

I have different listeners for my bot and all seem to work fine. I did try to add an on_ready one and it doesn't trigger. This is my simple testing code:

@client.listen("on_ready")
async def test_fn():
    print("test")

Am I doing something wrong?

warm coral
#

@bot.event
async def on_ready():
print ("Booting up your system")

try it

grim robin
#

this is my full code

upbeat ice
#

I don't see your on_ready method

grim robin
#

it's a listener

buoyant quail
grim robin
#

not an event

#

I don't get any output...
I do have a normal on_ready event

#

and that one prints fine

buoyant quail
#

Check that file is saved
That function is executed (it is reachable)
That client is an actual thing you are using

#

idk what else

hollow bolt
#

try making bots with disnake

grim robin
buoyant quail
#

It works on my machine.
ducky_beer

grim robin
#

while already having a regular on_ready event?

hollow bolt
#

where can I show my code to view ~.db files

warm coral
#

when i run the python3 -m pip install -U discord.py
it makes an eror

warm coral
#

what?

#

im on vs code?

grim robin
#

ok now I'm puzzled

buoyant quail
#

show full code?

hollow bolt
warm coral
upbeat ice
hollow bolt
#

I'm talking about using another library if possible

grim robin
#
@client.listen("on_ready")
async def test_fn():
    print("test")


@client.listen("on_member_join")
async def test_join(user):
    print(2)


@client.listen("on_raw_member_remove")
async def test_leave(payload):
    print(2)
    

@client.listen("on_member_ban")
async def test_ban(server, user):
    print(3)
    

@client.event
async def on_ready():
    print("test ready")
upbeat ice
#

works fine

#

youre not getting any errors?

grim robin
#

i'm not getting any errors

#

I just don't get the "test" printing output

#

all else print fine

upbeat ice
grim robin
#

my main on_ready is in another file and all the rest listeners are elsewhere. loading that file with load_extension()

upbeat ice
#

wait so where are these listeners at?

grim robin
#

the 4 top are in an external file which is loaded with a load_extension()

upbeat ice
#

so they are in a cog?

grim robin
#

no

#

an external file that contains a single app_command

#

the command works, the listeners work

#

except the on_ready one

#

this is my setup for that file:

async def setup(client):
    client.tree.add_command(test_cmd)
#

it's added to the tree and synced fine

#

shows up in the server and returns a result upon call

upbeat ice
#

I think you need to add the listeners in your extension

#

using the add_listener function

grim robin
#

in the setup function?

upbeat ice
#
client.add_listener(test_fn)```
#

you would add this in your extension

#

those listeners then get registered with the client once the extension is loaded

#
async def on_ready(): pass
async def my_message(message): pass

bot.add_listener(on_ready)
bot.add_listener(my_message, 'on_message')```
grim robin
warm coral
#

guys

#

when i run the discord package command pip install discord

it doesnt work

#

@slate swan bro :c

warm coral
warm coral
#

bro @slate swan im sorry if i tire you but im clueless!

slate swan
#

Did you try python -m pip?

warm coral
#

-m pip istall discord?

slate swan
#

!dashm

unkempt canyonBOT
#
Install packages with `python -m pip`

When trying to install a package via pip, it's recommended to invoke pip as a module: python -m pip install your_package.

Why would we use python -m pip instead of pip?
Invoking pip as a module ensures you know which pip you're using. This is helpful if you have multiple Python versions. You always know which Python version you're installing packages to.

Note
The exact python command you invoke can vary. It may be python3 or py, ensure it's correct for your system.

warm coral
shrewd apex
# warm coral

u didn't install python properly ig its not in path

warm coral
#

it is

shrewd apex
#

follow this tutorial it goes through basics and good practices on how to make a bot

shrewd apex
warm coral
#

idk

#

i uninstalled it and downloaded it again for like 3 times

shrewd apex
#

go to c > users > ur name on pc > app data > local > programs > python and remove whatever installations you have there and follow the tutorial above and do a fresh install

#

where did u download from btw?

warm coral
#

i will just uninstall

shrewd apex
#

aight

warm coral
#

fr

shrewd apex
#

go through the tutorial and lmk if u face any issues

warm coral
#

its ur tutorial

#

i just noticed

shrewd apex
#

yeah and a few other experienced devs contributed

#

most yt tutorials are outdated in comparison to version of libraries

cloud dawn
warm coral
#

@shrewd apex

formal basin
#

hi

warm coral
#

hi

shrewd apex
shrewd apex
warm coral
#

i have done everything

#

in the tutorial

cloud dawn
warm coral
#

now how to add the discord package in vscode @shrewd apex

shrewd apex
#

i have never held a Mac in my laif

slate swan
shrewd apex
#

how do i know ;-;

cloud dawn
slate swan
warm coral
#

@shrewd apex

warm coral
#

bro i did ur tutorial

slate swan
#

Please help

shrewd apex
#

read next page also lmao

#

its not a one page tutorial

slate swan
#

@shrewd apex

warm coral
#

oh i didnt see it

cloud dawn
shrewd apex
slate swan
#

@shrewd apex can u look my problem i scrapping answer from website but some text is overlapping

shrewd apex
#

how did u get the text in that form?

#

ur testing to export as pdf?

#

trying*

slate swan
#

No in html

#

I used beautiful soup

warm coral
#

im a html professional

shrewd apex
#

aight from what i see is the text has some specific characters for equations which is being rendered using css/js u might wanna filter those out

slate swan
#

Yes asher

#

Please help

#

I have to change in template file or scrapping file

#

?

shrewd apex
#

filter out unicode characters or of those sort use regex ig

#

i cant tell much without seeing code

slate swan
#

Ok I send u code in dm

shrewd apex
#

no dms plz

#

keep it here

slate swan
#

Ok

cloud dawn
#

I mean just decode it differently.

#

Websites are annoying like that sometimes require extra decoding.

shrewd apex
shrewd apex
cloud dawn
#

Yep

#

Cloudflare is the biggest biatch by far tough.

shrewd apex
#

somehow i just imagined discord without any css loooli

cloud dawn
#

TS figured out flex boxes, they stopped there.

hasty pike
#

@slate swan you there buddy

slate swan
#

@shrewd apex

cloud dawn
hasty pike
#

My view class is not showing on message
I tried to trace error by

try:
            await ctx.send(embed=embed, view=Buttons(ctx))
          except Exception as e:
            await ctx.send(e)

But didn't catch anything

cloud dawn
#

Pastebin got a stroke

unkempt canyonBOT
#
Indentation

Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.

Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.

Example

def foo():
    bar = 'baz'  # indented one level
    if bar == 'baz':
        print('ham')  # indented two levels
    return bar  # indented one level

The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.

Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines

More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation

hasty pike
#

πŸ™‚

shrewd apex
#

against tos

cloud dawn
#

Makes sense lol

shrewd apex
#

chegg dosent allow scraping

#

also i saw some form of auth token there

slate swan
shrewd apex
#

u might wanna look at it lmao

#

bro leaving aside it's against tos now way i am going through like 1k+ lines of code rn at 2:30am

buoyant quail
#

!indent

unkempt canyonBOT
#
Indentation

Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.

Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.

Example

def foo():
    bar = 'baz'  # indented one level
    if bar == 'baz':
        print('ham')  # indented two levels
    return bar  # indented one level

The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.

Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines

More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation

hasty pike
buoyant quail
#

Panda guessed your issue
Without the code lol

buoyant quail
#

You have all buttons in the __init__

cloud dawn
#

Lmao Asher it's against tos ||easy questions only||

buoyant quail
#

They should be just in class

shrewd apex
#

btw ur interactions check never returns true if it intended?

buoyant quail
#

Sure

cloud dawn
slate swan
#

return re.sub(r'src=\s*?"//(.*)?"', r'src="https://\1"', html_text)

buoyant quail
hasty pike
shrewd apex
cloud dawn
#

tbf I can't blame anyone making a music bot rn ads inside the activities.. lamee..

buoyant quail
slate swan
#

up

buoyant quail
#

But you aren't using it anyways
So idk

warm coral
#

@shrewd apex

shrewd apex
#

never used it

warm coral
#

the .env doesnt work

shrewd apex
#

yes bro tell

cloud dawn
shrewd apex
#

oh gg

hasty pike
buoyant quail
#

No

shrewd apex
buoyant quail
warm coral
#

pip install python-dotenv

#

it doesnt work

#

the command

hasty pike
buoyant quail
slate swan
#

try pip3

shrewd apex
#

also u made sure .env is in same folder as u code folder

#

!pypi python-dotenv

unkempt canyonBOT
shrewd apex
slate swan
#

!pypi regex

unkempt canyonBOT
shrewd apex
#

and ur os

hasty pike
warm coral
#

do i need to do the Venv folder @shrewd apex

buoyant quail
hasty pike
shrewd apex
#

what?

hasty pike
#

Wait what

slate swan
#

return re.sub(r'src=\s*?"//(.*)?"', r'src="https://\1"', html_text)
@foggy pine bro see

shrewd apex
#

totally not me

buoyant quail
# hasty pike Wait what

You need to make your buttons just class methods. Now you are creating them inside __init__ function and just throwing away

slate swan
hasty pike
#

Oh right

warm coral
#

@shrewd apex

hasty pike
#

Buttons are inside inside init

slate swan
hasty pike
#

My bad

shrewd apex
#

did the library install?

warm coral
#

@shrewd apex

warm coral
slate swan
#

@buoyant quail return re.sub(r'src=\s*?"//(.*)?"', r'src="https://\1"', html_text)

shrewd apex
#

are u running that in repl

shrewd apex
#

bro

#

run it in cmd

#

not python

warm coral
#

not in terminal?

slate swan
shrewd apex
#

all commands in tutorial need to be run in cmd

buoyant quail
#

And what you want to do

cloud dawn
#

poetry run python -m pip install python-dotenv ||joke||

shrewd apex
#

i have no idea what i am doing

#

i think I'll go sleep

shrewd apex
#

dockerize*

warm coral
#

ok done

slate swan
buoyant quail
#

Is /n a space? pithink

cloud dawn
warm coral
#

@shrewd apex the library downloaded in the terminal normally

cloud dawn
slate swan
#

Lol

buoyant quail
slate swan
#

\x

buoyant quail
#

And not a space

warm coral
shrewd apex
slate swan
buoyant quail
shrewd apex
slate swan
buoyant quail
#

!e

something = r"abc\x asdasdas\x\x hello"
print(something)
print(something.replace(r"\x", ""))
unkempt canyonBOT
#

@buoyant quail :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | abc\x asdasdas\x\x hello
002 | abc asdasdas hello
shrewd apex
#

btw hopefully u ran the venv activate command before installing

slate swan
warm coral
#

@shrewd apex not working for me

shrewd apex
#

dont wanna court the global env

cloud dawn
shrewd apex
#

clutter

slate swan
shrewd apex
slate swan
shrewd apex
#

fyi i did put in a snippet about poetry in the pikachu_sip

warm coral
buoyant quail
shrewd apex
cloud dawn
shrewd apex
#

noice

cloud dawn
warm coral
shrewd apex
#

what error do u get

slate swan
#

I change these code from php to python

warm coral
#

the same as .env one

slate swan
#

But not know python well

shrewd apex
#

ok what error u got in .env one

#

bro speaking like i am sitting next to him

warm coral
buoyant quail
hasty pike
#

How do i update button emoji?

warm coral
#

i posted it before @shrewd apex

hasty pike
#

On interaction

slate swan
shrewd apex
#

run those commands in cmd

cloud dawn
shrewd apex
#

not repl

#

repl is for python

#

run the commands in cmd

cloud dawn
#

People helping rn are killing me 🀣

buoyant quail
shrewd apex
#

terminal power shell or whatever

warm coral
#

@shrewd apex

slate swan
#

Use vscode

warm coral
buoyant quail
#

use pycharm

slate swan
#

😬

warm coral
cloud dawn
#

How does Pyhton know where your main is lol

slate swan
#

@shrewd apex bro look my problem u looking intelligent

shrewd apex
#

where is ur python file

warm coral
#

in a file

cloud dawn
#

on my pc

shrewd apex
#

open the terminal or move to that folder in the terminal