#discord-bots

1 messages Β· Page 430 of 1

haughty sedge
#

oh, got it

high flame
#

so people won't spam it

#

or make a limit so they can't use it while a command is running

slate swan
high flame
#

yeah

upbeat otter
#
if (message.reference and member == (await message.channel.fetch_message(message.reference.message_id)).author) or member.id in message.raw_metions:```
Why is the `.raw_mentions` giving erros? Btw i am not using Cogs
high flame
#

i stopped coding bots

brave geyser
#

Hey, do you know how I can get a user input from chat. I want only the input of the user

haughty sedge
#

what could possibly go wrong if discord.py never ever get updates

lament mesa
high flame
#

nice

#

what you're doing now

haughty sedge
#

ive started writing bots in java, its simple but not more than python

high flame
haughty sedge
high flame
#

idk

haughty sedge
#

if not verified then also?

high flame
#

idk

haughty sedge
#

my bot is above 90+ guilds & ill apply for verification

reef dock
#

not officially

haughty sedge
#

oh

upbeat otter
#

Anybody bothering to help please?

high flame
#

??

static patio
#

well what should i do?

static patio
#

i just started python like a month ago

high flame
#

typo

upbeat otter
high flame
upbeat otter
#

oh lol

high flame
#

typo in your code

upbeat otter
#

am dumb

static patio
upbeat otter
#

read imgflip dev docs, i am sure there is a method to specify formats

#

i just saw someone's on github today

static patio
#

ah okay

#

thanks

zinc lion
lament mesa
# high flame what you're doing now

Learning full stack web dev (i already know a good amount of backend development) and after that im hoping to look into machine learning and AI

high flame
#

same!

#

but not going to learn ai

brisk helm
#

i need help can someone help me pls

#

ohh yes sory

#

Yes i know but its not commadn

lament mesa
brisk helm
#

and its not porblem

#

<object Rush2618 at 0x001B561E0> can you help?

#

?

static patio
upbeat otter
static patio
#

okay

upbeat otter
static patio
#

oh ok ty

upbeat otter
#

@static patio If u figure out how to make the meme generator, can u also plz tell me πŸ˜‚

gilded swallow
#

How can I send a "only you can see this" message?

static patio
#

ye lol ill share the code once i figure out why the error

static patio
#

can u tell anything about this?

upbeat otter
#

Indent the data variable with a tab space

static patio
#

oh?

#

tf thanks

#

now lemme check if it works

crystal kestrel
#

does anyone recommend any good slash command libraries?

upbeat otter
crystal kestrel
#

that's node.js bruh

#

dank memer is a javascript bot

upbeat otter
#

i see

#

just a minute

crystal kestrel
#

mee6 = possibly java
rythm = java, JDA
carl-bot = discord.py (RIP)

upbeat otter
crystal kestrel
#

yagpdb = golang, discordgo

dire shadow
crystal kestrel
#

slack is another chatting platform

upbeat otter
#

lmao, i just picked a video of a channel, i used to watch

crystal kestrel
#

lmao

upbeat otter
#

best option

dire shadow
crystal kestrel
#

discord-py-slash-commands is a mess

crystal kestrel
#

long name, idk what's the new name, no docs, can't seem to find the github

upbeat otter
#

send me your replit page link @dire shadow

crystal kestrel
#

basically nothing else

maiden fable
crystal kestrel
#

ooo

maiden fable
#

Literally the same syntax and docs

#

With some added features

maiden fable
#

But they suggest to not install it rn and wait for 2.0, which should be in a few days

crystal kestrel
#

dpy 2.0.0 is still gonna be released?

crystal kestrel
reef dock
#

no clue

fast musk
#

2.0 is dead.

#

All work has ceased.

crystal kestrel
#

snekcord is not that active, hikari is bad I heard, and discord.py is dead

#

and slash commands are a mess

#

with message intents

#

and a whole 1 hour cooldown to add slash commands

#

ima just wait for a few weeks and take a break while I wait for new maintainers

maiden fable
compact harbor
#

slash commands has less features till now, it's a nightmare for all discord developers to create bots with slashes and rewriting code without any official releases and documentation

crystal kestrel
# maiden fable Yup

but the code on GitHub is archived and there's no support for slash commands

#

dpy is dead

lament mesa
crystal kestrel
#

which I'm not gonna do since im not used to asynchronous programming at all

ionic wadi
#

@bot.command()
async def help(ctx):
embed = discord.Embed(title="Hoe kan ik je helpen!", description="Zie hieronder de modules!")
embed.add_field(name="Moderatie", value="!help moderatie", inline=True)
embed.add_field(name="Public", value="!help public", inline=True)
embed.add_field(name="Informatie", value="!help informatie", inline=True)
await ctx.send(embed=embed)

#

I dont get an output or error?

compact harbor
compact harbor
#

then this code will run

crystal kestrel
#

not sure

crystal kestrel
ionic wadi
#

@bot.command(name="help")
async def help(ctx):
embed = discord.Embed(title="Hoe kan ik je helpen!", description="Zie hieronder de modules!")
embed.add_field(name="Moderatie", value="!help moderatie", inline=True)
embed.add_field(name="Public", value="!help public", inline=True)
embed.add_field(name="Informatie", value="!help informatie", inline=True)
await ctx.send(embed=embed)

maiden fable
#

Hey hey hey @ionic wadi did u do help_command = None in the bot constructor?

ionic wadi
maiden fable
#

Weird

ionic wadi
#

I tried bot.remove_command either, but didnt make anything change.

twilit adder
ionic wadi
#

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

ionic wadi
crystal kestrel
#

hmm

compact harbor
#

intents are the events that the bot will respond to

brisk helm
#

How to get guild avatar url

ionic wadi
crystal kestrel
twilit adder
#

if not then it’s a problem with the on_message prob

ionic wadi
#

Thats the only thing working

crystal kestrel
#

they are also not necessarily events, some can be guild members and emojis

twilit adder
#

πŸ€”

ionic wadi
#

@bot.event
async def on_message(message):
empty_array = []
id = message.author.id
modmail_channel = discord.utils.get(bot.get_all_channels(), name="modmail")

if message.author == bot.user:
    return
if str(message.channel.type) == "private":
    if message.attachments != empty_array:
        files = message.attachments
        await modmail_channel.send("[" + message.author.display_name + "]")

        for file in files:
            await modmail_channel.send(file.url)
    else:
        await modmail_channel.send("[" + message.author.display_name + "] " + message.content)

elif str(message.channel) == "modmail" and message.content.startswith("<"):
    member_object = message.mentions[0]
    if message.attachments != empty_array:
        files = message.attachments
        await member_object.send("[" + message.author.display_name +  "]")

        for file in files:
            await member_object.send(file.url)
    else:
        index = message.content.index(" ")
        string = message.content
        mod_message = string[index:]
        await member_object.send("[" + message.author.display_name + "]" + mod_message)
crystal kestrel
#

for dpy

if not message.guild:
  return
ionic wadi
#

Huh now It does work without that code

#

Whats the problem xd

twilit adder
#

hold on

agile goblet
#

change bot.event to bot.listen()

twilit adder
#

try adding this await bot.process_commands(message)

agile goblet
ionic wadi
agile goblet
#

np

twilit adder
#

oh

agile goblet
#

process commands can cause other problems on some occasions, i much prefer my mehtod

twilit adder
#

hm

ionic wadi
summer lagoon
ionic wadi
twilit adder
crystal kestrel
summer lagoon
twilit adder
crystal kestrel
high flame
#

edpy or whatever

summer lagoon
crystal kestrel
#

yes

#

there's thousands of bots using dpy

summer lagoon
high flame
#

even you

summer lagoon
high flame
#

its the same bruh

#

forking a repository makes a repository with the same content in your account

#

you can edit it or do whatever

#

and then people will add new stuff in their own forks

crystal kestrel
#

forking = cloning the repo to ur own account, then u can create ur own changes and either share it, or contribute it back to the original repo, but it's dead now

summer lagoon
#

I'll do this.

summer lagoon
#

Thanks!

#

Btw. What is "bruh"?

high flame
#

bruh.

spring flax
#

Uh

crystal kestrel
#

bruh

summer lagoon
twilit adder
#

bruh

crystal kestrel
#

bruh

twilit adder
#

bruh

crystal kestrel
#

that's what bruh is ig lmao

high flame
#

ok dont spam

spring flax
crystal kestrel
#

yes

summer lagoon
crystal kestrel
#

its like

high flame
crystal kestrel
#

a moment where u having nothing to say, ur just speechless

slate swan
crystal kestrel
#

that's when u bruh

slate swan
#

Something like that. It's hard to explain

high flame
#

ugh

summer lagoon
#

Oh, okay.

#

Soooooo... Bruh.

high flame
#

bruh πŸ€¦β€β™‚οΈ

crystal kestrel
#

buh.

high flame
#

buh

#

ok no more lmao

#

we'll get muted by a mod

crystal kestrel
#

yes

high flame
#

!ot

twilit adder
#

XD

slate swan
twilit adder
#

repl is so slow at loading :/

agile goblet
#

bruh

high flame
#

just don't use it

#

use vs code

hoary gust
#

Guys is it true that js also finished

#

Djs

stiff nexus
night crater
#

Im guessing, probably not and that its a meme

hoary gust
#

Maybe

high flame
#

i just want everything to not change ;-;

#

i dont need slash commands or something

hasty iron
high flame
#

but

high flame
hasty iron
#

unless you have the message content intents

night crater
#

if they dont absolutely require the message content, you wont get the intent, so you will need to use slash commands

hasty iron
#

if you don't, you're forced to use slash commands

night crater
#

or just using a mention prefix

high flame
#

so i can enable message intents same way as members, presence?

#

after changes

hasty iron
#

yes, for unverified bots

high flame
#

what about verified

hasty iron
#

need to apply

#

same process as member intents and the other one

high flame
#

oh k

crystal kestrel
#

only after Apr 2022

maiden fable
#

Breh, that link is just a rock roll 7408_shrekstare

high flame
#

2022*

high flame
#

apr 2021 already passed lmao

crystal kestrel
#

yes lmaooo

high flame
#

but i won't wait until that

slate swan
#

i need help
when i try to run my bot it gives me the error

AttributeError: 'Command' object has no attribute 'run'```
hasty iron
#

you have a command named client

high flame
maiden fable
#

client is a command

slate swan
#

ohh tysm

#

He might be using bot instead of client

#

nah

#

i had command named client

#

for client as in

#

bot

#

Oh okay

#

its saying improper token has been passed when ive just regenerated it also

soft trout
#

you know how dank memer has time where you have to wait between command

#

how do i do that?

high flame
#

cooldown

#

!d discord.ext.commands.cooldown

unkempt canyonBOT
#

discord.ext.commands.cooldown(rate, per, type=<BucketType.default: 0>)```
A decorator that adds a cooldown to a [`Command`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command")

A cooldown allows a command to only be used a specific amount of times in a specific time frame. These cooldowns can be based either on a per-guild, per-channel, per-user, per-role or global basis. Denoted by the third argument of `type` which must be of enum type [`BucketType`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.BucketType "discord.ext.commands.BucketType").

If a cooldown is triggered, then [`CommandOnCooldown`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.CommandOnCooldown "discord.ext.commands.CommandOnCooldown") is triggered in [`on_command_error()`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.on_command_error "discord.on_command_error") and the local error handler.

A command can only have a single cooldown.
slate swan
#

its saying improper token has been passed when i try to start my bot

woeful hearth
ionic wadi
#

@bot.command(name="help")
async def help(ctx):
if message.content.lower() == None:
embed = discord.Embed(title="Hoe kan ik je helpen!", description="Zie hieronder de modules!")
embed.add_field(name="Moderatie", value="!help moderatie", inline=False)
embed.add_field(name="Public", value="!help public", inline=False)
embed.add_field(name="Informatie", value="!help informatie", inline=False)
await ctx.send(embed=embed)
return
if message.content.lower() == "moderatie":
embed = discord.Embed(title="Moderatie commands", description="Zie hieronder de moderatie commands!")
embed.add_field(name="!warn <Gebruiker> <reden>", value="Persoon een waarschuwing geven.", inline=False)
await ctx.send(embed=embed)
return
if message.content.lower() == "public":
embed = discord.Embed(title="Public commands", description="Zie hieronder de public commands!")
embed.add_field(name="!help (moderatie / public / informatie)", value="Help krijgen van een bepaalde module commands.", inline=False)
embed.add_field(name="!warnings <Gebruiker>", value="Waarschuwingen bekijken van een bepaald persoon.", inline=False)
await ctx.send(embed=embed)
return

NameError:name 'message' is not defined

high flame
maiden fable
#

@high flame enhanced-dpy (:

slate swan
#

i cant run my bottttttttt

high flame
#

!pypi enhanced-dpy

unkempt canyonBOT
polar dirge
#
@client.event
async def on_message(message):
  channel1 = client.get_channel(id)
  channel2 = client.get_channel(id)
  if message.channel.id == channel1:
    await channel2.send(message.content)```

trying to grab all messages send in channel1 and send it to channel2, why is it not working? no errors :/
polar dirge
ionic wadi
polar dirge
# ionic wadi Class?

@client.group(invoke_without_command=True)
aysnc def help

@help.command()
async def moderate

@help.command()
async def public

pure vapor
fast quest
#

???

#

Wait what happened to discord py

spring flax
fast quest
#

I just started learning it :(

spring flax
unkempt canyonBOT
ionic wadi
#

My code still works, what exactly happened to discord.py?

rare edge
#

with changes coming to on message, if you only need slash commands, you might consider running it over slash commands webhook

ionic wadi
#

Oh shit

rare edge
spring flax
ionic wadi
#

I have like 16 bots running rn with all over 1500 lines rip mesad_cat

spring flax
#

!pypi enhanced-dpy

unkempt canyonBOT
spring flax
#

this is very similar to dpy ^

#

it's the same with added features

#

You can switch to it i guess

rare edge
ionic wadi
#

But like there are no slash commands gonna be supported?

spring flax
#

Not in dpy

ionic wadi
#

And discord kinda made us switch to slash commands

gentle verge
#

is discord py actually losing its only maintainer (rapptz)?

woeful hearth
#

dpy will stop working in 2022

slate swan
#

my bot wont send the help commands

reef dock
slate swan
#

learn js

woeful hearth
#

because discord is shoving slash commands down developers throats

gentle verge
woeful hearth
#

read the gist

reef dock
gentle verge
woeful hearth
#

He tried

reef dock
#

read the gist and find out

round raptor
#

AttributeError: module 'discord.ext.commands' has no attribute 'error'

spring flax
#

Danny has no motivation to implement slash commands

rare edge
#

it's easier for load reasons on both sides

spring flax
#

if you command name is ban, do @ban.error

reef dock
spring flax
#

so it would be py @changepreflix.error

rare edge
#

Trust and Security is massive and expensive problem, bot gateway is extremely heavy

round raptor
spring flax
#

You can use the on_command_error for that

round raptor
spring flax
#

!d discord.on_command_error

unkempt canyonBOT
#

discord.on_command_error(ctx, error)```
An error handler that is called when an error is raised inside a command either through user input error, check failure, or an error in your own code.

A default one is provided ([`Bot.on_command_error()`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.on_command_error "discord.ext.commands.Bot.on_command_error")).
calm musk
#

hii how do i get a role in a cog?

#

get_role(id) works but self doesnt have that attribute

reef dock
#

i am already semi prepared for the full transition to slash
just need to move over commands that require an arg then i am done

high flame
calm musk
#

nvm i got it

rare edge
#

development has ceased

high flame
rare edge
#

However, Danny is right, if you bot is a parrot, stop using Discord.py and move over to HTTP Slash Interactions

fossil patio
rare edge
high flame
#

peeps use edpy

pale turtle
#

Look at my nickname -_-

night crater
#

realistically most people need to move to slash commands

high flame
night crater
#

and you might as well do it over HTTP not over gateway

fossil patio
dapper cobalt
unkempt canyonBOT
night crater
#

(Also if you ever grow the bot you will thank yourself for going with http over gateway)

dapper cobalt
rare edge
#

I think that's what helpers need to be saying hard. If you bot is parrot, use HTTP

rare edge
fossil patio
#

what is a parrot bot

#

explain

high flame
rare edge
#

parrot bot means it just responds to command

#

it doesn't do anything

fossil patio
#

mine also uses vc

rare edge
fossil patio
#

rickroll

high flame
#

bruh

dapper cobalt
rare edge
#

I imagine voice will be locked down

fossil patio
#

otherwise it is interacting with a http api for a game

rare edge
pale turtle
#

Remind me, other than it being slow, what is bad with slash commands? I think there is something about message content but not sure because it is an interaction

fossil patio
#

and allowing users to vote on what the game should do

rare edge
#

you can work 100% over HTTP

high flame
high flame
fossil patio
#

idk how to do that though

high flame
#

read everything

fossil patio
#

idk how to work with the http api

night crater
#

you dont have to

#

this is the whole idea of HTTP slash commands

#

discord sends you a request to your webserver

#

you return a JSON

high flame
#

what is in the json

fossil patio
#

oooh

#

so thats how /commands work

#

discord pings you

#

hmm that will be annoying since i cant port foward

hasty iron
pale turtle
#

How can you wait for a response tho? I never understood this

hasty iron
#

like a wait_for?

rare edge
#

you send buttons, you get further POST requests to your server with button clicks

high flame
pale turtle
high flame
#

like how to wait for it

rare edge
#

wait for what?

hasty iron
#

oh the websocket waits for data from discord

brave geyser
#

Hey, how can I ask if args are more than 1 ?

pale turtle
hasty iron
#

what do you mean 'how'

pale turtle
#

Is there some asyncio stuff

hasty iron
#

yes ofc

rare edge
#

read up on how websockets work

high flame
#

i forgot how

hasty iron
#

you can have a waiter that waits forever until data is received

lament mesa
#

asyncio.wait_for

hasty iron
pale turtle
hasty iron
#

you can just use a Future

high flame
#

i was learning from capitalism's lib lol

stiff nexus
#

discord.User is like await bot.fetch_user() right?

hasty iron
#

one is a class the other is a method

high flame
#

fetch_user return discord.User instance

hasty iron
#

they're not alike

pale turtle
#

Same object, just with more options

stiff nexus
#

but i how do i use fetch_user

lament mesa
stiff nexus
high flame
#

3k forks πŸ‘€

high flame
#

yeah

rare edge
hasty iron
lament mesa
untold token
#

a Member object is an user that is in a guild

stiff nexus
pale turtle
high flame
#

you'll find it somewhere in http.py i guess

untold token
#

and an User object represents the User itself

pale turtle
#

I wasn't talking about a Member object

untold token
potent light
#

does anyone need help?

lament mesa
potent light
untold token
untold token
#

fetch will make an API call

#

get will get the user from bot cache

hasty iron
untold token
stiff nexus
lament mesa
wicked atlas
#

Just learned that discord.py got discontinued. Sadness.

lament mesa
stiff nexus
untold token
# stiff nexus yep

if you want to get a member its better to get the user from the Guild object, if you want to find an User, it should be seperate command imo

hasty iron
#

i think aiohttp just uses a copy of asyncio.StreamReader or that itself, which can asynchronously read data

stiff nexus
high flame
#

discord.Member is a discord.User that's connected to a specific guild

#

you can access that guild with discord.Member.guild

kindred epoch
hasty iron
#

me who downloaded the code

pale turtle
slate swan
#

dislash, discord components

#

iirc

rare edge
#

FastAPI

slate swan
#

What?

rare edge
# slate swan What?

You are doing disservice linking to WebSocket Interaction bots, Discord wants bots off WebSocket and using HTTP

deft warren
slate swan
rare edge
#

FastAPI is HTTP REST Server

indigo trout
#

Hey, is there a way to get the voice channel a user is in based on their id?

rare edge
fickle turret
rare edge
fickle turret
#

Django is not yuck and what you are saying doesn't make sense

rare edge
slate swan
rare edge
rare edge
hasty iron
fickle turret
#

How does using frameworks to create backends help with using an api

high flame
#

@hasty iron your code in miku is so clean :o

hasty iron
#

ty

rare edge
fickle turret
fickle turret
rare edge
#

you can get them over the websocket gateway, however, as Danny pointed out, it's clear Discord wants to move as much off websocket as possible

lament mesa
#

and more efficient?

fickle turret
#

isn't it also harder?

rare edge
# lament mesa But isn't websocket faster than HTTP?

Nope, it's hard to load balance and requires greater load to keep websocket alive, if all your bot is doing is waiting for slash commands, which is what most bots do and what I call a parrot bot, HTTP makes ton more sense for you and Discord

lament mesa
#

oh thanks didnt know that

vocal plover
#

Rabbit is right, if all you want is slash commands and interactions websocket events are a better and less compute hungry solution

#

Fucking autocorrect

#

Webhook

rare edge
#

it could also be cheaper

#

I don't know if there is any good libraries yet, hopefully someone will release one

#

Since you could run it over free Heroku

vocal plover
#

There's a good one, hang on while I search my dms for it lol

rare edge
#

This is over Websocket which as pointed out, is not new hotness

#

if you have existing Websocket bot, I'd use this to get it while you work on rewrite but if you are making a new one, might as well get ahead of the curve

pliant gulch
#

Very pog, my dispatch working PepeBooba

vale pendant
#

Yo, what's that theme? That looks nice asf.

slate swan
#

!ytdl

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)
hasty iron
#

weren’t you using neovim andy

#

what happened to that

pliant gulch
#

Neovim isn't configured on my labtop well which is what I'm on rn

#

The LSP kinda bugging with flake8 and pyright

slate swan
#

!ytdl

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)
slate swan
#

!code

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

slate swan
#
@slash.slash(description='Igra pesem (Pride v VC).')
@commands.cooldown(1,6,commands.BucketType.channel)
async def igraj(ctx, *, url):
    voicetrue = ctx.guild.me.voice
    
    if voicetrue is None:
        await ctx.author.voice.channel.connect()

    player = music.get_player(guild_id=ctx.guild.id)
    if not player:
        player = music.create_player(ctx, ffmpeg_error_betterfix=False)

    
    if not ctx.voice_client.is_playing():
        embed = discord.Embed(description='Iscem...', colour=0xf1c40f)
        msg = await ctx.send(embed=embed)
        sleep(1)
        await player.queue(url, search=True)
        song = await player.play()
        desc = f'Igram {song.name}'
        songe = discord.Embed(description = desc, colour=0xf1c40f)
        await msg.edit(embed=songe)

    else:
        song = await player.queue(url, search=True)
        embed=discord.Embed(description=f'{song.name} je v cakalni vrsti!', colour=0xf1c40f)
        await ctx.send(embed=embed)
``` is this illegal??
rare edge
#

Illegal like cops raid your house, probably not, copyright infringement where you end like Groovy and Rythm, yes

#

Unless 100% your work

half hatch
#

anyone know how to get slash commands to update into discord earlier

hoary gust
#

anyone having link to the rust server

solemn sluice
#

Rip Danny

#

I love you

night crater
manic wing
#

whats the next dpy

night crater
#

not really

#

ultimately it's your pain

vocal plover
#

Fair point, I think I'll go with the basics first KEKW

night crater
#

Rust is just one of those languages where you cant random your way around it

vocal plover
#

smh i can random my way around anything it just takes a while

#

but yeah async networking is probably a step too far for me to random around in a language im entirely unfamiliar with

night crater
#

for

  1. there is significantly less Q&As done e.g. stack overflow questions that ik soo many people use
  2. writing Rust code like you would Python or JS e.g. heavily callback based, wont get you far
  3. lifetimes and borrowing trip basically everyone up, and it is a hard learning curve to get over
magic stump
#

oke

#

File "c:\Users\dawid\Desktop\Bot-partnerstwa\mainpy123.py", line 47, in on_raw_reaction_add print(payload.member.emoji.name) AttributeError: 'Member' object has no attribute 'emoji'

manic wing
#

print(dir(emoji))

magic stump
#
@bot.event
async def on_raw_reaction_add(payload):
    if payload.emoji == "βœ…":
        print("antek")

    else:
        print(payload.member.emoji.name)
        

@bot.command()
@commands.cooldown(1, 60, commands.BucketType.user)
async def wsp(ctx, *, wiadomosc):

    if not ctx.message.attachments:
        return await ctx.send('Nie dodano zrzutu ekranu')

    if not ctx.guild:

        channel = bot.get_channel(872857064274296832)
        embed=discord.Embed(title= f"WiadomoΕ›Δ‡ od **{ctx.author}**", color = 0x0000fa00)
        embed.set_image(url=ctx.message.attachments[0].url)

        await ctx.send("Twoja reklama zostaΕ‚a wysΕ‚ana pomyΕ›lnie")

        msg = await channel.send(f"{wiadomosc}",embed=embed)

        await msg.add_reaction("βœ…")

        await msg.add_reaction("❎")``` code
manic wing
#

print the emoji and the type of the emoji

#

easiest way to solve anything is with printing the attributes, class and itself

magic stump
#

oke

rare edge
#

Switch to http

#

Discord has flask example

magic stump
#

in else?

slate swan
#

can I have spotify for playing and not getting raided by cops??

reef dock
#

lol

rare edge
hasty iron
slate swan
hasty iron
#

nothing

#

dont make music commands

slate swan
reef dock
#

dont know why they are botherd by it now lol

hasty iron
slate swan
#

mee have music

hasty iron
#

ok?

rare edge
hasty iron
#

you can make music commands but you won’t receive help here

slate swan
#

I heard they removed their music module

rare edge
#

I expect voice in bots to become privileged intent before long

slate swan
#

It's not in intent

#

it's from youtube

#

Using their music illegally

rare edge
#

I’m talking ability for bots to use voice

hasty iron
#

and its not related to the main gateway websocket

slate swan
#

^

rare edge
#

Like it will be privileged action

reef dock
#

yall play fortnite right?
if i had downloaded a full radio track and implemented a command to play that track on a vc would i be at risk or is that different

hasty iron
#

lol imagine using any other app other than osu for music

#

2 in 1, spotify premium and a game

reef dock
slate swan
#

osu for music?

#

oh

reef dock
#

why would it be

slate swan
#

danny is resigning

#

wht

manic wing
#

it got archived

#

meaning no further work

reef dock
manic wing
#

ceasing all updates

slate swan
manic wing
#

however you can still fork and continue

reef dock
magic stump
#

I have a problem because how does each bot command used send a message that I am sending a message for player approval and how should I do it separately and the functions event or how?

slate swan
#

ye doubt people will do that

wicked atlas
#

Are there any β€œcomplete” alternatives to discord.py that anyone knows about?

pine lava
#

how would i add time to a timestamp, specifically hours
embed.timestamp = datetime.datetime.utcnow()+timedelta(hours=times)
im just not sure how to fix this

outer violet
#

What am I supposed to do when the only language I know is python and it’s written in discord.py

pine lava
#

python is the language

wicked atlas
#

Pretty much

outer violet
pine lava
#

the rewrite of it was, you are always able to fork the git and add on to the lib if you really wanted to

wicked atlas
#

Possibly. But this will definitely encourage most people to try and write their own wrappers to replace it, so we might see some of that.

rare edge
wicked atlas
#

Yeah, no. Half the time my bots are for logging and moderation.

rare edge
#

like submitting the JSON? Yes

rare edge
#
import os
import json

import requests

app_id = os.getenv('app_id')
url = f"https://discord.com/api/v8/applications/{app_id}/commands"
jsonpath = os.path.abspath("command.json")
with open(jsonpath, "r") as json_file:
    data = json.load(json_file)
header = {
    "Authorization": f"Bot {os.getenv('bot_token')}" 
}
r = requests.put(url, headers=header, json=data)
print(r)```
#

and my command.json has all my commands

#

Very basic one?

#
[
    {
        "name": "dice",
        "description": "Roll a D6 Dice"
    },
    {
        "name": "update",
        "description": "Updates Discord ID with proper roles as determined by database",
        "options": [
            {
                "name": "userid",
                "description": "Discord ID of user to update, leave blank for self",
                "type": 3
            }
        ]
    }
]```
#

this is for registering commands

#

HTTP Slash Commands have some more setup

#

I'd spend time with documentation

stoic whale
#

how can I make a button usable many times?

pliant gulch
#

Like how discord.py adds callbacks to a command you have to do that with your slash command. I would just listen to the interaction_create event and run the callback of whichever command was ran which you can get via finding the name in some sort of dict

rare edge
#

I was talking HTTP Interactions where Discord calls your webserver to tell you got a command

slate swan
pliant gulch
#
my_commands {"command_name" command_callback}

#on interaction create check if slash command
my_command[name](. . .)
rare edge
outer violet
#

Does hikari work?

outer violet
#

Like is that an alternative

rare edge
pliant gulch
#

No in the round brackets you add the args of the command callback

#

Which you need to parse from the interaction_create event's data

slate swan
#

i think im switching so js

rare edge
outer violet
slate swan
pliant gulch
#

If you want I can give you the repo link to my old slash wrapper built on corded (since its low level) but its essentially the same other then how you receive the interaction

rare edge
pliant gulch
slate swan
rare edge
pliant gulch
rare edge
outer violet
#

Idk if I should just switch to js now

pliant gulch
rare edge
#

Interactions are passed via gateway, Discord supports that but Danny is right, "This isn't path of discord design"

#

To me, the message content privileged intent signals the end of the creative freedom and grassroots hacking us library developers all believed in. The control is now inverted and things are being built around Discord's limitations. No longer will bots thrive with a sandbox limited only by your imagination, but instead Discord is now the sole gatekeeper of approved use cases. The future of Discord bots relies solely on the interaction system; things have to be explicitly written and supported by Discord employees, with creative solutions being put aside. I wouldn't be surprised if in the future, the entire gateway API becomes restricted and deprecated, with the only recommended way remaining to create a bot being entirely interaction or HTTP based. I have no real hope for the future of Discord bots.

pliant gulch
#

I'm so confused as to what you're trying to tell me

slate swan
#

just started learning d.py 1 month ago bro

#

got into coding 1 month ago too

rare edge
#

corded/discord.py use WebSocket, Flask/FastAPI/Django (if you must) for interactions is what Discord wnats

#

so Discord makes HTTP call to webserver, you process it and send response back to Discord

pliant gulch
#

Yea, I've already played around with webservers and interactions

#

It won't be hard to add that to what I am doing

indigo trout
#

Hey, I have a problem where sometimes my command to edit channels just doesn't change anything, I already figured out that the problem is:

await channel_name.edit(name=name)

the code just gets stuck there without an error.

channel_name is:

channel_name = ctx.message.author.voice.channel

and name is getting defined by the author of the message.
What could be the problem here? Since it works again if I go into another channel.

rare saddle
#

Please tell me what to do with it?

coral flame
#

atleast, i think thats the error

rare saddle
tough isle
twilit tusk
#

How can I lock a command to a specified channel?

zinc reef
#

If your bot is in less than 75 guilds you can still use the commands extension, as you will still get the message content

#

If your question isn't about the command extension breaking eventually, then it's up to you πŸ˜›

sharp stone
vale pendant
zinc reef
zinc reef
stoic whale
#

how can I make a button usable many times for different users? Pbs_Hmnm

slate swan
#
import discord
from discord import channel
from config import *
import asyncio
import discord

client = discord.Client()

@client.event
async def on_ready():
    print('We have logged in as {0.user}'.format(client))

@client.event
async def on_message(message):
    if message.author == client.user:
        return

async def reply(message):
    
    if message.content.startswith(prefix+'hello'):
        await message.channel.send('Hello!')

client.run(token)```why is reply not working ![PES_Think](https://cdn.discordapp.com/emojis/808622883847798804.webp?size=128 "PES_Think")
hasty iron
#

how do you expect it to work

slate swan
#

oh

hasty iron
#

also use the commands extension

#

for commands obv

slate swan
#

wait how

#

PES_Think how why where

sharp stone
#

@slate swan read about cogs too 🀝

slate swan
#

pip install discord.ext.commands

#

what are cogs ?

prisma wedge
#

Hey guys how would i create a help command like dank memer

hasty iron
#

it comes with discord.py, you don’t have to install anything

sharp stone
# slate swan what are cogs ?

In the documentation they are explained quite well, they basically serve to group commands in a single python class

slate swan
#

isnt it with python ?

#

i meant discord py

slate swan
#
import discord
from config import *
from discord.ext import commands ```importing discord twice ?
dapper cobalt
#

You're importing the discord package then a class from it.

sharp stone
#

You're not importing discord twice

slate swan
#

whats ctx ?

#

and whats *

dapper cobalt
unkempt canyonBOT
#
Not likely.

No documentation found for the requested symbol.

dapper cobalt
#

!d discord.ext.commands.Context

unkempt canyonBOT
#

class discord.ext.commands.Context(**attrs)```
Represents the context in which a command is being invoked under.

This class contains a lot of meta data to help you understand more about the invocation context. This class is not created manually and is instead passed around to commands as the first parameter.

This class implements the [`Messageable`](https://discordpy.readthedocs.io/en/stable/api.html#discord.abc.Messageable "discord.abc.Messageable") ABC.
valid niche
#

So you don’t have to write discord.ext.commands but just commands

slate swan
#

oh alright

#

i meant here py async def hello(self, ctx, *, member: discord.Member = None):

vast gale
#

well......

#

that's a bit harder to explain since discord.py abuses it πŸ˜›

sharp stone
vast gale
#

but that * is actually used in python to make the next parameter a keyword only, which means it must be passed as member=

slate swan
#

oh alright got it

vast gale
#

in discord py it makes it kinda greedy and not require to have "" around it if it contains spaces, also eats the rest of the message

sharp stone
sharp stone
slate swan
sharp stone
slate swan
#

which one exactly ?

sharp stone
#

And it will link you to ctx too so dw

compact harbor
high flame
#

yea

summer phoenix
high flame
#

unload_extension

slate swan
#

in cog
is this how i set the token ?

#

bot.token(token)

rancid mirage
#

what is from config import *

honest vessel
#

hi guys how i contact admins here?

rancid mirage
#

what does the import * mean

honest vessel
#

<@&831776746206265384>

rancid mirage
#

damn

visual yarrow
honest vessel
#

how?

visual yarrow
scarlet pond
#

does anybody know how to dm a person by ID? I have tried using the DMChannel library but it returns an error

honest vessel
#

i tried

#

this whati got in return

#

sorry try help

glacial sail
#

you also need to click the little green check mark emoji when you start the thread.

honest vessel
#

oh

#

i try agian

rancid mirage
#

wtf is import *

scarlet pond
#

does anybody know how to fix this

from discord import DMchannel
user = await client.fetch_user(<id>)
   await DMChannel.send(user, "test")
honest vessel
#

how many checkmarks i have to click?

#

@glacial sail

#

@visual yarrow

#

is checkmark == send this?

#

ok got chu

glacial sail
#

yeah, the checkmark is asking you to confirm before the thread gets created.

visual yarrow
# rancid mirage wtf is import *

Normally if you do py import x and you wanted to use y in the x module, you would refer to it as x.y. But if you do py from x import * you can refer to it as just y.

honest vessel
#

@visual yarrowdid i do correct now?

#

3 users in 2 days or so

visual yarrow
# rancid mirage wtf is import *

Although I only recommend you use from x import * if you're trying out code in the python shell. It's not great as you can't see what names it creates.

slate swan
#

rip

#

will my bot work?

#

now

honest vessel
#

just saw its from here

#

n it shocked me

slate swan
#

same

#
from config import *
from discord.ext import commands

bot = commands.Bot(command_prefix='$')

@bot.command()
async def test(ctx,args):
    await ctx.send(args)


bot.add_command(test)
bot.start(token)```
#

what did i do wrong

honest vessel
#

i see no import of discord tho

#

but... maybe u dont need

slate swan
#

he doesnt need it

#

still wrong

from config import *
import discord
from discord.ext import commands

bot = commands.Bot(command_prefix='$')

@bot.command()
async def test(ctx,args):
    await ctx.send(args)


bot.add_command(test)
bot.start(token)```
#

i didnt define the bot client ?

#

why are you calling add_command?

#

what will now happen when discord.py.will shut down or som will my bot still work?

#

idk thats what i found on the docs

#

.command() already does that

#

the decorator

#

oh alright

honest vessel
slate swan
#

its just manually registering it

#

new error

#

RuntimeWarning: Enable tracemalloc to get the object allocation traceback GWvertiPeepoSadMan

honest vessel
#

@mighty muralration should do the job

slate swan
#

and why are you using.start() instead of run()

honest vessel
#

^

#

there u have it

slate swan
#

that only if you want to uhh

#

i thought it was start

#

what was it i forgot lol

#

multi thread

honest vessel
#

start it for service

slate swan
serene frigate
#

intents.guild_messages and other intent attributes are telling me attribute guild_messages is read only and has no attribute guild_messages. This error only appeared recently, is there any way to fix this?

slate swan
#

are you mixing threading and asyncio?

#

lucid

honest vessel
#

.run(token) is the one

slate swan
#

thats the normal way of doing it

#

just use run() lucid

#

you are not providing the full traceback anyways so i cant really help any further

honest vessel
#

@visual yarrowty

final iron
#

Whats the effect of the situation with Danny leaving the discord.py library going to have on its use?

manic wing
#

it will slowly decrease, then in a year become forgotten unfortunately

#

in 9 months it will not be usable by verified bots

#

there has been a ceasement of changes

final iron
#

Has somebody created a fork yet?

manic wing
#

not sure

final iron
#

The library is still usable right now though right?

slate swan
manic wing
unkempt canyonBOT
#

Modern python code review tool / framework

manic wing
unkempt canyonBOT
hasty iron
#

it will remain in its current state until somebody becomes the maintainer of it

manic wing
#

no, someone will need to fork it and create a new name - its been archived and danny said no one wanted to take over

manic wing
#

why dont you πŸ€¦β€β™‚οΈ

#

lotd

#

lots of talented people will fork it

#

im placing my bets on EQEUNOS

#

hes gonna make the best fork

slate swan
manic wing
#

not shutting down, just no further progresss

full lily
manic wing
#

it wont effect you in the slightest

slate swan
#

im planning to use hikari or switch to js

hasty iron
slate swan
#

when i have no experience

hasty iron
#

there is not really a guide on "how to make discord.py", you can read source and docs

#

then gain experience, nobody’s stopping you

manic wing
#

blanket stop trying to make a 1 month python beginner make a full libary smh

full lily
#

^

#

hahaha

slate swan
#

fr

hasty iron
#

maybe if you didn’t start with discord.py as your first project, you could’ve done more

hasty iron
#

they asked "how can i make new d.py?"

slate swan
#

i didnt asked like that

vocal plover
#

eh, its good to do something you enjoy, that said you will not in a month of python be able to create a discord library, that much i am confident of

manic wing
#

he asked it rhetorically

#

he was like 'bruh, how can i make it if i have no experience'

hasty iron
#

ok dude

#

anyways they can always gain experience by doing other projects

#

i got into wrappers by learning how http requests work

manic wing
#

how bout you fork it

hasty iron
#

discord bots aren’t the only thing you can do with python

manic wing
#

but im still on team EQEUNOS

hasty iron
#

i have another project i am wokring on

hasty iron
#

working*

manic wing
#

which is?

hasty iron
#

an async web framework

manic wing
#

borring

hasty iron
#

yeah sure

#

as boring as making a wrapper

slate swan
#

doesnt matter

#

it will be nice to have dad who knows how to code lol

hasty iron
#

web dev is not that hard

#

basically anybody can get into it

slate swan
#

and how he even got that much eth to pay fees

reef dock
full lily
#

you're right. Google is my dad

fleet oracle
#

How would you do in the case of creating a command that calls the server icon and when it does not have it, it sends an error?

reef dock
full lily
unkempt canyonBOT
full lily
#

I don't really know what you're asking

manic wing
#

raise Y if not X else send Z

fleet oracle
fleet oracle
manic wing
#

oh you dont want to raise it?

slate swan
#

i made that nft lol

manic wing
#

why cant you just try/except/check

#

!ot

unkempt canyonBOT
fleet oracle
slate swan
manic wing
#

what the fuck is an nfts

full lily
#

non fungible token

manic wing
slate swan
#

like digital art

full lily
#

not necessarily art

slate swan
#

ahh the same but its easy to make pixelated whale

#

and how the f did he got money for gas fees

manic wing
# fleet oracle yes

simply put;

try:
  await ctx.send(ctx.guild.icon_url)
except:
  await ctx.send('No icon')```
fleet oracle
#

oh

#

let me try

hasty iron
#

you should except for the error you expect

manic wing
# hasty iron a bare except is a no no
  1. i dont know what it raises, i just said simply put 2) there are many things wrong with that (can just use a check) 3) i can leave an empty except because i have a thousand and one checks in my subclassed ctx.send
#

btw @fleet oracle when i sent

#

the icon_url in a server without an icon it didnt error

#

it just gave nonetype

#

in which case;

await ctx.send(ctx.guild.icon_url) if ctx.guild.icon_url else await ctx.send('none')```
or readable;
```py
icon = ctx.guild.icon_url
if icon:
  return await ctx.send(icon)
await ctx.send('No icon')```
fleet oracle
#

ohh

#

wait

pliant gulch
manic wing
#

oh

#

my bad

#

hello andy πŸ‘‹

fleet oracle
#
  File "C:\Users\ronal\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 125, in wrapped
    ret = await coro(*args, **kwargs)
  File "c:\Users\ronal\Desktop\Proyectos\tests\cogs\test.py", line 10, in icon
    icon = ctx.guild.icon.url
AttributeError: 'NoneType' object has no attribute 'url'

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

Traceback (most recent call last):
  File "C:\Users\ronal\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 960, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\ronal\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 825, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\ronal\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 134, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'url'```
fleet oracle
brittle ingot
#

icon_url

#

or are you using 2.0?

manic wing
#

hes 1.7

fleet oracle
brittle ingot
#

would be icon_url then ( i use 1.7.3 and its icon_url)

manic wing
#

print(dir(guild))

#

do that ^ to see what it is

fleet oracle
#

is that the problem is not that here, the code works when there is an icon on the server, but when there is none, it sends that error

brittle ingot
#

weird. never had that issue before πŸ€”

manic wing
#

if hasattr(guild, 'url')

fleet oracle
#

?

manic wing
#

just use try and except then lol

brittle ingot
#

just going to check something

#

!d discord.Guild.icon_url

unkempt canyonBOT
manic wing
manic wing
#

type pip show discord.py in the terminal

#

or print(discord.__version__)

#

whichever's easier

brittle ingot
#

yes im curious. that is a serious breaking change between some minimals πŸ˜‚

worn wigeon
#

say goodbye to discord.py

brittle ingot
#

It still works, just will need custom patches done by devs themselves, or 3rd party libs, until something breaking is added im pretty sure

vocal plover
#

Maybe I make a tutorial on how to make discord libraries 😳

worn wigeon
#

🧐

verbal fox
#

Well, on April 2022 it will be broken for sure

manic wing
#

ale, im sorry im on team eqeunos

worn wigeon
#

Slash commands...

verbal fox
#

Yep

worn wigeon
#

so i need to study discord.js

hasty iron
#

or make them on your own

hasty iron
#

unverified bots are unaffected

vocal plover
#

ngl, its super interesting to play with the discord api at a low level yourself, and if you have the knowledge i'd certainly say to take a shot at making a minimal wrapper, you'll learn a lot about the api

worn wigeon
#

🧐

astral fossil
#

Abandonedware

slate swan
#

can someone send me invite for d.js server?

vocal plover
worn wigeon
#

🧐

slate swan
#

thanks im switchingπŸ˜“

hasty iron
#

learn the language first

slate swan
#

i will

tame nymph
#

How to delete bot

slate swan
#

bro.

visual island
slate swan
#

rip dpy

gilded kite
rigid basin
tame nymph
#

Or maybe I can make a team and move the application in there then delete the team?

merry harbor
tame nymph
#

Actually I don’t think u can move applications

slate swan
merry harbor
#

actually I may be confused with another one, lemme check

#

nope nvm was that one

#

Its an amazing extension lib, and now has the chance to become the main lib risitas

slate swan
#

Well danny rejected them.

I think...

prisma wedge
#
@client.command()
@commands.has_permissions(kick_members=True)
async def unmute(ctx, member: discord.Member, *, reason=None):
    muteRole = discord.utils.get(ctx.guild.roles, name="Muted")
    
    if member == ctx.author:
        await ctx.send("You can't unmute yourself!")
    else:
        embed = discord.Embed(colour=0xFF0000)

        embed.set_author(name=f'User Unmuted | {member}', icon_url=member.avatar_url)

        embed.add_field(name='User', value=f'{member.mention}', inline=True)

        embed.add_field(name='Moderator', value=f'{ctx.author.mention}', inline=True)

        embed.add_field(name='Reason', value=f'{reason}', inline=True)

        embed2 = discord.Embed(description=f'You were unmuted in {ctx.guild.name}', colour=0xFF0000)

        embed2.add_field(name='Reason', value=f'{reason}', inline=True)

        embed2.add_field(name='Moderator', value=f'{ctx.author.name}', inline=True)
        
        await member.remove_roles(muteRole, reason=reason)
        await ctx.send(embed=embed)  
        await member.send(embed=embed2)  ```
#

how do i make it so, someone who doesnt have kick_members gets a mssg saying "you can use this command" or something

prisma wedge
#

wdym

unborn kayak
#

Damn this is so sad

worn wigeon
#

qwq

worn wigeon
summer python
worn wigeon
#
if ctx.message.author.guild_permissions.administrator:
summer python
#

tho i don't think people use javacord too often

gilded kite
#

This channel is not only for dpy ( channel is still remain active tho )

slate swan
#
@bot.command()
async def facts(ctx, * , args):
        url = 'https://api.popcat.xyz/facts?text='
        args.replace(' ', '+')
        url += args
        await ctx.send(url)```
#

why

jade jolt
#

http encode it

slate swan
#

wdym ?

jade jolt
#

a space would be %20

#

theres a module for this im sure

slate swan
#

i'm taking the string from a user

jade jolt
#

yes?

slate swan
#

oh alright just had to let you know

jade jolt
#

also

#

reassign args

slate swan
#

like this ?py args.replace('%20', '+')

jade jolt
#

you replace it but dont assign the replaced version

#

try keep it as you have it

slate swan
#

like this

#
async def facts(ctx , *, args):
        url = 'https://api.popcat.xyz/facts?text='
        x = args
        x = x.replace('%20', '+')
        url += x
        await ctx.send(url)```
jade jolt
#

args = args.replace(' ', '+')

jade jolt
#

wait

slate swan
#
  • is a space for the api
#

pepe_shrug ifaik

#

https://api.popcat.xyz/facts?text=you're+cool

jade jolt
#
@bot.command()
async def facts(ctx, * , args):
        url = 'https://api.popcat.xyz/facts?text={}'
        args = args.replace(' ', '+')
        url = url.format(args)
        await ctx.send(url)
slate swan
#

format ?

jade jolt
#

yes

slate swan
jade jolt
#

replaces {} with the arg