#discord-bots

1 messages · Page 756 of 1

proven granite
#

Can someone fork the discord.py project on github and try and add slash commands if possible

brittle flume
#

What should I start with?
Discord.py
Nextcord
Py-cord
Hikari

slate swan
#

disnake is a fork its just dpy but better

proven granite
slate swan
#

ok?

#

and?

brittle flume
#

That's why

brittle flume
slate swan
#

yw

#

!pypi disnake

unkempt canyonBOT
fluid spindle
#

Disnake isn't very different tbh

slate swan
#

its a fork of dpy ofc it wont

#

only different things are the new features

#

which arent hard to learn

brittle flume
fluid spindle
#

exactly, so they won't need to start over.

slate swan
#

its recommended

maiden fable
brittle flume
maiden fable
#

Yea

#

All the namespaces are named discord

#

So instead of disnake imports, u can do discord imports

slate swan
#
import disnake as discord
#

Someone has Fivem status bot with player list that do not has crashes?

#

bad practice tho

final iron
#

Its really not that big of a deal refactoring your code from discord to disnake

slate swan
#

just change the word discord to disnake

keen talon
weary mirage
#

can someone help me with coloring text the bot sends in discord? I just can't get it to work.

brittle flume
#

What else should I remove for disnake

slim ibex
#

prolly discord

slate swan
weary mirage
#

Sure

slate swan
#

what is the problem?

weary mirage
#

I can't get it to work

#

I have this

#

and I get this

slate swan
#

that's not ANSI, that's just syntax highlighting

#

regardless, the issue is that you're not starting a new line after diff

brittle flume
#

Add \n after diff proly

slate swan
weary mirage
#

can you send an example of a bit of python code that colors the message my bot sends?

slate swan
#

you just need to add \n after diff

#

and it'll work

slim ibex
#

If you want it to be colored with Python highlighting, you can create some sort of pagination and clean code function

brittle flume
#

await ctx.send("diff\n + I'm green\n - I'm red")

weary mirage
#

did not work

#

is what I tried it with

brittle flume
azure tendon
weary mirage
weary mirage
brittle flume
#

Yea wait lemme try

final iron
#

Oh nice

weary mirage
#

is it because I didn't give the bot a specific permission or something when I added it??

keen talon
#

!venv

unkempt canyonBOT
#

Virtual Environments

Virtual environments are isolated Python environments, which make it easier to keep your system clean and manage dependencies. By default, when activated, only libraries and scripts installed in the virtual environment are accessible, preventing cross-project dependency conflicts, and allowing easy isolation of requirements.

To create a new virtual environment, you can use the standard library venv module: python3 -m venv .venv (replace python3 with python or py on Windows)

Then, to activate the new virtual environment:

Windows (PowerShell): .venv\Scripts\Activate.ps1
or (Command Prompt): .venv\Scripts\activate.bat
MacOS / Linux (Bash): source .venv/bin/activate

Packages can then be installed to the virtual environment using pip, as normal.

For more information, take a read of the documentation. If you run code through your editor, check its documentation on how to make it use your virtual environment. For example, see the VSCode or PyCharm docs.

Tools such as poetry and pipenv can manage the creation of virtual environments as well as project dependencies, making packaging and installing your project easier.

Note: When using Windows PowerShell, you may need to change the execution policy first. This is only required once:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

brittle flume
#

Yea I did it

weary mirage
#

please 😭

keen talon
weary mirage
#

so whats the issue o.o;

slate swan
#

i'm not sure myself.. you could try a multiline string

slate swan
#

poggggpithink

#

Back at purchasing a software I go christmaspop

slate swan
#

yo can someone help

#

@bot.event
async def on_member_update(before: discord.Member, after: discord.Member):
  guild = after.guild

  role = guild.get_role('932629790878482522')
  activity_string = after.member.activity.name
  string_to_check = ". gg / void"
  if string_to_check in activity_string:
    await before.add_roles(role)
#

.

#

is this throwing an error?

#

no

#

it just doesn’t works

#

do you have privileged intents?

#

i enabled everything

#

no i didn’t add intents

#

lemme try that

brittle flume
#

What is wrong with this?

import disnake
import mytoken
from disnake.ext import commands

bot = commands.Bot(command_prefix=".")
token = mytoken.TOKEN

bot.event
async def on_ready():
  await print("Bot is ready")

bot.command()
async def color(ctx):
  await ctx.send("just a test")
  
bot.run(token)
slate swan
#

lol

#

u don’t have to await print

brittle flume
#

K

slate swan
#

you're missing the decorators @

slim ibex
slate swan
#

i did

#

it says right there how to fix

#

open the developer panel and enable the privileged intents

#

i did enable it

#

are you sure it was the correct application?

#

yh

brittle flume
#

O lol

slate swan
#

oh no

#

mb

#

try the event again now

slim ibex
#

Lmfao

slate swan
#

kk

#

@bot.event
async def on_member_update(before: discord.Member, after: discord.Member):
  guild = after.guild

  role = guild.get_role('932629790878482522')
  activity_string = after.before.activity.name
  string_to_check = ". gg / void"
  if string_to_check in activity_string:
    await before.add_roles(role)
#

no errors but it doesn’t work

final iron
#

Do you have member intents?

slate swan
#

yh

#

idk what is wrong

final iron
#

Do you have them enabled in code and the developer portal?

slate swan
#

yh

final iron
#

And did you pass them in to your bot constructor

slate swan
#

yh

#

intents = discord.Intents.all()
bot = commands.Bot(command_prefix=prefix, intents=intents)
final iron
#

Also

slate swan
#

How do I add slash commands to my bot

final iron
#

Don't use camelCase

final iron
weary mirage
#

could anybody provide an example for code to a colored message being sent by a bot?

weary mirage
#

yea like ```md
#helo

weary mirage
#

couldn't figure it out

#

People tried helping me, but it just... didn't work

final iron
#

Discord is now slowly rolling out the ability to send colored messages within code blocks

#

Not sure but that might mean only certain users can use it?

#

Or I'm just an idiot

weary mirage
#

I dunno

#

it seems to work for other people, I got a friend who says that their friend has got it working

weary mirage
#

D;

pliant gulch
#

It's just getting more POWERFUL since discord is rolling out support to ANSI highlighting

#

Which is basically just colours

weary mirage
#

so whats my issue o.o

final iron
#

So thats the difference

#

I know code blocks had been around awhile

brittle flume
#

@weary mirage
Try this

@bot.command()
async def color(ctx):
  await ctx.send("^^^py\nlol = op\nimport\n#discord\n^^^")
#Instead of ^ use `
weary mirage
#

I put this

#

wait you changed it lemme try

brittle flume
weary mirage
#

this is what I got

brittle flume
#

Replace ^ with `

#

Is it working?

#

@weary mirage ?

weary mirage
#

okay

#

it did

#

is what I got o.o

brittle flume
#

You got both

#

?

weary mirage
#

mkay it worked

#

was a bug, but its working now

brittle flume
#

K

weary mirage
#

okay so, how would I change the color of it now

brittle flume
#

@bot.command()
async def colortest(ctx):
await ctx.send("diff\n+ I'm green\n- I'm red\n")

#

And yea add `

weary mirage
#

for the bot I'm making, I'm trying to have it so one of the bits is blue

#

just like a number that's colored

brittle flume
#
+I'm green
-I'm red
#

The problem is with diff I guess

weary mirage
#

is there a way to have the text colored blue?

brittle flume
#

Idk

pliant gulch
#
[blue text]
weary mirage
#

with a python bot :P

brittle flume
weary mirage
#

can I have a bit of text that's blue within a big string of text?

final iron
green bluff
#
@client.command()
async def userinfo(ctx, member: disnake.Member):
    if member.mention == 'SkilledYoshi#777':
        return
    else:
        embed = disnake.Embed(
            title="USER INFO",
            description=f"Here is the info we retrieved about {member}",
            colour=0xD7DCF6)
        embed.set_thumbnail(url=member.avatar.url)
        embed.add_field(name="NAME", value=member.name, inline=True)
        embed.add_field(name="NICKNAME", value=member.nick, inline=True)
        embed.add_field(name="ID", value=member.id, inline=True)
        embed.add_field(name="TOP ROLE", value=member.top_role.name, inline=True)

        await ctx.send(embed=embed)```
#

it doesnt return

#

when i mention the member

#

it just sends the embed

final iron
#

!d discord.Message

unkempt canyonBOT
#

class discord.Message```
Represents a message from Discord.

x == y Checks if two messages are equal.

x != y Checks if two messages are not equal.

hash(x) Returns the message’s hash.
final iron
#

Can you check if a member was mentioned like that?

green bluff
#

for me?

final iron
#

Yes

#

!d discord.Message.mentions

unkempt canyonBOT
#

A list of Member that were mentioned. If the message is in a private message then the list will be of User instead. For messages that are not of type MessageType.default, this array can be used to aid in system messages. For more information, see system_content.

Warning

The order of the mentions list is not in any particular order so you should not rely on it. This is a Discord limitation, not one with the library.

final iron
#

Try with this

green bluff
#

an example

#

where would i put this

final iron
#

So this returns a list of users mentioned

#

Wait

green bluff
#

I dont want a list of users mentioned

final iron
#

Why not just check if the member's id is the same as the id you want?

green bluff
#

i want a special embed for a specific person

vale wing
#

Compare member.id with the id not the mention

final iron
green bluff
#

do is just do

#

client.get.userid

#

and

#

if user is true

#

user = client.getuserid(e22168618723)

final iron
#

No?

vale wing
green bluff
#

im crazy dw

final iron
#

You would use the id attribute of a member object

unkempt canyonBOT
#

property id```
Equivalent to [`User.id`](https://docs.disnake.dev/en/latest/api.html#disnake.User.id "disnake.User.id")
final iron
#

Then compare it to the id you want

vale wing
#
if member.id == 735757517765869589```
green bluff
#

cool no quoations on the numbers?

final iron
#

Nope

#

You want it to be an integer

vale wing
#

It's int

final iron
#

Not a string

green bluff
#

yeh i see

#

cool

#

it works

pliant gulch
green bluff
#

ah yup thanks

tawdry wind
#

Guys, I just watched a tutorial and it said to do client = discord.Client() at the start but its not working it says "discord" is not definedPylance.
Any idea? I have never made a dc bot before so i can't say

tawdry wind
#

Whats that? xd

final iron
#

Its objectively bad

cloud dawn
#

!pypi disnake

unkempt canyonBOT
cloud dawn
#

If he only wants events it's actually all he/she needs.

final iron
# cloud dawn How so?

If you're using an if message.content... system you're missing out on a lot of resources

cloud dawn
tawdry wind
#

Yeah

final iron
tawdry wind
final iron
#

They're most likely unaware of actual commands

cloud dawn
#

Suggested lib is from left to right.

tawdry wind
#

I really don't know as I am a complete beginner trying to do a basic thing since its my first time

final iron
#

Then take the most recommended one

#

disnake

#

So do global checks not apply to slash commands?

tawdry wind
final iron
cloud dawn
unkempt canyonBOT
#

slash_command_check(func)```
Similar to [`check()`](https://docs.disnake.dev/en/latest/ext/commands/api.html#disnake.ext.commands.Bot.check "disnake.ext.commands.Bot.check") but for slash commands.
tawdry wind
final iron
slate swan
cloud dawn
green bluff
slate swan
cloud dawn
cloud dawn
#

Better to use the id.

tawdry wind
slate swan
next wing
#

can someone help me out in #help-kiwi the person helping couldn't figure it out so i was hoping someone in here could help.

final iron
#

They're using discord.py but you're using disnake therefore where ever they use discord you should use disnake

sacred sigil
#

event works and all, but I always get this error and I want to handle it

discord.utils.get(message.guild.channels, id=928014494142197820)
AttributeError: 'NoneType' object has no attribute 'channels'
cloud dawn
sacred sigil
#

one sec

tawdry wind
tawdry wind
#

Ok thanks

cloud dawn
slate swan
cloud dawn
#

👀

slate swan
#

👀

green bluff
#

👀

slate swan
#

listen is better but i like using event on ready for a reason

slate swan
cloud dawn
#

python

slate swan
#

no

native wedge
#

this is my bot ```py
from discord.ext import commands
import os
import discord

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

bot = commands.Bot(command_prefix=".")

bot.load_extension("funcommands")
bot.load_extension("moderation")
bot.load_extension("errorhandler")
bot.load_extension("usefulcommands")

@bot.event
async def on_ready():
print("All resources loaded and bot is now running!")

bot.run(os.getenv("TOKEN"))```

slate swan
#

for loop for cogs smh

native wedge
slate swan
#

use a for loop to load all cogs

cloud dawn
slate swan
#

that to

native wedge
#

i have others .py and they work

slate swan
slate swan
#

yes

cloud dawn
#

Very bad practice

slate swan
#

no

#

its handy

cloud dawn
#
import importlib
import inspect
import pkgutil

from typing import Iterator, NoReturn

import exts


def unqualify(name: str) -> str:
    """Return an unqualified name given a qualified module/package `name`."""
    return name.rsplit(".", maxsplit=1)[-1]


def walk_extensions() -> Iterator[str]:
    """Yield extension names from the bot.exts subpackage."""

    def on_error(name: str) -> NoReturn:
        raise ImportError(name=name)  # pragma: no cover

    for module in pkgutil.walk_packages(exts.__path__, f"{exts.__name__}.", onerror=on_error):
        if unqualify(module.name).startswith("_"):
            # Ignore module/package names starting with an underscore.
            continue

        if module.ispkg:
            imported = importlib.import_module(module.name)
            if not inspect.isfunction(getattr(imported, "setup", None)):
                # If it lacks a setup function, it's not an extension.
                continue

        yield module.name


EXTENSIONS = frozenset(walk_extensions())
#
    def load_extensions(self) -> None:
        """Load all enabled extensions."""
        logger.info(f"Loading extensions")

        # Must be done here to avoid a circular import.
        from utils.extensions import EXTENSIONS

        self.bot_extensions = set(EXTENSIONS)  # Create a mutable copy.

        for extension in self.bot_extensions:
            logger.debug(f"Loading extension {extension}")
            self.load_extension(extension)
#

better

slate swan
vast gale
slate swan
cloud dawn
#

Oh yeah alec's new site :3

slim ibex
tawdry wind
#

How can I tell when someone mentions me? @tawdry wind

final iron
slate swan
#

looks good ngl

vast gale
cloud dawn
#

okimii's for loop had flaws

slim ibex
#

lmao

vast gale
slate swan
cloud dawn
chrome nymph
#

hii

vast gale
#

I then de-improved it when adding it to another bot

slate swan
cloud dawn
final iron
#

The website doesn't look finished

cloud dawn
#

It will also import non cogs

vast gale
final iron
vast gale
#

the beta tag is extremely important

final iron
#

I could probably learn a good bit from it

#

It has a lot

slate swan
cloud dawn
#

Just make another for loop?

slate swan
cloud dawn
#

🤦‍♂️

slate swan
#
for filename in os.listdir("C:/Users/okimii/Downloads/mainfolder/subfolder"):
#

is what you mean?

cloud dawn
#

no nested cogs

slim ibex
#

like this

#
for filename in listdir("./src/cogs"):
slate swan
slate swan
cloud dawn
slim ibex
#

you dont need the C:/blahashhsa

slate swan
#

i have to cuz my os cant find anything then

slate swan
#

lol

cloud dawn
slate swan
slim ibex
#

some people have file structures like this in terms of cogs

src
|-> cogs
    |-> moderation
        |-> cog.py
    |-> help
        |-> cog.py
#

cringe but ye

slim ibex
#

ik its bad

#

ahh

sacred sigil
#

What I want to do:

check if a user has my vanity in their status
role them a special role if they do
if they remove it, it removes their role
if they changed their status and it was not my vanity, ignore

questions:
what event do I use? I used both on_member_update(before, after) and on_presence_update(before, after), none of them worked

slate swan
cloud dawn
#

Just hire more discord mods

#

!d disnake.Member.status

unkempt canyonBOT
#

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

here's what I wrote

#
@bot.event
async def on_member_update(before, after):
    guild = bot.get_guild(914533133179813919)
    role = discord.utils.get(guild.roles, id=931191386076749896)
    if before.activity != after.activity:
        if after.activity in ["v1", "v2", "v3"]:
            vanity_embed = Embed(description=f"{after.mention} thx 4 repping **vanity** ![packed](https://cdn.discordapp.com/emojis/930197134073036910.webp?size=128 "packed")", color=0x0f0f0f)
            channel = bot.get_channel(931191146099658822)
            await after.add_roles(role, reason="Repping Vanity")
            await channel.send(embed=vanity_embed)
            try:
                await after.send("appreciate it for repping **vanity**. you were given the vanity role")
            except discord.Forbidden:
                pass
        else:
            if role in after.roles:
                await after.remove_roles(role, reason="removed vanity")
daring olive
#

hi amiri lol

sacred sigil
#

mb

daring olive
#

lolol

sacred sigil
#

my vanity was in the code

#

i removed it

cloud dawn
#

Mina could i ask something of you :3

daring olive
#

sure

slate swan
#

REACTIONS😠

cloud dawn
daring olive
#

lol nah

slate swan
daring olive
#

i'd bring it up again in a few days?

cloud dawn
daring olive
#

me neither lol, i don't think there's any formal process for requesting pins, so what you're doing i think is fine

#

i have a ? for you though

#

did you see my earlier ping?

cloud dawn
#

Sure

daring olive
#

it was a ? about tos for the code that was generating a guild invite

#

is it actually tos breaking ?

#

it was several hours ago

cloud dawn
#

Let me check the code that we are talking about one sec

cloud dawn
daring olive
#

grab any what ID?

hoary cargo
#

"grab that guild", no, you can't do that with a bot

daring olive
#

why wouldn't you be able to?

hoary cargo
#

i mean, if we refer to the guild id yes, but if we talk about grabbing the guild like new owner, no lmao

daring olive
#

can we speak on more higher level terms

slate swan
#

yes ofc you can get a guild obj

daring olive
#

bc idk anything about dpy

#

what is the code attempting to do and why may it not be respecting privacy?

slate swan
cloud dawn
# daring olive why wouldn't you be able to?

Let me rephrase, he told me he can get any guild.id he wants to in what guild his bot is in.
I told him he can't but he can, i just didn't fell comfortable helping him since he can just create invites for other servers without them knowing it.

slate swan
#

yeah

daring olive
#

and where was the invite being sent?

slate swan
daring olive
#

mk

slate swan
#

or to a private channel in a different guild

cloud dawn
slate swan
#

hes just making unauthorized invites for himself

daring olive
#

hard to say it is 100% unauthorized

hoary cargo
#

well, i wouldn;t day unauthorized, since you invite a bot with certain perms you assume

cloud dawn
slate swan
#

making a invite without people knowing isnt quite correct what if they get raided because of him?

#

leaking an invite

pliant gulch
slate swan
daring olive
#

they might not know about it, sure. but that is on them

hoary cargo
#

that's pretty stupid doe, getting fired up over bullshit, in most of the servers anyone can create invites and no one need to get the approval of owners or shit

cloud dawn
daring olive
#

so how do bot owners dictate their terms for using their bot?

slate swan
daring olive
cloud dawn
daring olive
#

or it's written externally somewhere?

slate swan
#

so if you accept it will give that bot all those perms

daring olive
#

so discord bot owners never add their own conditions or stipulations?

#

i mean, i'm sure they do

hoary cargo
# slate swan yeah but he said its a private server

well, depends what we understand by private, because according to discord, any server that is not in discovery is private, or private by the fact that no one is able to create invites and just certain people join in

daring olive
#

but i guess they'll write them elsewhere

slate swan
hoary cargo
#

kinda ethically wrong tbh

cloud dawn
#

There is a lot to it.

slate swan
#

^

pliant gulch
pliant gulch
slate swan
#

hehe /shrug

hoary cargo
cloud dawn
pliant gulch
slate swan
#

that is true as discord said if you break a platforms tos you are breaking theres

daring olive
hoary cargo
#

why wouldn't he

daring olive
#

"... and relay them to myself"

slate swan
#

i mean most bot devs do have their own tos for their bot

pliant gulch
#

The invites stuff would also fall under this scope of the ToS, so yea....

daring olive
#

that's about PII. idk if relevant here ^

cloud dawn
pliant gulch
daring olive
#

mm

hoary cargo
#

well, invites are not personal information

cloud dawn
#

There is a wholeee other section on griefing as well..

pliant gulch
daring olive
#

it still specifically says "user information"

hoary cargo
#

invites are not user info peeposhrug

pliant gulch
hoary cargo
#

how are they

pliant gulch
#

Invites directly correlates to that

cloud dawn
#

I think guilds can be personal.

pliant gulch
#

👁️ 👁️

cloud dawn
#

"37 dicks" my favorite

#

Ah s3rl now it makes sense

hoary cargo
cloud dawn
#

@daring olive I hoped that answered your question :3
I also recommend coding a Discord bot, it can be a small one :)

cloud dawn
daring olive
cloud dawn
pliant gulch
#

Again, going back to the, EXPLICIT definition of invite making

cloud dawn
#

"surprises" lmao

pliant gulch
#

If I was an owner of a guild and my guild was suddenly opened to the bot's owner because of this

cloud dawn
#

Roulette command:

pliant gulch
#

I'd be surprise!

cloud dawn
#

😂

pliant gulch
#

Also maybe a privacy policy?

cloud dawn
#

If you look hard enough even /ping violates ToS Andy

native wedge
#

how would i do command aliases?

pliant gulch
cloud dawn
#

inside the command decorator
@bot.command(aliases=['alias_here'])

cloud dawn
pliant gulch
#

Laws can be interpreted in many ways, along with terms

cloud dawn
#

Yep...

next wing
#

can someone try help me in #help-cherries i have some kind of db issue with my bot but no one has been able to fix it

native wedge
#
  @commands.command(name="ban", aliases=["yeet"])```
#

like that?

vast gale
next wing
#

anyone know how to use replit db that can help?

magic ore
#

it's not good to use in a bot

slim ibex
#

Replit in general is bad

magic ore
#

yeah, hosting services aren't that expensive

pliant gulch
#

Replit's "db" is just a persistent dict right?

slim ibex
#

pretty sure idk

magic ore
#

it makes requests

slim ibex
#

yep it is

pliant gulch
#

Requests 👁️ 👁️

slim ibex
#

Replit Database is a simple, user-friendly key-value store inside of every repl. No configuration is required; you can get started right away!

pliant gulch
#

For some reason to me that feels somewhat insecure

final iron
#

Tbh I don't like key-value databases

#

I find ones like sqlite a lot simpler

pliant gulch
#

I find relational databases much more powerful due to the SQL langauge

#

Key-value databases are amazing in their own terms, but not as power as relational databases

jade tartan
#
Traceback (most recent call last):
  File "C:\Users\thoma\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "c:\Users\thoma\Desktop\discord.py\python\main.py", line 84, in on_raw_reaction_add
    with open('reactrole.json') as react_file:
FileNotFoundError: [Errno 2] No such file or directory: 'reactrole.json'
rotund creek
#

So im testing with webhooks can someone help

#

For upvotes^

jade tartan
#
async def on_raw_reaction_add(payload):
    if payload.member.bot:
        pass
    else:
        with open('C:\Users\thoma\Desktop\discord.py\python\reactrole.json') as react_file:
            data = json.load(react_file)
            for key, value in data.items():
                        emoji = payload.emoji
                        role = discord.utils.get(client.get_guild(payload.guild_id).roles, id=829665222380879912)
                        await payload.member.add_roles(role)```
#
    with open("C:\Users\thoma\Desktop\discord.py\python\reactrole.json") as react_file:
                                                                       ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape```
solid falcon
#

change your back slashes to forward slashes

jade tartan
#

ok that worked

solid falcon
#

This is my code ```py
@slash_command(name="writecode", description="Writes a code snippet using a prompt", options=[SlashOption(str, name="selection", description="First argument", choices=[
create_choice("First Choice","first"), create_choice("Second Choice", "second")
], required=True), SlashOption(str, name="written", description="Second argument", required=True)
])
async def mySlashCommand(ctx, selection, written):
print(f"Selection: {selection}")
print(f"Written argument: {written}")

And it results in this error
```TypeError: myCogs.mySlashCommand() got multiple values for argument 'selection'```
I'm using the discord_ui module. Does anyone know what the problem might be?
sweet pilot
#

is there any way i could get an argument without order

#

for example i wanna get a value for width without providing height

#

is there a way to do smthing like .cmd widht=200

#

and when i wanna provide height .cmd height=200

#

is there a way to accomplish this?

left crater
#
    for file in os.listdir():
        if file.endswith('.png') or file.endswith('.mp4') or file.endswith('.jpg') or file.endswith('.jpeg'):
            files.append(file)
            random_ = random.randrange(len(files))
            await ctx.send(files[random_])``` anyone know whats wrong with this
solid falcon
#

Is it giving an error?

left crater
#

no

#

nothings happening

solid falcon
#

What are you expecting to happen?

left crater
#

i want it to append all the image links and then when someone says .image it will post it at random

solid falcon
#

then ctx.send(random.choice(files)) is probably what you want

left crater
#

ah alright ill try it

slate swan
#

radrange gives a range of ints

cloud dawn
cloud dawn
reef trail
#

panda give me something that i should make

#

i need ideas cat_sob

sweet pilot
cloud dawn
reef trail
#

you're in my bots repo

cloud dawn
cloud dawn
sweet pilot
cloud dawn
#

ah

slate swan
#

panda having a stroke

#

thats nothing compared to what he does with regex

#

its scary what he can do with regex

pliant gulch
reef trail
cloud dawn
sweet pilot
slate swan
pliant gulch
#

!e import os; print(os.listdir())

unkempt canyonBOT
#

@pliant gulch :white_check_mark: Your eval job has completed with return code 0.

['Pipfile.lock', 'Pipfile', 'config', 'snekbox', 'user_base', 'tests', 'LICENSE']
sweet pilot
pliant gulch
#

Ok tested on my own it does kek

cloud dawn
cloud dawn
slate swan
#

list comprehensions are easy to read

reef trail
cloud dawn
reef trail
#

all my files are over 500 lines cat_sob

pliant gulch
#

Seesh that is a huge gap

slate swan
cloud dawn
# pliant gulch

I know filter is faster i also did this test couple months back.

pliant gulch
slate swan
cloud dawn
#

Yeah if you for example have a double or triple for loop in it, it can get pretty messy

pliant gulch
#

I had that issue with my wrapper's dispatch function yesterday

slate swan
cloud dawn
#
lst = [(j, k) for j in s1 for k in s2]
slate swan
pliant gulch
slate swan
pliant gulch
#

I later realised how dumb this is!

#

And I just deleted it from my dispatcher

cloud dawn
#
lst = [
       j + k
       for j in s1 
         for k in s2
       ]
slate swan
#
[a for b in a[c for c in d]]
#

i think was the way

cloud dawn
#
[a for b in a for b in a for b in a for b in a for b in a]
#

dunno if that even works lol

reef trail
#

@cloud dawn26 files, 10k lines

pliant gulch
#

With whatever A is

#

from a quick glance

cloud dawn
#

!e ```py
a = list(range(10))

print([a for b in a for b in a for b in a for b in a for b in a])

unkempt canyonBOT
#

@cloud dawn :x: Your eval job has completed with return code 143 (SIGTERM).

[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 
... (truncated - too long)

Full output: too long to upload

pliant gulch
#

called it

sweet pilot
lofty heron
#

hi does anybody know how i can make my bot only send a message when only something changes

left crater
#

human error

#

not everyone is a robot

cloud dawn
#

Would still crash since you would need to make it a file object.

#

And pass it as file

pliant gulch
unkempt canyonBOT
#

class discord.ext.commands.FlagConverter```
A converter that allows for a user-friendly flag syntax.

The flags are defined using [**PEP 526**](https://www.python.org/dev/peps/pep-0526) type annotations similar to the [`dataclasses`](https://docs.python.org/3/library/dataclasses.html#module-dataclasses "(in Python v3.9)") Python module. For more information on how this converter works, check the appropriate [documentation](https://discordpy.readthedocs.io/en/master/ext/commands/commands.html#ext-commands-flag-converter).

iter(x) Returns an iterator of `(flag_name, flag_value)` pairs. This allows it to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown.

New in version 2.0.
lofty heron
slate swan
lofty heron
#

im making a bot to track whenever somebody logs off hypixel on minecraft

slate swan
sweet pilot
#

multiple or too much layers of abstraction sacrifices comprehension

slate swan
#

¯_(ツ)_/¯

sweet pilot
#

so when u do files = reader knows that this variable contains a bunch of filenames

slate swan
#

ik

sweet pilot
#

aannd ur future will hate you less 😂

cloud dawn
#

@pliant gulch I'm starting to like java now

pliant gulch
#

Readable true, but also less preform-ant because you need to init a new variable that you never use again

slate swan
pliant gulch
slate swan
#

ruby is where its at

slim ibex
#

c# > java

pliant gulch
#

C++ > C#

cloud dawn
slate swan
pliant gulch
#

True

slim ibex
#

binary > c

pliant gulch
#

but knowing me I'll forget to free heap memory

sweet pilot
#

so no prob

pliant gulch
#

It's not like the garbage collector runs without any computing power

slim ibex
#

overrated lang

#

but kotlin is kinda replacing it

pliant gulch
#

Good

slim ibex
#

mhmm

#

i like kotlin better

slate swan
#

python is just this

class Python < Ruby
    def initialize
        puts "new language"
    end
pliant gulch
#

Kinda wanna finish my compiled programming langauge but I am now committed to working on my wrapper

#

😔

sweet pilot
#

if u don't like having unused variables good luck bro 😂

cloud dawn
slate swan
pliant gulch
sweet pilot
sweet pilot
#

that's how it matters

#

u need thousands of memory heavy classes to not make variables

pliant gulch
#

And your saying rather than optimising one thing it would be better to have more things like that before even thinking about optimising

#

You don't need to write sloppy code everywhere 😂

sweet pilot
#

first of all, u've seen big code bases?

pliant gulch
#

Yes

sweet pilot
#

they have a reason to use is_connected = True; if is_connected code like this ryt?

#

is_connected better defines wht we r doing

#

variables have the naming power that absoulute values never had

pliant gulch
#

Otherwise there would be quite literally no point

sweet pilot
pliant gulch
#

Your failing to realise that big code bases most often have groups of people working together via other forms of communication

cloud dawn
#

Telepathy

pliant gulch
#

Big code bases also often tend to have their own coding styles, rules etc

pliant gulch
#

Contributors already know whats going at what part of code they are looking at

#

If they don't ask the person who coded it, or someone who does know

#

that's the glory of communication

sweet pilot
pliant gulch
#

I don't need to make a pointless variable to tell everyone that this is a bool that represents a connection is there

cloud dawn
#

Agreed

#

They can also do bool() if it is really necessary

pliant gulch
#

A coding rule that you have to do badly optimised code!

sweet pilot
#

and it solely depends on opinions

pliant gulch
#

If you space out your code, write comments, docstrings, annotations

#

It will literally be readable as ever

sweet pilot
#

if someone can understand what it means and it's thier codebase he can do whatever he wants

pliant gulch
#

I don't think big tech can afford to make badly optimised code

#

🤔

#

Not scalable and will cost them hundreds

#

Especially at the point where most of the worlds water is used for water-cooling at datacenters

sweet pilot
#

k whtever u don't have to make variables if u dont want to 😂

pliant gulch
#

Never said I don't want to not make variables, I said what's the point of one time variables

#

Lmao

patent lark
pliant gulch
sweet pilot
severe rampart
#

how does one use params in slash commands?

pliant gulch
#

Daily data centers in the US spend about 1.7billion litres of water

slate swan
pliant gulch
#

News

severe rampart
pliant gulch
#

Articles

slate swan
#

i get trash news

sweet pilot
slate swan
pliant gulch
cloud dawn
severe rampart
#

ty

sweet pilot
green bluff
sweet pilot
#

nvm then

green bluff
#

am i doing anything wrong

#

1st one is mine

cloud dawn
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)
green bluff
#

breh

#

r u saying that its not allowed

patent lark
#

correct

cloud dawn
#

indeed

green bluff
#

BRUHHHHHHHHH

pliant gulch
#

Were you not here when big bots got DMCA'd by google

severe rampart
#

this code look correct?

slate swan
severe rampart
#

?

slate swan
#

member = member or inter.author

sweet pilot
severe rampart
#

but would it work as it is

#

basically

sweet pilot
#

or is it finished

slate swan
cloud dawn
severe rampart
slate swan
#

but ok

hard trail
#

@cloud dawn Could you please help me with this now?

slate swan
#

and you can do

em = disnake.Embed(color=0xD3D3D3, title=f"{member}'s avatar").set_image(url=member.avatar.url)
pliant gulch
final iron
slate swan
severe rampart
#

:3 it worked as it was

slate swan
#

nothing bad with it yes if its to long it wont follow pep 8 but who cares

severe rampart
#

thanks :3

slate swan
#

looks better imo

pliant gulch
#

How does this break pep8

slate swan
pliant gulch
#

Right

#

pep8 line length limit is 79

slate swan
#

correct

pliant gulch
#

This line of code seems to be

cloud dawn
pliant gulch
#

maybe 95 or 90ish long?

slate swan
#

to lazy to count

#

!e print(len("em = disnake.Embed(color=0xD3D3D3, title=f'{member}'s avatar').set_image(url=member.avatar.url)"))

unkempt canyonBOT
#

@slate swan :white_check_mark: Your eval job has completed with return code 0.

95
slate swan
#

yep it doesnt follow pep8

#

🏃

left crater
#
async def randgame(ctx, arg1, arg2):
    randgam = random.randrange(arg1)
    if arg2 == randgam:
        await ctx.send("congradulations")
    if arg2 != randgam:
        await ctx.send("Wrong try again")``` I am trying to create a number game where the user has to guess the number but it is saying Command raised an exception: ValueError: non-integer arg 1 for randrange()
pliant gulch
#

I wanna implement them to my wrapper in a clean way

slate swan
#

by clean wdym

cloud dawn
#

ApplicationCommandInteraction except for this stupid long ass name

pliant gulch
#

to bloat imo

pliant gulch
slate swan
#

mhmmmm

pliant gulch
#

Not taking much lines

#

Registration seems to be the big killer

cloud dawn
pliant gulch
slate swan
#

interaction: rin.app.cmd.inter maybe?

#

seems bad

cloud dawn
#

Means that if you do it too bare people might not understand it easily.

slate swan
#

yeah

pliant gulch
slate swan
#

rin.AppCommand.Interaction?

#

everyone knows that app means application

pliant gulch
# pliant gulch Simple, sleek

Aw fuck, I'm gonna probably have heavily use metaclasses to keep everything large behind the scenes and keep the interface itself clean

#

😔

slate swan
#

gl with that

pliant gulch
#

I dabble with metaclasses tho

slate swan
#

lol

cloud dawn
#

let's all use js

slate swan
#

ruby

cloud dawn
#

ruby is less supported than Python

pliant gulch
cloud dawn
#

We are not going to evolve backwards.

hard trail
pliant gulch
#

Purest in a way where it only uses what the API gives

slate swan
#

its clean tho

cloud dawn
#

No it's too bare.

#

Sometimes more is better.

pliant gulch
#

As a minimalist I can say that is never true for me

cloud dawn
#

As long as people are coding on x86 things will never be minimal.

slate swan
pliant gulch
#

Why is the function body like that

slate swan
#

i dont know you guys anymore🧍‍♂️

hard trail
#
async def on_message(ctx):
  for word in naughty_words:
    if word in ctx.content:
      if ctx.author.guild_permissions.manage_messages:
        
        ...
      return
      if ctx.author == bot.user:
        ...
    else:
        await asyncio.sleep(3)
        await ctx.delete()
        await ctx.channel.send(f"{ctx.author.mention}, you aren't allowed to say that!")
  await bot.process_commands(ctx)```
cloud dawn
slate swan
#

its beautiful yall just dont know whats real beauty 😔

slate swan
#

you as well🚶

final iron
#

Bruh

#

🏃

slate swan
#

yall talk allot about ruby smh when you guys be programing in rust🏃

final iron
#

I literally use assembly smh

hard trail
slate swan
hard trail
#

But it didn't work

final iron
slate swan
slim ibex
#

rust is fire

slate swan
final iron
#

See

#

Nobody likes ruby

slate swan
#

ruby > rust

pliant gulch
#

ayo

slim ibex
#

rust > ruby

pliant gulch
#

ain no way he just said ruby over rust

slim ibex
#

^

#

im getting off

final iron
#

I haven't used rust

slate swan
final iron
#

💀

slate swan
#

i hate the syntax of rust

#

its just ew

patent lark
cloud dawn
#
@bot.event
async def on_message(ctx):
  for word in naughty_words:
    if word in ctx.content:
      if ctx.author.guild_permissions.manage_messages:
        
        ...
      return
      if ctx.author == bot.user:
        ...
    else:
        await asyncio.sleep(3)
        await ctx.delete()
        await ctx.channel.send(f"{ctx.author.mention}, you aren't allowed to say that!")
  await bot.process_commands(ctx)
``` guys help `"nope. My bot is spamming me with "@hard trail, you aren't allowed to say that!" every 5 seconds"` brain is off rn
left crater
slim ibex
#

u talk about rust when this is ruby

slate swan
cloud dawn
slate swan
#

its a fork of dpy

slim ibex
#
def function(var1)
  ...
end
#

the fuck is end

left crater
#

so i should learn disnake instead

slate swan
slim ibex
#

ik

slate swan
slim ibex
#

but its stupid

patent lark
slate swan
cloud dawn
#

@hard trail so check for a list with words if it is in the list delete the msg and send msg. But if user is a bot or has manage messages keep it?

slim ibex
#

compared to rust

fn calculate(num1: i32, num2: i32) -> i32 {
  num1 + num2
}
#

😍

slate swan
#

disgusting

#

🤮

pliant gulch
#

Your not returning

slate swan
#

HAHA

#

your not even right😭

pliant gulch
#

oh

#

nevermind, doens't rust auto return

#

at the end lol

slim ibex
#

if you dont use return and remove semi colon it returns

slate swan
#

😭

slim ibex
#

num1 + num2 is the same as return num1 + num2;

cloud dawn
pliant gulch
#

I was about to say the C and the C++ in me was alerting me

#

first thing I saw was no semi

cloud dawn
#
fn five() -> i32 {
    5
}

fn main() {
    let x = five();

    println!("The value of x is: {}", x);
}
pliant gulch
#

😔

cloud dawn
#

cmon andy think minimal

#

returns are overrated

pliant gulch
#

This is bad minimal

#

😔

cloud dawn
#

😂

pliant gulch
#

If it was forced this would be a whole or-deal

slim ibex
#
fn largest_i32(list: &[i32]) -> i32 {
    let mut largest = list[0];

    for &item in list {
        if item > largest {
            largest = item;
        }
    }

    largest
}

how could you not love this

pliant gulch
#

not explicit

slim ibex
#
fn largest<T>(list: &[T]) -> T {
    let mut largest = list[0];

    for &item in list {
        if item > largest {
            largest = item;
        }
    }

    largest
}
```😍
pliant gulch
#

What if I wanted to return something else at the end of the code instead of largest!

pliant gulch
slim ibex
#

🙃

pliant gulch
#

I'm for real about to implement application commands before I even add messages to my wrapper

hard trail
pliant gulch
#

😔

cloud dawn
slim ibex
#
struct Point<X1, Y1> {
    x: X1,
    y: Y1,
}

impl<X1, Y1> Point<X1, Y1> {
    fn mixup<X2, Y2>(self, other: Point<X2, Y2>) -> Point<X1, Y2> {
        Point {
            x: self.x,
            y: other.y,
        }
    }
}
#

beauty

#

anyways imma stop cuz i dont wanna be banned for off topic

#

personally, i have fell in love with c# lately

slate swan
#

ruby is clean

def cooler()
    return puts "ruby is goated"
end
#

and just clean

pliant gulch
#

Your such a ruby advocate but so far you've only sent snippets, lets see you make something serious with ruby

#

👁️ 👁️

slim ibex
#

a challenge

slate swan
#

yes

pliant gulch
#

Websocket implementation on ruby

native wedge
slate swan
cloud dawn
# hard trail Wait but before you knew that the if part was wrong here
@bot.event
async def on_message(ctx):
    if ctx.author.bot:
        return

    if any([word for word in ctx.message.content if word in naughty_words]):
        if not ctx.author.guild_permissions.manage_messages:
            await ctx.delete()
            await ctx.channel.send(
                f"{ctx.author.mention}, you aren't allowed to say that!"
                )

    await bot.process_commands(ctx)
green bluff
#

atleast can u guys help me with this this technically does not have the word youtube in it

native wedge
cloud dawn
slate swan
green bluff
cloud dawn
native wedge
green bluff
#

bruhh

cloud dawn
# green bluff bruhh

You are knowingly breaking ToS, you know that we won't help with this project.

slate swan
tame nymph
#

I dont like Ruby

#

although I've done discord.rb myself

slate swan
#

ew

slate swan
tame nymph
#

but moving at a slower rate

slate swan
#

yeah

tame nymph
#

the interactions and slash commands didn't come early

cloud dawn
slate swan
#

ruby isnt for heavy processes either

tame nymph
#

discord.rb implements slower and runs slower

slate swan
#

they even say it in the github lol

cloud dawn
#
but discord.rb is literally just discord.py
but moving at a slower rate
slate swan
#

hes got a point there

tame nymph
#

I didnt know that

#

I have never done discord dev since 5 months ago

cloud dawn
#

😂

cloud dawn
#

Having a good laugh rn..

tame nymph
#

ok im unopinionated

#

because I dont know about discord anymore

slim ibex
#

switch to guilded?? 👀

slate swan
# cloud dawn Having a good laugh rn..

drb read me

You should consider other libraries if:

You need to scale to large volumes of servers (>2,500) with lots of members. It's still possible, but it can be difficult to scale Ruby processes, and it requires more in depth knowledge to do so well. Especially if you already have a bot that is on a large amount of servers, porting to Ruby is unlikely to improve your performance in most cases.
You want full control over the library that you're using. While we expose some "lower level" interfaces, they are unstable, and only exist to serve the more powerful abstractions in the library.

🏃

hard trail
#

oof now the bot isn't responding now

tame nymph
#

I migrated away from discord dev to studying O(1) cheemsadidas

pliant gulch
#

Time complexity is quite easy to understand

green bluff
#

or r music bots altogether illegal

slim ibex
#

cop or drop on JetBrains Rider license

tame nymph
slim ibex
green bluff
#

oh okay

reef trail
#
@commands.command()
@commands.check(permissions.is_owner)
async def adminse(self, ctx, message_id):
    """Sends a message and allows you to edit it"""
    async with ctx.channel.typing():
        try:
            await ctx.message.delete()
        except discord.NotFound:
            pass
        msg = await ctx.channel.fetch_message(message_id)
        await ctx.send(
            "What would you like to change the message to?", delete_after=delay
        )
        msg = await self.bot.wait_for(
            "message", check=lambda m: m.author == ctx.author
        )
        await msg.edit(content=msg.content)```
 im trying to make a command that allows me to edit a message sent by my bot, but i keep getting this error:
```py
CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 50005): Cannot edit a message authored by another user```
, the message ID is from my bot, so i dont understand what it means
honest vessel
#

i use webradios n db to store add delete channels @green bluff

slate swan
#

its so overcomplicated for a reason🚶

pliant gulch
#

You can't edit others messages unless otherwise being the author

reef trail
#

"the message ID is from my bot, so i dont understand what it means"

pliant gulch
#

The API thinks otherwise

reef trail
#

the api is a nerd angery

pliant gulch
#

Oh wait nevermind

#

You wait for a new message and capture it as msg

#

You overwrote the previous msg definition

reef trail
#

i simplified it a ton

    async def edit(self, ctx, message_id, new_content):
        """Edit a message from the bot to say something else"""
        try:
            await ctx.message.delete(delay=delay)
        except:
            pass
        msg = await ctx.channel.fetch_message(message_id)
        await msg.edit(content=new_content)```
 i think this would work instead
honest vessel
#

@reef trail u overwrite msg variable object

pliant gulch
#

Do you know you could also just typehint message_id to discord.Message

reef trail
#

i did not know that, thanks

honest vessel
reef trail
#
  File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 994, in invoke
    await ctx.command.invoke(ctx)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 886, in invoke
    await self.prepare(ctx)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 820, in prepare
    await self._parse_arguments(ctx)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 726, in _parse_arguments
    transformed = await self.transform(ctx, param)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 578, in transform
    return await run_converters(ctx, converter, argument, param)  # type: ignore
  File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/ext/commands/converter.py", line 1182, in run_converters
    return await _actual_conversion(ctx, converter, argument, param)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/ext/commands/converter.py", line 1076, in _actual_conversion
    return await converter().convert(ctx, argument)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/discord/ext/commands/converter.py", line 395, in convert
    raise ChannelNotFound(channel_id)
ChannelNotFound: Channel "None" not found.```
 what ![r_HUH](https://cdn.discordapp.com/emojis/814431234292711474.webp?size=128 "r_HUH")
#

im not even passing a channel..

#

wait. ctx.channel.fetch_message() is this not a function?

slate swan
#

i have to do it with the bare endpoint which is something im not going to do🚶

#

hi

#
 channel = Bot.get_channel(-----)
TypeError: Client.get_channel() missing 1 required positional argument: 'id'
#
@tasks.loop(seconds = 62)
async def myloop(message):
    if message.channel.id == channel:
        await channel.send("Remember guys! No profanity :) ")
#

error then code

cloud dawn
#

Traceback?

slate swan
#

Any way to make discord bot livestream a clip?

reef trail
#
@commands.command()
@commands.check(permissions.is_owner)
async def edit(self, ctx, *new_content):
    """Edit a message from the bot to say something else"""
    new_content = " ".join(new_content)
    try:
        await ctx.message.delete(delay=delay)
    except:
        pass
    channel = self.bot.get_channel(932548255202545664)
    msg = await channel.fetch_message(932822132612808725)
    await msg.edit(content=new_content)
    await ctx.send("Done", delete_after=delay)```
anyone know how to get the content of the message before its edited so you can add new things without having to get the entire message just to add one new item?
cloud dawn
#

!d disnake.on_message_edit

unkempt canyonBOT
#

disnake.on_message_edit(before, after)```
Called when a [`Message`](https://docs.disnake.dev/en/latest/api.html#disnake.Message "disnake.Message") receives an update event. If the message is not found in the internal message cache, then these events will not be called. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds.

If this occurs increase the [`max_messages`](https://docs.disnake.dev/en/latest/api.html#disnake.Client "disnake.Client") parameter or use the [`on_raw_message_edit()`](https://docs.disnake.dev/en/latest/api.html#disnake.on_raw_message_edit "disnake.on_raw_message_edit") event instead.

The following non-exhaustive cases trigger this event...
reef trail
cloud dawn
#

!d discord.on_message_edit

unkempt canyonBOT
#

discord.on_message_edit(before, after)```
Called when a [`Message`](https://discordpy.readthedocs.io/en/master/api.html#discord.Message "discord.Message") receives an update event. If the message is not found in the internal message cache, then these events will not be called. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds.

If this occurs increase the [`max_messages`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") parameter or use the [`on_raw_message_edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_raw_message_edit "discord.on_raw_message_edit") event instead.

The following non-exhaustive cases trigger this event...
reef trail
#

wOaH

cloud dawn
#

!d nextcord.on_message_edit

unkempt canyonBOT
#

nextcord.on_message_edit(before, after)```
Called when a [`Message`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Message "nextcord.Message") receives an update event. If the message is not found in the internal message cache, then these events will not be called. Messages might not be in cache if the message is too old or the client is participating in high traffic guilds.

If this occurs increase the [`max_messages`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.Client "nextcord.Client") parameter or use the [`on_raw_message_edit()`](https://nextcord.readthedocs.io/en/latest/api.html#nextcord.on_raw_message_edit "nextcord.on_raw_message_edit") event instead.

The following non-exhaustive cases trigger this event...
reef trail
#

no WaAAaaAy

red sundial
#

lol

#

so i have a question. im creating a poll command and im done with it, but i thought it would be a cool idea to dm the analytics of the poll to whoever requests it. so for example a pie chart would be pretty cool

slate swan
red sundial
#

so would i have to use matplotlib for this

red sundial
slate swan
red sundial
#

lolll

slate swan
#

just a method of nextcord