#discord-bots

1 messages Β· Page 201 of 1

tribal wren
#

no stop i made over 1k keys no stop

#

i spammed it to much it sends over 25 images a min

#

been running since he helped

#

no restarts nothing

#

2 hours then

smoky sinew
#

stop as in pause

#

your bot won't even respond to any commands while that request is happening

slate swan
#

Hey, im having trouble accessing and api endpoint and i really need help, its urbandictonary API. ```py
@commands.command(
name = "urban",
description = "Gets the definition of a word/slang from Urban Dictionary",
aliases = ["urbandictionary", "urbandict"],
usage = "Syntax: ,urban <message>\nExample: ,urban skidding",
arguments = "message"
)
async def urban(self, ctx, *, word=None):
if word is None:
await ctx.invoke(self.bot.get_command("help urban"))
try:
async with ctx.typing():
async with aiohttp.ClientSession() as cs:
async with cs.get(f"https://api.urbandictionary.com/v0/define?term={word}") as x:
f = await x.json()
for i in range(len(f['list'])):
try:
embeds = []
embeds.append(
discord.Embed(
title = f"{x['list'][int(i)]['word']}",
description = f"{x['list'][int(i)]['definition']}",
color = utils.color
).add_field(
name = "Examples",
value = f"{x['list'][int(i)]['example']}",
inline = False
).set_footer(
text = f"πŸ‘ {x['list'][int(i)]['thumbs_up']} - πŸ‘Ž {x['list'][int(i)]['thumbs_down']}"
).set_author(
name = ctx.author,
icon_url = ctx.author.display_avatar.url
)
)
except Exception as e:
pass
print(e)
paginator = pg.Paginator(self.bot, embeds, ctx, invoker=ctx.author.id)
paginator.add_button('first', style=discord.ButtonStyle.gray, emoji=':skip:')
paginator.add_button('prev', style=discord.ButtonStyle.gray, emoji=':left:')
paginator.add_button('next', style=discord.ButtonStyle.gray, emoji=':right:')
paginator.add_button('last', style=discord.ButtonStyle.gray, emoji=':skip2: >')
paginator.add_button('delete', style=discord.ButtonStyle.danger, emoji=":cancel:")
await paginator.start()
except:
pass

tribal wren
smoky sinew
#

i mean i can help but you're not listening

tribal wren
#

i got my help and its been spammed by over 1k people and No pause / crash / stop

smoky sinew
#

sure

tribal wren
smoky sinew
#

i didn't say i doubted you

slate swan
smoky sinew
tribal wren
#

u said "sure" which people use as example
ME : i just got 150 kills in fortnite in 1 game
friend : Sure
u cant get 150 kills in fortnite in 1 game

slate swan
smoky sinew
sick birch
#

my face when i enter this channel

tribal wren
#

lol

#

ima go work on my bot

smoky sinew
#
class DiscordBot(commands.Bot):
    def __init__(self, *args, **kwargs):
        super().__init__()
        # add anything else here
    
    async def setup_hook(self):
        self.client_session = await aiohttp.ClientSession()
    
    async def close(self):
        await self.client_session.close()
        await super().close()

bot = DiscordBot(...)
#

@slate swan

slate swan
#

interesting, ill def try that thanks πŸ™‚

#

anyone able to help or point me in the right direction?

smoky sinew
#

if you ask your question maybe

#

how would we know though

slate swan
#

I posted it already

#

from here

#

didn't want to spam

smoky sinew
#

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

smoky sinew
#

yeah

slate swan
#

I know to paste it here, just wasn't sure if it was ok too

tribal wren
#

1.02 23:36:38 [Bot] Ignoring exception in command verify:
21.02 23:36:38 [Bot] Traceback (most recent call last):
21.02 23:36:38 [Bot] File "/.local/lib/python3.9/site-packages/discord/commands/core.py", line 124, in wrapped
21.02 23:36:38 [Bot] ret = await coro(arg)
21.02 23:36:38 [Bot] File "/.local/lib/python3.9/site-packages/discord/commands/core.py", line 982, in _invoke
21.02 23:36:38 [Bot] await self.callback(ctx, **kwargs)
21.02 23:36:38 [Bot] File "/bot.py", line 67, in verify
21.02 23:36:38 [Bot] await message.add_reaction(emoji)
21.02 23:36:38 [Bot] AttributeError: 'Interaction' object has no attribute 'add_reaction'
21.02 23:36:38 [Bot] The above exception was the direct cause of the following exception:
21.02 23:36:38 [Bot] Traceback (most recent call last):
21.02 23:36:38 [Bot] File "/.local/lib/python3.9/site-packages/discord/bot.py", line 1114, in invoke_application_command
21.02 23:36:38 [Bot] await ctx.command.invoke(ctx)
21.02 23:36:38 [Bot] File "/.local/lib/python3.9/site-packages/discord/commands/core.py", line 375, in invoke
21.02 23:36:38 [Bot] await injected(ctx)
21.02 23:36:38 [Bot] File "/.local/lib/python3.9/site-packages/discord/commands/core.py", line 132, in wrapped
21.02 23:36:38 [Bot] raise ApplicationCommandInvokeError(exc) from exc
21.02 23:36:38 [Bot] discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'Interaction' object has no attribute 'add_reaction'
#

can anyone help?

smoky sinew
tribal wren
#

yes

smoky sinew
#

are you using pycord?

tribal wren
#

yes

smoky sinew
#

look at what ctx.respond returns

#

interaction, and interaction has an attribute named original_message

tribal wren
#

ok

smoky sinew
#

or original_response is probably what you want

tribal wren
#
@bot.slash_command(description="Verify command")
async def verify(ctx):
    member = ctx.author
    number = random.randint(1, 5)
    embed = discord.Embed(title=f"Verification - Pick the number {number}", color=0x00ff00)
    embed.add_field(name="You have 3 tries to pick the correct number!", value="React with the corresponding emoji to pick your number.", inline=False)
    message = await ctx.respond(embed=embed)

    # Add reactions to the original message
    for emoji in ['1️⃣', '2️⃣', '3️⃣', '4️⃣', '5️⃣']:
        await message.add_reaction(emoji)

    def check(reaction, user):
        return user == member and str(reaction.emoji) in ['1️⃣', '2️⃣', '3️⃣', '4️⃣', '5️⃣'] and reaction.message.id == message.id

this what makes no since

#

sense *

#

that should work right? @smoky sinew

#

looks like what it should

smoky sinew
#

ctx.respond doesn't return message, it returns interaction like i said

#

you are confusing yourself

tribal wren
#

oh

tribal wren
smoky sinew
#
interaction = await ctx.respond(embed=embed)
message = await interaction.original_response()
tribal wren
#

ok

#

@smoky sinew nm i was a dumbass again

#

i had
@bot.slash_command(description="Verify command")
@bot.slash_command(description="Verify command")
not
@bot.slash_command(description="Verify command")

smoky sinew
#

ok

ionic garden
#

is there a text input ui component?
context: pagination in embeds

sick birch
ionic garden
sick birch
#

No

#

We're not at that level of interactivity yet πŸ˜›

#

Though it would be cool to see

austere vale
#
  #dm user
  @nextcord.slash_command(description="DMs a user a message from Runa.")
  @application_checks.has_permissions(administrator=True)
  async def dm(self, interaction, user:nextcord.Member, *,message, attachment:nextcord.Attachment=None):
    try:     
      await user.send(f'You have received a message from {interaction.guild.name}: \n{message}')
      await interaction.send(f"I have sent {user.mention} the message: {message}")
      if attachment:
        await user.send(attachment)
    except Exception:
      await interaction.send(f"Failed to DM {user.mention}.")

im trying to use this slash command to send images and it works. but does anyone know how to modify it so i can send multiple attachments at once?

smoky sinew
#

i don't think you can have a list of parameters with slash commands

austere vale
#

a okay

#

thank u

polar ice
#

Hey sorry if its wrong channel, but any ideas why my files are showing up like this when downloading them via FTP

vale wing
#

How do you create these files

polar ice
#

Theyre downloaded from my server host for a game. never had this issue before @vale wing

#

If i open them in notepad theyre fine

shrewd apex
polar ice
#

@shrewd apex I tried, still nothing πŸ€”

shrewd apex
#

after installing restart py charm

#

also make sure to associate log files with their appropriate type when opening

shrewd apex
polar ice
#

updating pycharm now. ill give it a try

slate swan
#

you shouldnt update pycharm just delete it and use vscode

vale wing
#

😠

hushed galleon
#

it does look like there's real content in between all those null bytes, but i would suggest making another help post and including your current code

vale wing
slate swan
#

or allow both choices

austere vale
slate swan
#

it's not

austere vale
#

okay thank you, i think your message id suggestion is clever

polar ice
#

@vale wing encoding is ascii

vale wing
#

Then just change the encoding in pycharm

#

You are opening it with UTF-8

polar ice
#

just head into settings?

vale wing
#

Check out bottom right corner, you should be able to specify encoding there

polar ice
ocean dragon
#

Should I just raise an exception in is_staff check if it's false so that I can handle it in the error handler?

    def is_staff(interaction: discord.Interaction) -> bool:
        role = interaction.user.get_role(config.role.staff)
        return role is not None

    @app_commands.check(is_staff)
    @app_commands.command(name="ping", description="Ping Pong")
    async def ping(self, interaction: discord.Interaction) -> None:
        ...
#

since the error is discord.app_commands.errors.CheckFailure by default

polar ice
#

@vale wing awesome, fixed it πŸ™‚ utf-16le

ocean dragon
#

like this

def is_staff(interaction: discord.Interaction) -> bool:
    role = interaction.user.get_role(config.role.staff)
    if role is None:
        raise exceptions.InvalidPermissionsException()
    
    return True
ocean dragon
ocean dragon
#

like so

async def on_error(interaction: Interaction, error: app_commands.AppCommandError) -> None:
    if isinstance(error, exceptions.InvalidPermissionsException):
        return await interaction.response.send_message("Invalid permissions!", ephemeral=True)
slate swan
#

this is what my bot will be doing, just a basic rock paper scissor

slate swan
slate swan
slate swan
# slate swan Can u show code and error

I tried to run this

 
intents = discord.Intents.all()
client = discord.Client(command_prefix='!', intents=intents)
 
@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
 
    if message.content.startswith('hi'):
        await message.channel.send('Hello!')
 
client.run('<Your Bot Token>')```

but it says, ModuleNotFoundError: No module named 'discord'
naive briar
#

Install it 🀷

unkempt canyonBOT
slate swan
slate swan
#

Try again

#

I needed to update it!!

#

that's what it was...fff
my bad, thanks all

#

it's connected, but not pinging back

quick gust
#

discord.Intents.message_content = True

#

!intents

unkempt canyonBOT
#

Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. Various features of discord.py rely on having particular intents enabled, further detailed in its documentation. Since discord.py v2.0.0, it has become mandatory for developers to explicitly define the values of these intents in their code.

There are standard and privileged intents. To use privileged intents like Presences, Server Members, and Message Content, you have to first enable them in the Discord Developer Portal. In there, go to the Bot page of your application, scroll down to the Privileged Gateway Intents section, and enable the privileged intents that you need. Standard intents can be used without any changes in the developer portal.

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

from discord import Intents
from discord.ext import commands

# Enable all standard intents and message content
# (prefix commands generally require message content)
intents = Intents.default()
intents.message_content = True

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

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

slate swan
#
 
intents = discord.Intents.all()
client = discord.Client(command_prefix='!', intents=intents)
 
@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
 
    if message.content.startswith('hi'):
        await message.channel.send('Hello!')
 
client.run('<Your Bot Token>')```
This is my .env file
#

still not getting a response from my bot

#

Introduction Discord is a group-chat platform similar to Skype, TeamSpeak, or Slack that allows users to communicate simple text messages as well as rich messaging. In this tutorial, we will learn to create a Discord bot and add it to our channel. How we can send text, image, video, audio, files through the bot, and … Continue reading Create Dis...

vocal snow
vocal snow
#

and you're getting no errors?

slate swan
vocal snow
#

replit is not a good place to run your bot

slate swan
#

oh, where should I run it

vocal snow
#

while you're still developing it, it's easiest to run it on your own computer

#

once you feel like it's stable and ready for use, you can choose a proper hosting service

slate swan
#

I can run it on sublime or pycharm

shrewd fjord
#

PyCharm seems good

slate swan
#

nope, no response

#

and now it's saying no module named discord

shrewd fjord
slate swan
#

I already did

shrewd fjord
#

Use venv instead if u r on pycharm

slate swan
#

and updated it

shrewd fjord
#

Maybe cause of
on_message

slate swan
#

I already did

shrewd fjord
#

do
@bot.listen() instead of @bot.event

slate swan
#

so delete async def on_message(message):

#

and replace it with that?

slate swan
shrewd fjord
shrewd fjord
#

Did u make sure to enable all intents on dev portal?

slate swan
#

that has happened before

#

i have logged in before

#

but it still was not pinging

slate swan
#

I followed that guide

#

I did everything in that guide

shrewd fjord
#

Ugh

#

Lemme check the guide

slate swan
#

thank you

naive briar
#

Sounds like average discord bots tutorials

shrewd fjord
slate swan
shrewd fjord
#

Uh ok

#

Can u run it? And five a screenshot of the console?

#

Give*

slate swan
#

where would you like me to run it?

shrewd fjord
slate swan
naive briar
#

Great

shrewd fjord
slate swan
#

yes it works

#

but the bot does not ping

naive briar
#

Show the code and how you're sending the command

#

It doesn't work doesn't explain the problem

slate swan
#

import discord

intents = discord.Intents.all()
client = discord.Client(command_prefix='!', intents=intents)

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

@client.event
async def on_message(message):
print("message-->", message)

if message.author == client.user:
    return

if message.content.startswith('hi'):
    await message.channel.send('Hello!')

if message.content.startswith('image'):
    await message.channel.send(file=discord.File('download.jpg'))

if message.content.startswith('video'):
    await message.channel.send(file=discord.File('sample-mp4-file-small.mp4'))

if message.content.startswith('audio'):
    await message.channel.send(file=discord.File('file_example_MP3_700KB.mp3'))

if message.content.startswith('file'):
    await message.channel.send(file=discord.File('sample.pdf'))

client.run('my key')

slate swan
#

import discord

intents = discord.Intents.all()
client = discord.Client(command_prefix='!', intents=intents)

@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

if message.content.startswith('hi'):
    await message.channel.send('Hello!')

client.run('my key')

naive briar
#

And how did you send the command?

slate swan
shrewd fjord
naive briar
#

Same thing

slate swan
shrewd fjord
#

My bad

slate swan
#

why you making fun of me

shrewd fjord
#

:-:?

slate swan
#

I think the bot is offline

#

it's not showing up in my server

#

said it joined only

slate swan
#

how do I use aiohttp for my bot to check a specific channel for any message and if the message has a user id send that person a dm

slate swan
#

!d discord

unkempt canyonBOT
#

In order to work with the library and the Discord API in general, we must first create a Discord Bot account.

Creating a Bot account is a pretty straightforward process.

alpine cove
slate swan
#

some issues

maiden fable
#

what are the issues

#

I am sure u r gonna have more issues if u send raw requests ngl

alpine cove
#

sounds like someone tryna selfbot

slate swan
alpine cove
#

0-0

#

yk thats against the tos

slate swan
#

and its a long time ago anyways

#

I need help beacuse..... heres a story

alpine cove
maiden fable
#

lets skip that topic, shall we

slate swan
#

my bot very good bot is on discordbotlist site
when someone upvote my bot I need them to receive a dm saying thank you
the discordbotlist has a webhook which sends the person's user id in the channel
bot sees the channel user id and sends them a dm saying thank you
message content needed for this but discord says no no no
hence I have to use aiohttp for this purpose

slate swan
maiden fable
#

Can I get a link of the bot list please?

slate swan
maiden fable
#

Sure

slate swan
maiden fable
#

Nonono why being so difficult

#

Just setup a web server which will receive the webhook events, instead of sending the webhook messages to a channel

#

Just run a web server with yr bot. Use quart or smth idk

slate swan
#

can I do with that?

maiden fable
#

Sure

sick birch
#

Separate web app like Flask that POSTs to Discord with a thank you message

maiden fable
#

You can use aiohttp web for a simple web server, and send requests to Discord whenever your web servers receives an event

sick birch
#

Mmhm

#

Personally I'd go with an AWS lambda function

#

Since this is serverless

maiden fable
#

Idk anything about AWS, so don't expect anything from me

slate swan
maiden fable
#

No

#

You make a web server, and create an endpoint which will receive requests whenever the webhook is fired, that is, whenever a person votes. Then, you send a request to Discord via aiohttp

sick birch
#

Web server just listens for webhook

maiden fable
#

You should checkout how web server works and how to create one. It will be clearer that way

slate swan
#

hmmm alright i will take a look into that

#

thanks for the help

maiden fable
#

The idea behind the same is smth like this:

import flask
import requests

app = flask.App()


@app.route("/vote-webhook")
def vote(request):    # request parameter represents the payload send by the API
    payload = request.payload
    . . .     # access the payload dict and send the necesaary request to Discord with requests 
#

This is sync, but u can make it async with FastAPi

abstract moss
#

So, I install discord.py for create a bot, and sometimes the module isn't import in my new script. I went to see whatever in its folder and there are still the same as installed. I uninstalled and reinstall it for many times already, and then it works. Wow.

So, the next two days. It didn't work agian ;-;

shrewd apex
shrewd apex
slate swan
#

Does anyone have a tutorial on how to make cooldowns but it writes minutes and seconds and not 175.65 seconds

vital glacier
#

Did something change?

#

code:

banner = f"""
\u001b[37m  β–Œ ▐·      β–ͺ  Β·β–„β–„β–„β–„  
\u001b[37m β–ͺβ–ˆΒ·β–ˆβ–Œβ–ͺ     β–ˆβ–ˆ β–ˆβ–ˆβ–ͺ β–ˆβ–ˆ 
\u001b[37m β–β–ˆβ–β–ˆβ€’ β–„β–ˆβ–€β–„ β–β–ˆΒ·β–β–ˆΒ· β–β–ˆβ–Œ
\u001b[37m  β–ˆβ–ˆβ–ˆ β–β–ˆβ–Œ.β–β–Œβ–β–ˆβ–Œβ–ˆβ–ˆ. β–ˆβ–ˆ 
\u001b[37m . β–€   β–€β–ˆβ–„β–€β–ͺβ–€β–€β–€β–€β–€β–€β–€β–€β€’ 

\u001b[37m Logged in as: {bot.user} : {bot.user.id}
\u001b[37m Guilds: {len(bot.guilds)}
\u001b[37m Commands: {len(bot.commands)}
"""


@bot.event
async def on_ready():
    print(banner)
maiden fable
vital glacier
#

ah

naive umbra
#

@gusty flax

gusty flax
naive umbra
#

yes, give me a second ill gather some docs for you to go of

gusty flax
#

Im trying to do that

naive umbra
#

!d discord.Guild.create_text_channel

unkempt canyonBOT
#

await create_text_channel(name, *, reason=None, category=None, news=False, position=..., topic=..., slowmode_delay=..., nsfw=..., overwrites=..., default_auto_archive_duration=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Creates a [`TextChannel`](https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel "discord.TextChannel") for the guild.

Note that you must have [`manage_channels`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") to create the channel.

The `overwrites` parameter can be used to create a β€˜secret’ channel upon creation. This parameter expects a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.11)") of overwrites with the target (either a [`Member`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member "discord.Member") or a [`Role`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Role "discord.Role")) as the key and a [`PermissionOverwrite`](https://discordpy.readthedocs.io/en/latest/api.html#discord.PermissionOverwrite "discord.PermissionOverwrite") as the value.

Note

Creating a channel of a specified position will not update the position of other channels to follow suit. A follow-up call to [`edit()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel.edit "discord.TextChannel.edit") will be required to update the position of the channel in the channel list...
naive umbra
#

The overwrites parameter can be used to create a β€˜secret’ channel upon creation. This parameter expects a dict of overwrites with the target (either a Member or a Role) as the key and a PermissionOverwrite as the value.

gusty flax
#

what does the overwrite do tho. like how does it make it the secret channel only that user and staff can see?

naive umbra
#

lets say there is a claim ticket command like this:

@bot.command()
async def claim_ticket(ctx): pass

and assuming there is a category already set up with the correct permissions for the moderators/staff members that should be able to read and respond, then all you need to do is to sync the new channel with the category, which is done automatically when passing a category object to the category argument:

username = ctx.author.name.casefold()
# replace `0` with the category id
category = ctx.guild.get_channel(0) or await ctx.guild.fetch_channel(0)
channel = await ctx.guild.create_text_channel(
    name="ticket-{username}",
    category=category,
)

that will successfully create the channel that is in-sync with the category, but you also need to add the member to the channel, i actually forgot how to do it correctly and the docs confused me a lil bit, but you can do that with the discord.PermissionOverwrite object and passing it to create_text_channel but I figured you can try this instead:

permissions = discord.Permission()
permissions.send_messages = True
permissions.read_message_hisotry = True

overwrites = discord.PermissionsOverwrite.from_pair(permissions)
await channel.edit(overwrites={ctx.author.user:overwrites})

this should work but you can try

gusty flax
naive umbra
# gusty flax thank u so much. ye i got to it all except the last part. tysm πŸ™‚

i mean, the code is quite readable, you just create a permission object and allowing send_messages and read_message_history (i did a typo for "history" in the above code so correct that), then you just create an overwrite object that inherits from the permissions object, which then you create a mapping with the user and pass it as an argument to overwrites to the channel edit

naive umbra
#

i just dont know if thats the exact correct way of doing it, but as far as i understood from the docs is that should be correct

naive umbra
#

like modmail, but not in dms

sick birch
#

weeeeeeell

#

the discord API provides you with all channels

#

Even ones you don't have access to see

#

BUT is undocumented behavior and is TOS violating soooo

#

Take that how you will

naive umbra
sick birch
#

Nah

naive umbra
sick birch
#

But you can see the channels (which are often user IDs or user names)

#

Personally seems like a security flaw to me

slate swan
#

heyy, I need some help please

So I am trying to run this code but when i try running it and type the command I get the response that it worked, but when I look in the DB nothing was added

import discord
from discord import app_commands
from discord.ext import commands
import mysql.connector
from typing import Literal
from utils.functions import *
from utils.constants import *
from utils.embeds import *


    # Connect to the database
mydb = mysql.connector.connect(
            host="127.0.0.1",
            user="bam",
            password="bambam",
            database="one_piece"
        )
cursor = mydb.cursor()



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

    @app_commands.command(name="drop_shards", description="drop shards")
    @app_commands.describe(amount="the amount you want to drop", element="Which element do you want shards from?")
    async def drop_shards(self, interaction: discord.Interaction, amount: int, element: Literal['Fire', 'Water', 'Dark', 'Earth', 'Light', 'Lightning','Grass', 'Neutral']):
        if amount < 0:
            await interaction.response.send_message("Mehh provide a number over 0 smh")
            return
        else:
            element = element.lower()
            cursor.execute(f"UPDATE {element}_shards SET amount = amount +%s WHERE player_id =%s", (amount, interaction.user.id))
            mydb.commit()
            await interaction.response.send_message(f"Successfully added {amount} {element} Shards to your profile")



async def setup(bot: commands.Bot)-> None:
    await bot.add_cog(
        Drops(bot),
        guilds=[discord.Object(id=1052225383065456752)]
    )
#

Does anyone have a tutorial on how to make cooldowns but it writes minutes and seconds and not 175.65 seconds

naive umbra
# naive umbra lets say there is a claim ticket command like this: ```py @bot.command() async d...

yeah so the ```py
permissions = discord.Permission()
permissions.send_messages = True
permissions.read_message_hisotry = True

overwrites = discord.PermissionsOverwrite.from_pair(permissions)
await channel.edit(overwrites={ctx.author.user:overwrites})

should work correctly, but there is an easier way which is just:
```py
await channel.set_permissions(
    ctx.author, read_messages=True,
    send_messages=False
)

so you'd have this:

@bot.command()
async def claim_ticket(ctx):
    category_id = 0  # replace `0` with the category id
    category = ctx.guild.get_channel(category_id) or await ctx.guild.fetch_channel(category_id)

    channel = await ctx.guild.create_text_channel(
        name="ticket-{username}",
        category=category,
    )

    await channel.set_permissions(
        ctx.author,
        read_messages=True,
        send_messages=True
    )

tho i would recommend adding more checks like if the bot has the permission to create channels, etc...

naive umbra
naive umbra
#

a cooldown message?

#

in that case, this is also un-relevant to discord.py, create a post in #1035199133436354600 and ask about how you can convert seconds into minutes:seconds

slate swan
slate swan
#

why am i having this problem?
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.Roll' raised an error: SyntaxError: did you forget parentheses around the comprehension target? (Roll.py, line 181)

#

line 181 = line 36

forest oyster
#

does someone know how to make my bot send messages like this?:

austere vale
#

what does it mean when a guild becomes available/unavailable? like is it when a server gets deleted or something?

austere vale
forest oyster
#

Ok someone already told me

#

is with 'ephemeral=True'

austere vale
#

oki

forest oyster
#

thanks btw

austere vale
#

npp

slate swan
#

okay, first thing fixed

#

guys, how do i get the lenght of a list and store it into a variable?

velvet compass
#

your_variable = len(your_list)

austere vale
#

ah okay thank you

slate swan
velvet compass
#

Did you overwrite list somewhere

slate swan
#

start and end are assuciated with 2 lists

velvet compass
#

Do len(start), len(end)

slate swan
#

a question, is there a way of using try except and when except it returns null?

austere vale
#

ah okay thank you

#
  #emojis update
  @commands.Cog.listener()
  async def on_guild_emojis_update(self, guild:nextcord.Guild, before, after):
    embed=nextcord.Embed(color=0xfd9fa1, title='Emojis Updated',timestamp=datetime.datetime.utcnow(),description=f'Before: {before}\nAfter:{after}')
    await self.bot.get_channel(channelID).send(embed=embed)

can someone help me with this code? i want to show the emoji that got added/removed but im not sure how to pull up the specific emoji.
i cant do it as it is right now, because with several hundred emojis the embed wont send at all due to 6000 character limit

sick birch
graceful ermine
#

How could I detect bad words in a interaction command?

sick birch
#

Not sure if emoji objects are hashable

#

If so, you can set op them

slate swan
#

the bot had joined my server

#

it's just not online

austere vale
#

ah thank you robin, i’ll see if i can figure out how to make that algorithm

torn sail
spice zenith
#

does somebody knows how to add a cooldown to a command?

slate swan
#

Theoretically the answer to that question is no, but send the error because I'm sure it's not impossible to fix

slate swan
#

send the code please (you probably just called a variable before it was assigned)

limpid mirage
#

yes i can

#

i was gifted with the superpower of fixing only impossible to fix issues

slate swan
#

Truly wonderful

spice zenith
limpid mirage
#

this dont lok like all da code !!!

limpid mirage
#

do pastebin or something of that nature

slate swan
#

Where do you get that error because it works on my machine?

cloud dawn
#

Replace if message.author.id == bot.user: with if message.author.id == message.guild.me.id:

unkempt canyonBOT
#

property me```
Similar to [`Client.user`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.user "discord.Client.user") except an instance of [`Member`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Member "discord.Member"). This is essentially used to get the member version of yourself.
cloud dawn
#

Do you have a full error?

#

I don't really know what it means without it.

#

Yeah because you can't reference it that way... hmm

#

Brain is working for a quick fix.

#

Really quick would be global but I despise it.

desert badger
#

user = self.client.get_user(int(userid)) returns none why lol

cloud dawn
cloud dawn
slate swan
#

So I have my bot online and in my server, but it's not responding

import discord
from discord.ext import commands
import random

intents = discord.Intents.all()

client = commands.Bot(command_prefix='!', intents=intents)

@client.event
async def on_ready():
    print(f'Logged in as {client.user.name}')

@client.command()
async def play_rock_paper_scissors(ctx):
    player_choice = await client.wait_for('message', check=lambda message: message.author == ctx.author)
    options = ["Rock", "Paper", "Scissors"]
    computer_choice = random.choice(options)
    choices = {"player": player_choice.content, "computer": computer_choice}
    result = check_win(choices["player"], choices["computer"])
    await ctx.send(result)

def check_win(player, computer):
    if player == computer:
        return "It's a draw" 
    elif player == "Rock":
        if computer == "Scissors":
            return "You Rocked it's world!"
        else:
            return "Ohh yeah, nah, you lose..."
    elif player == "Paper":
        if computer == "Rock":
            return "You win! Paper covers Rock."
        else:
            return "Ohh yeah, nah, you lose..."
    elif player == "Scissors":
        if computer == "Paper":
            return "Cut in half! You win. Fatality."
        else: 
            return "Ohh yeah, nah, you lose..."

client.run('my token')```
I need to add a print statement above player_choice. Would it be a simple print("Please enter, Rock, Paper, Scissor") ?
spring verge
#

How to overcome the challenge of everyone role needing external emoji perm despite the bot having it

#

Like bot can't show external emojis if everyone role doesn't have them

vital glacier
#

Anyone in here who can help me proper setup my pool connection for postgresql & asyncpg using a setup_hook?

smoky sinew
#

and also why would you use a print statement in a discord bot? it will only be visible in your terminal

tribal wren
#

How does this look

#

i will change Verify Number in Failed

smoky sinew
tribal wren
smoky sinew
#

aiohttp?

tribal wren
#

kidna

smoky sinew
#

wdym kinda

tribal wren
#

/kaΙͺ.ndΙ™/ used in writing to represent an informal way of saying "kind of": I was kinda sorry to see him go.

smoky sinew
#

that doesn't explain anything

fading marlin
#

lmao what

tribal wren
#

rate the damn bot 0-10 for verify

smoky sinew
#

so 5

tribal wren
#

its a emoji

#

lol

smoky sinew
#

like 1️⃣?

tribal wren
#

yes

smoky sinew
#

you realize you can just get the name of the emoji lol

tribal wren
#

yes

smoky sinew
#

that's even worse

tribal wren
#

its custom

#

from my server

smoky sinew
#

you can still get the emoji name and map it to a number

fading marlin
tribal wren
#

i stole default emojis

smoky sinew
#

what's the point of that though

polar ice
#

Hey, i've created an embed with 2 buttons. i've then got a command which i type into a channel and it posts. it all works perfectly and i click the button and it works. but when i re-start my bot and go to click those same buttons i get interaction failed? any ideas why?

class ClaimWelcomePack(discord.ui.View):  # welcome pack to pack buttons
    @discord.ui.button(label="Register", style=discord.ButtonStyle.green)
    async def button_register(self, button, interaction):
        await interaction.response.send_message('welcome pack claimed')

using Pycoord

tribal wren
smoky sinew
# tribal wren

just generate an image containing the number text like an actual captcha which will prevent pretty much all spam

tribal wren
#

there are 3 steps

#

step 1
Simple Image
Step 2
"Captcha"
Step 3
custom captcha~~ -~~
Pattern

fading marlin
smoky sinew
#

ok

#

i'm guessing you're still using requests though

smoky sinew
#

explaining what you didn't explain anything

polar ice
#

@fading marlin So i have to make a command to call it? Is there an easier way to do this automatically some how?

smoky sinew
tribal wren
#

@smoky sinew i am mostly discord.js for bots not python

smoky sinew
tribal wren
#

wonder full auto images

smoky sinew
#

?

#

ok???

tribal wren
#

requests

#

lol

smoky sinew
#

yeah??

#

you are gonna shoot yourself in the foot with that but ok

slate swan
smoky sinew
#

is there any error?

tribal wren
slate swan
slate swan
tribal wren
#

its with print '

slate swan
smoky sinew
slate swan
fading marlin
#

add a print to your command...

smoky sinew
#

with a print statement or a debugger

tribal wren
smoky sinew
#

and is the bot logging in?

polar ice
fading marlin
#

yes

smoky sinew
#

that works

slate swan
#

miight be why

fading marlin
#

what's that supposed to mean? if you didn't have discord.py installed you would've gotten an error saying that the module could not be located

slate swan
#

this is everything I have installed

#

so does pycharm need to use a different interpreter other than python 3.10?

fading marlin
#

unless you want to use another one, no?

slate swan
#

because pycharm says no module called discord

#

yet it's installed

smoky sinew
#

it uses a virtual environment by default

slate swan
smoky sinew
#

you'll need to install discord.py through pycharm or switch the pycharm interpreter

clever lotus
#

so i need some help with the API portal

smoky sinew
slate swan
smoky sinew
#

what do you mean where? let me open pycharm

clever lotus
#

also im in python 3.11, how do i get discord.py in there?

#

i dont have anything installed, should i have anything installed

slate swan
smoky sinew
smoky sinew
#

you should get a search box when you press it twice, just tested it

smoky sinew
slate swan
#

where did you press shift twice

smoky sinew
#

no, when you're editing your code

clever lotus
clever lotus
smoky sinew
#

you're not on mac or linux though

slate swan
clever lotus
#

i tried pip before

#

it doesnt work either

smoky sinew
#

try python -m pip install discord.py then, if you don't have python installed get it from https://python.org and make sure to check "add to path" when installing it (don't install it from microsoft store)

clever lotus
#

also i thought you meant on windows its pip3

#

i have it installed

#

in fact its running right now

smoky sinew
#

ok

clever lotus
#

but it says it wasnt found

smoky sinew
#

then how did you run it

#

you mean pip wasn't found or python wasn't found?

#

if it's pip, did you do a custom installation when installing python?

slate swan
#

I get 2023-02-23 130815 ERROR discord.client Ignoring exception in on_ready

slate swan
smoky sinew
#

yeah but can you send the whole thing

slate swan
#
2023-02-23 13:08:12 INFO     discord.client logging in using static token
2023-02-23 13:08:13 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: 6ac361a3fd51af16a59821895df8907b).
2023-02-23 13:08:15 ERROR    discord.client Ignoring exception in on_ready
Traceback (most recent call last):
  File "C:\Users\rubyr\venv\lib\site-packages\discord\client.py", line 409, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\rubyr\PycharmProjects\pythonProject5\main.py", line 13, in on_ready
    guild = discord.utils.get(client.guilds, name=GUILD)
NameError: name 'GUILD' is not defined```
#

and the code?

smoky sinew
#

so you didn't send the whole code initially?

clever lotus
smoky sinew
#

what is GUILD?

smoky sinew
#

is it also pycharm?

slate swan
# smoky sinew so you didn't send the whole code initially?
import random
import discord


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

client = discord.Client(intents=intents)

@client.event
async def on_ready():
    guild = discord.utils.get(client.guilds, name=GUILD)
    print(
        f'{client.user} is connected to the following guild:\n'
        f'{guild.name}(id: {guild.id})'
    )

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

    if message.content == '!play_rock_paper_scissors':
        options = ['rock', 'paper', 'scissors']
        bot_choice = random.choice(options)
        await message.channel.send("Choose one: rock, paper, or scissors")

        def check(msg):
            return msg.author == message.author and \
                   msg.channel == message.channel and \
                   msg.content.lower() in options

        player_choice = (await client.wait_for('message', check=check)).content.lower()

        if player_choice == bot_choice:
            await message.channel.send(f'I chose {bot_choice}, so it\'s a tie!')
        elif player_choice == 'rock':
            if bot_choice == 'paper':
                await message.channel.send(f'I chose {bot_choice}, so you lose!')
            else:
                await message.channel.send(f'I chose {bot_choice}, so you win!')
        elif player_choice == 'paper':
            if bot_choice == 'scissors':
                await message.channel.send(f'I chose {bot_choice}, so you lose!')
            else:
                await message.channel.send(f'I chose {bot_choice}, so you win!')
        elif player_choice == 'scissors':
            if bot_choice == 'rock':
                await message.channel.send(f'I chose {bot_choice}, so you lose!')
            else:
                await message.channel.send(f'I chose {bot_choice}, so you win!')

client.run("my token")```
#

I'm sorry to spam

clever lotus
smoky sinew
clever lotus
#

i dunno what pycharm is i just took python from python.org and thats how i installed it

#

and how i run it

smoky sinew
# clever lotus installed right off of python.org

you have three options:

  • reinstall python from python.org and check "add to path" when installing
  • open windows' "edit system environment variables" page and add the python path to the PATH variable
  • type out the whole path when running python "C:\PythonPathHere\... -m pip install discord.py
#

by "python path" i mean the python exe file, to find it just press "open file location" when searching for python in the start menu

clever lotus
#

i have it in D:\ but yeah alr

slate swan
#

I have spent 3 days on this, I think I might come back to it in 6 months when I am better at coding

#

thanks for your help

smoky sinew
#

if it goes to a shortcut page, press open file location a second time on the shortcut

polar ice
smoky sinew
#

i'm guessing you need to set timeout = None in your view

#
class WelcomePackView(discord.ui.View):
    def __init__(self):
        super().__init__(timeout = None)
    ...
clever lotus
smoky sinew
#

not the folder

#

the exe file

clever lotus
#

oh

#

did i already do it

smoky sinew
polar ice
# smoky sinew not the folder

class ClaimWelcomePack(discord.ui.View):  # welcome pack to pack buttons
    def __init__(self):
        super().__init__(timeout=None)

    @discord.ui.button(label="Register", style=discord.ButtonStyle.green, custom_id='register')
    async def button_register(self, button, interaction):
        await interaction.response.send_message('welcome pack claimed')
        print('click')

I click it, nothing errors but still interaction failed 😦

smoky sinew
clever lotus
#

ok

#

well then how do i put in the code into the bot

smoky sinew
#

would you like an example with message commands or slash commands?

clever lotus
#

well like, i havethe code but I dunno how to make it go into the discord bot

#

the discord API portal confuses me

polar ice
clever lotus
#

but i would also like to see an example cuz some of this i got from realpython

smoky sinew
smoky sinew
#

once you've made one, go to the bot tab, press "add bot" and then copy your token

#

invite the bot in the "url generator" tab under oauth2, with the bot scope and optionally application.commands scope if you want slash commands

clever lotus
#

message commands btw, i made stuff with message commands

polar ice
smoky sinew
#
from discord.ext import commands
import discord

bot = commands.Bot(
    command_prefix = "!", # the bot prefix you want to use
    intents = discord.Intents.default() # what data you are subscribing to receive from discord
)

@bot.command()
async def hello(ctx):
    await ctx.reply(f"hello, {ctx.author.mention}")

bot.run("your bot token should go here")
clever lotus
#

ok

#

so instead of having it respond to a message, itll just be the prefix?

smoky sinew
#

yes

#

it will just be !hello

clever lotus
#

also what part of the code should that go

smoky sinew
#

that's all of the code

clever lotus
#

top?

#

i see, so could i add multiple commands and potentially minigames

smoky sinew
#

yeah

#

you can add onto that however you like

#

potentially copy and paste code from the realpython example too, but if it's using on_message commands, i recommend switching it over to the new message command system

clever lotus
#

yeah its using on_message

#

give me a second

smoky sinew
#

and then you can replace commands.Bot with DiscordBot, if you don't have your own bot class already

clever lotus
#

yeah its if message.content == 'what they would have to say'

smoky sinew
#

that's very old

clever lotus
#

so should i just

#

deplete of that stuff?

#

when i pasted it into python, half of it was like... errors but i dunno if that was just with discord or not

smoky sinew
#

you don't have to delete it, just switch it over because that way of making commands wasn't relevant since 2016

#

the command logic should mostly be the same, just the argument parts and the actual command parts are different

slate swan
clever lotus
#

should i still do the client-bot conversion

polar ice
smoky sinew
#

you should put it in your main file

polar ice
clever lotus
#

what is "#what data you are subscribing to recieve from discord"

smoky sinew
#

i don't know pycord, but i guess so @polar ice

smoky sinew
#

if you have a typing intent (which is automatically included in discord.Intents.default()), your bot will be notified when people start typing in a channel

#

there are also privileged intents, which if you're in over 100 servers you need to apply to subscribe to

clever lotus
#

so do i just put like

#

uhh

#

so do i want to put like messages or sumn?

smoky sinew
#

there are messages and message_content

#

message_content is privileged and not included in discord.Intents.default, which you need for making message commands

#

messages is not privileged however

clever lotus
#

ok so i put message_content

#

i just want it to reply something after someone says something with a command

#

so if they did QK randnumgame it would do a random number game for example

smoky sinew
#

i'm not sure if you need message content but it would be something like this:

from discord.ext import commands
import discord

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

bot = commands.Bot(
    command_prefix = "!", # the bot prefix you want to use
    intents = intents # what data you are subscribing to receive from discord
)

@bot.command()
async def hello(ctx):
    await ctx.reply(f"hello, {ctx.author.mention}")

bot.run("your bot token should go here")
clever lotus
#

right ok so how do i put it into the bot

smoky sinew
#

that is the bot though

#

it connects using the bot token, the bot token basically acts as a password

#

which is why i said to copy it

clever lotus
#

ahhhh, i see

#

i did copy it

vital glacier
#

Anyone in here who can help me proper setup my pool connection for postgresql & asyncpg using a setup_hook?

smoky sinew
#

paste it in where it says "your bot token should go here"

clever lotus
#

so basically, i put it into python?

smoky sinew
#

yes, but not the python window

#

you need a code editor, paste the code into it, and run it with python

clever lotus
#

so which should i download

smoky sinew
#

i recommend vscode, or pycharm if you'd like

#

rip atom :(

clever lotus
#

visual studio code

#

alright

smoky sinew
clever lotus
#

pygame is best for game making ?

smoky sinew
#

sure

#

i mean, python's not great for game making, but it's the most popular library

clever lotus
#

yea

#

so in VSC do i just open up python or whatever has to do with python and put the code in?

smoky sinew
#

vscode will just use the python that you already have

#

and it has a built-in run button

clever lotus
#

alr

#

one min

ionic garden
#

what would a good way of keeping the history of a bot's commands?
how i'm doing it rn is writing it to a text file

smoky sinew
#

like who is using them?

ionic garden
#

just a log of commands
person a used x command on timestamp

smoky sinew
#

app commands?

desert badger
#
            if not inter.author.guild_permissions.administrator:
                return await inter.response.send_message("You don't have Administrator Permissions!", ephemeral = True)
```  doesnt wrok dam ![sadge](https://cdn.discordapp.com/emojis/1065346859121516634.webp?size=128 "sadge")
#

oh it it maybe inter user

ionic garden
smoky sinew
#

try making a global check maybe

#

or using the on_command event

polar ice
#

Is anybody familiar with Pycoord?

#

im trying to make a button persistant. ive done everything which it says in the docs but still nothing

smoky sinew
#

try that in your main file, i'm not sure how you're making commands

polar ice
#

@smoky sinew py @bot.slash_command(name="server", description="Server status") async def server(ctx):

Im using slash commands

clever lotus
#

ok so i pasted the code into a VSC file

#

do i have to install the python thing that it prompts

smoky sinew
polar ice
smoky sinew
#

make sure you pressed ctrl + shift + p in vscode and typed in "select interpreter" and chose your python 3.11 @clever lotus

clever lotus
#

it keeps having an error

smoky sinew
#

what error?

clever lotus
#

when i install it

smoky sinew
polar ice
smoky sinew
#

alright

clever lotus
smoky sinew
#

what is the log?

polar ice
#

Tried import from discord.ext import commands
still the same 😦

clever lotus
#

should i paste the whole log

smoky sinew
#

!paste @clever lotus

unkempt canyonBOT
#

Pasting large amounts of code

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

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

clever lotus
smoky sinew
clever lotus
#

i have...

#

4.10 gb?

#

do i need to like

#

how do i make it install to my SD card

#

instead of windows

smoky sinew
#

you're installing python on an SD card?

smoky sinew
#

ctrl + shift + p doesn't?

clever lotus
clever lotus
smoky sinew
#

yeah, you need to install python extension first

smoky sinew
clever lotus
#

OK i downloaded manually so i can move it to my SD

clever lotus
smoky sinew
#

alright

tribal wren
#

can someone help

naive briar
#

Send the code

clever lotus
#

where do i move the vsix

smoky sinew
#

i don't really know

#

you could ask in #editors-ides, but that's why i didn't recommend installing it manually

clever lotus
#

otherwise it wouldve installed to C:\ and that barely has any space

#

well with the code in bot.py, will it work now?

#

@smoky sinew

#

also ok
so how do i get a valid URI?

smoky sinew
#

what do you mean?

clever lotus
#

LETS GOOO I GOT THE BOT INTO THE SERVER

#

but its offline

smoky sinew
#

yeah

smoky sinew
indigo fossil
#

hey, so I haven't been developing bots for like two years on the platform so I'm a bit outdated. so now that we have slash commands, does discord.py have the support?

clever lotus
smoky sinew
#

you don't need that

#

to get the bot online, you need to run the code

clever lotus
#

ahh ok i see

#

well where is the run button

smoky sinew
#

it might be with the python extension i don't know

#

it's in the top-right usually

clever lotus
#

do i need to debug

#

or can i just run

#

nvm i got python extension

#

oh i need to get the interpreter

#

ok i think i ran the code

smoky sinew
#

cool, is the bot online?

clever lotus
#

no

#

i have an interpreter

#

selected

smoky sinew
#

press the run button then

sick birch
#

Generally better to just invoke the interpreter directly than using the run button tbh

#

never trusted that thing

clever lotus
#

wdym invoke the interpreter

smoky sinew
#

you should still set up the vscode python extension, run button or not

#

it's very helpful

smoky sinew
#

there's a terminal tab at the bottom of vscode

clever lotus
#

i dont see

sick birch
#

Press CTRL + `

clever lotus
#

ok

sick birch
#

That's the key to the left of the 1 key

clever lotus
#

i figured that

#

ok and then after i got it open

smoky sinew
#

type in <python path> <code file path>

sick birch
#

py -3 <filename>.py

#

(assuming you're on windows)

smoky sinew
sick birch
#

i believe the python launcher is recommended on windows

clever lotus
#

its TRYING

#

to open from C:\

#

NOT D:\

#

*I INSTALLED IT TO D:*

smoky sinew
#

that's why i said to go to "edit system environment variables" and edit the PATH variable

clever lotus
#

can i change its default path or smth

#

oh ok mb

smoky sinew
#

yes, that's what the path variable means

#

you should see a python path in there so just replace it with the other one

clever lotus
#

OK so edit

vital glacier
#

Anyone in here who can help me proper setup my pool connection for postgresql & asyncpg using a setup_hook?

ionic garden
smoky sinew
#

like you normally would?

polar ice
#
async def process_log(log):
    print(log.name)
    if "chat_" in log.name:  # Process chat into the DB
        print(f'Processing chat for: {await get_guild()}')
        with open(log.name, 'r', encoding='utf-16le') as f:

expected str, bytes or os.PathLike object, not TextIOWrapper

I've also tried pointing it directly to the file path too but nothing

unkempt canyonBOT
#

Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.

A full traceback could look like:

Traceback (most recent call last):
  File "my_file.py", line 5, in <module>
    add_three("6")
  File "my_file.py", line 2, in add_three
    a = num + 3
        ~~~~^~~
TypeError: can only concatenate str (not "int") to str

If the traceback is long, use our pastebin.

smoky sinew
ionic garden
polar ice
ionic garden
#

in a text file, db, or something else?

smoky sinew
#

databases are good if you need to retrieve the info

ionic garden
#

doesn't logging only produce some console output

smoky sinew
#

no

#

you can configure it to go to a text file

ionic garden
slate swan
stoic apex
#

how to detect if slash command is used

smoky sinew
#

so you should be good

sullen roost
#

hey can anyone help because like when am using a slash command to send embed and i cant send 2 embeds in 2 seprate if statements

#

idk why

naive briar
#

Send the code

slate swan
#

simple question, can a bot send audio files like sfx the user can play/download directly in the client? if yes, do they need to be in a specific format?

sullen roost
sullen roost
# naive briar Send the code
links = ["https://krakenfiles.com/view/PJvleyychY/file.html", "https://krakenfiles.com/view/k4cP4thaqE/file.html"]
    
@bot.slash_command()
@commands.is_owner()
async def send_leak_of(interaction: discord.Interaction,song_name: str):
    if song_name == "test" or "Test":
         embed2 = discord.Embed()
         embed2.add_field(name="HERE IS YOUR FILE", value=f"[Example 1]({links[1]})")
         embed2.set_thumbnail(url="https://images-ext-1.discordapp.net/external/5VmU7_EPijZkRIQ1hLuGbdK-OI4NjW15vr_ybeSsddc/https/cdn.discordapp.com/avatars/920827061516505139/a_728cd43fdf2c353c6bb1bb7451d8a5af.gif")
         await interaction.response.send_message(embed=embed2)
    elif song_name == "test2" or "Test2":
         embed = discord.Embed()
         embed.add_field(name="HERE IS YOUR FILE", value=f"[example 2]({links[0]})")
         embed.set_thumbnail(url="https://media.discordapp.net/attachments/1070602145436545024/1076001220604469278/99f29b75491cac917b21cd5c212be17f.jpg?width=401&height=502")
         await interaction.response.send_message(embed=embed)
    else:
        await interaction.response.send_message("We have only 2 files rn, The owner is updation this command and soon there will be more leaked files:)")
#

here

unkempt canyonBOT
#

When checking if something is equal to one thing or another, you might think that this is possible:

# Incorrect...
if favorite_fruit == 'grapefruit' or 'lemon':
    print("That's a weird favorite fruit to have.")

While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.

So, if you want to check if something is equal to one thing or another, there are two common ways:

# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
    print("That's a weird favorite fruit to have.")

# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
    print("That's a weird favorite fruit to have.")
sullen roost
naive briar
#

That's the idea of if-elif-else-statements

stoic apex
#

how to detect if slash command is used

sullen roost
#

ok thanks it got fixes

#

fixed

shell wing
shrewd fjord
#

Or just use the slash command invoke event

shrewd fjord
#

!d discord.Member.edit as far as i know there is a nick kwarg

unkempt canyonBOT
#

await edit(*, nick=..., mute=..., deafen=..., suppress=..., roles=..., voice_channel=..., timed_out_until=..., bypass_verification=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Edits the member’s data.

Depending on the parameter passed, this requires different permissions listed below...
shrewd fjord
#

Here ^^^

#

You should use guild.get_member instead

#

!d discord.Guild.get_member

unkempt canyonBOT
#

get_member(user_id, /)```
Returns a member with the given ID.

Changed in version 2.0: `user_id` parameter is now positional-only.
shrewd fjord
#

The way u r using will return User obj and if u use guild.get_member will return member obj

#

Check up.
Use guild.get_member instead.

slate swan
#

ah worked, thanks πŸ™‚

shrewd fjord
#

:-:

sullen roost
#

How do I make the bot react to its own message using slash command?

spice zenith
#

Can someone teach me how coolsowns work on a bot?

shell wing
# spice zenith Can someone teach me how coolsowns work on a bot?
@bot.command()
@commands.cooldown(1, 10, commands.BucketType.user) # 1 use per 10s
async def ping(ctx):
    await ctx.send("pong!")

@ping.error
async def ping_error( ctx, error):
  if isinstance(error, commands.CommandOnCooldown):
    await ctx.send("You are on cooldown!")
```smh like this
slate swan
#

!d discord.ext.commands.cooldown

unkempt canyonBOT
#

@discord.ext.commands.cooldown(rate, per, type=discord.ext.commands.BucketType.default)```
A decorator that adds a cooldown to a [`Command`](https://discordpy.readthedocs.io/en/latest/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/latest/ext/commands/api.html#discord.ext.commands.BucketType "discord.ext.commands.BucketType").

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

A command can only have a single cooldown.
shell wing
#

!d discord.Message.add_reaction

unkempt canyonBOT
#

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

Adds a reaction to the message.

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

You must have [`read_message_history`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") to do this. If nobody else has reacted to the message using this emoji, [`add_reactions`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.add_reactions "discord.Permissions.add_reactions") is required.

Changed in version 2.0: `emoji` parameter is now positional-only.

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

and why im eepy πŸ˜‚

spice zenith
#

Tho I'm using bot.tree.command()

#

Maybe that is why^^"

slate swan
unkempt canyonBOT
spice zenith
#

So I have to make a class?

slate swan
#
 @app_commands.command(name="drop_shards", description="drop shards")
    @app_commands.Cooldown(1,10)
    @app_commands.describe(amount="the amount you want to drop", element="Which element do you want shards from?")
    async def drop_shards(self, interaction: discord.Interaction, amount: int, element: Literal['Fire', 'Water', 'Dark', 'Earth', 'Light', 'Lightning','Grass', 'Neutral']):
        if amount < 0:
            await interaction.response.send_message("Mehh provide a number over 0 smh")
            return
        else:
            element = element.lower()
            cursor.execute(f"UPDATE {element}_shards SET amount = amount +%s WHERE player_id =%s", (amount, interaction.user.id))
            mydb.commit()
            await interaction.response.send_message(f"Successfully added {amount} {element} Shards to your profile")```
spice zenith
spice zenith
#

And describe it is not mandatory

#

Right?

naive briar
slate swan
#

sorry

slate swan
jaunty parrot
#

is there a way to retrieve all autocompleted choices that a discord command has?

#
async def channel_autocomplete(interaction: discord.Interaction, channel_id):
    completions = {channels.name:channels.id for channels in interaction.guild.voice_channels}

    return [discord.app_commands.Choice(name=channel,value=str(channelID)) for channel,channelID in completions.items()]

@bot.tree.command()
@discord.app_commands.autocomplete(channel_id=channel_autocomplete)
async def tagchannel(interaction: discord.Interaction, channel_id: str):

      #How could I get the returned list of choices?
sullen roost
#

how do i get images or pfps using an api of website
like it would send random images or the only images which it needs to send only?
with a command

spice zenith
spice zenith
#

@app_commands.cooldown(1, 3600, commands.BucketType.user)

slate swan
spice zenith
slate swan
#

I tried it and it didnt, I think you should read it in the docs

shrewd fjord
spice zenith
#
@bot.tree.command(name="work",description="Earn money to upgrade your "
                                          "hissatsus")

@cooldown(1, 3600, commands.BucketType.user)

async def work(interaction: discord.Interaction):
    random_number = random.randint(1, 100)
    d2=conn.cursor()

    member_id=interaction.user.id
    d2.execute("""
        UPDATE game
        SET money = money + ?
        WHERE member_id = ?
        """, (random_number, member_id))


    conn.commit()
    await interaction.response.send_message(f"You have added {random_number} $ to "
                                            f"your "
                                            "profile")```
#

this is ma code but it doesnt work^^'

shrewd fjord
#

!d discord.app_commands.checks.cooldown

unkempt canyonBOT
#

@discord.app_commands.checks.cooldown(rate, per, *, key=...)```
A decorator that adds a cooldown to a command.

A cooldown allows a command to only be used a specific amount of times in a specific time frame. These cooldowns are based off of the `key` function provided. If a `key` is not provided then it defaults to a user-level cooldown. The `key` function must take a single parameter, the [`discord.Interaction`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.Interaction "discord.Interaction") and return a value that is used as a key to the internal cooldown mapping.

The `key` function can optionally be a coroutine.

If a cooldown is triggered, then [`CommandOnCooldown`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.app_commands.CommandOnCooldown "discord.app_commands.CommandOnCooldown") is raised to the error handlers.

Examples

Setting a one per 5 seconds per member cooldown on a command:
shrewd fjord
#

@spice zenith

spice zenith
shrewd fjord
#

@bot.tree.command()
@app_commands.checks.cooldown(....)

spice zenith
#
@tree.command()
@app_commands.checks.cooldown(1, 5.0, key=lambda i: (i.guild_id, i.user.id))``` what does the key does?
#

and the i too

#

i know what rate and per does but not the rest

#

like key is for the type if cooldown

#

but what is lambda cooldown

shrewd fjord
unkempt canyonBOT
spice zenith
#

ah yeah i saw that before

shrewd fjord
#

It's like
if u wanna put
Guild cooldown
Then BucketType.guild

spice zenith
#

i wanna put it so a user can only use it once an hour so i thought it was just 1,3600

shrewd fjord
#

It will make something like after someone invoke the command, then no other in the guild can use it till cooldown finishes

#

There is couple of them

#

guild
user
member
channel

#

You should use member

spice zenith
#

i want user not guild tho

#

so instead of guild i put member right?

shrewd fjord
#

If u use user, if the user trying this on other guild, he will be still in cooldown

#

While member cooldown is for guild only

shrewd fjord
spice zenith
#

hmmm but i want so that u can only once regardless of the srvr every each hour

shrewd fjord
unkempt canyonBOT
#

@shrewd fjord :white_check_mark: Your 3.11 eval job has completed with return code 0.

2
shrewd fjord
#

Uh

spice zenith
#

hmmmm

#

whats happening xD

shrewd fjord
#

!e
def y(x):
print(x+1)
y(1)

unkempt canyonBOT
#

@shrewd fjord :white_check_mark: Your 3.11 eval job has completed with return code 0.

2
spice zenith
shrewd fjord
spice zenith
#

yeah

shrewd fjord
#

lambda is similar to function but easier

spice zenith
#

oh

#

ig this wont work right?

#
@bot.tree.command(name="work",description="Earn money to upgrade your "
                                          "hissatsus")

@tree.command()
@app_commands.checks.cooldown(1, 5.0, key=lambda i: (i.guild_id, i.user.id))

async def work(interaction: discord.Interaction):
    random_number = random.randint(1, 100)
    d2=conn.cursor()

    member_id=interaction.user.id
    d2.execute("""
        UPDATE game
        SET money = money + ?
        WHERE member_id = ?
        """, (random_number, member_id))


    conn.commit()
    await interaction.response.send_message(f"You have added {random_number} $ to "
                                            f"your "
                                            "profile")```
spice zenith
#

Traceback (most recent call last):
File "C:\Users\jaime\PycharmProjects\BOT\EX BOT\main.py", line 1616, in <module>
@tree.command()
NameError: name 'tree' is not defined

shrewd fjord
#

@bot.tree.command()

#

!d discord.app_commands.CommandTree

unkempt canyonBOT
#

class discord.app_commands.CommandTree(client, *, fallback_to_global=True)```
Represents a container that holds application command information.
shrewd fjord
#

if u just want to use tree:
tree=app_commands.CommandTree(bot)

#

Btw here i is
discord.Interaction obj xd

spice zenith
slate swan
#
@bot.command()
async def unban(ctx, member:nextcord.Member=None):
    if member == None:
        em1 = nextcord.Embed(title="__**Unban Error**__",description="Member not found! :x:", color=nextcord.Color.red())
        return await ctx.reply(embed=em1)
    if member.id == ctx.author.id:
        em2 = nextcord.Embed(title="__**Unban Error**__",description="You can't unban yourself! :x:", color=nextcord.Color.red())
        return await ctx.reply(embed=em2)
    def check_author(m):
        return m.author.id == member.id
    await member.unban(user=member, check=check_author)
    em5 = nextcord.Embed(title="Unban Success", description=f"{member.mention}({member.id}) Got unbanned!", color=nextcord.Color.green())
    await ctx.reply(embed=em5)    ```

and it says that member is not found
#

when putting the id

spice zenith
#

@shrewd fjord now it works but i would like to make so it prints that u are on cooldown with when u can do it again if u are on cooldown but i have no idea on how to do that ig it is an except Exception but more than that im lost

spice zenith
shrewd fjord
#

Idk what did i just type lmao

#

Wtf

#

Back after checking docs

#

You can use global cmd handler...
@bot.tree.error
async def on_app_command_error(interaction, error):
if isinstance(error, please check the docs but maybe app_commands.OnCooldownError):

await send(..)
#

Hm idk fr need to check docs

slate swan
#

is there a way to make ur bot delete buttons without deleting the message content/embed

#

Tab key shifts right in Python IDLE. What is the left swipe hotkey?

naive briar
#

!d discord.Message.edit

unkempt canyonBOT
#

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

Edits the message.

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

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

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

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

how do I use datetime to convert the bot creation time to the user's timezone.Like this: <t:1677157751:D>

slate swan
#

!d discord.utils.format_dt

unkempt canyonBOT
#

discord.utils.format_dt(dt, /, style=None)```
A helper function to format a [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.11)") for presentation within Discord.

This allows for a locale-independent way of presenting data using Discord specific Markdown...
slate swan
#

you can get bot's creation time using bot.user.created_at

unkempt mauve
slate swan
verbal hawk
#

hi, I'm having a problem with slash commands. I'm currently migrating from prefix commands to slash commands. I use discord.ext.commands.Bot with the decorator @app_commands.command. I have the following command to sync the slash commands:

@bot.command()
async def sync(ctx):
    await bot.tree.sync()

It runs without errors, but does nothing, the slash commands don't show up on Discord. Any tips?

verbal hawk
naive briar
#

Then use bot.tree.command

#

!d discord.ext.commands.Bot.tree

unkempt canyonBOT
#

property tree```
The command tree responsible for handling the application commands in this bot.

New in version 2.0.
verbal hawk
naive briar
#

Show the code

verbal hawk
# naive briar Show the code
@bot.tree.command(name="test", description="test")
async def fj(ctx, target_user: discord.Member, role2: discord.Role, expiration: int):
    try:    
        if ctx.channel == bot.get_channel(1045046421033848933):
        [and a lot of code after it]
naive briar
#

You'd have to sync it specifically to a guild so you don't have to wait 1hr until it pop up

verbal hawk
unkempt canyonBOT
#

examples/app_commands/basic.py lines 22 to 28

# In this basic example, we just synchronize the app commands to one guild.
# Instead of specifying a guild to every command, we copy over our global commands instead.
# By doing so, we don't have to wait up to an hour until they are shown to the end-user.
async def setup_hook(self):
    # This copies the global commands over to your guild.
    self.tree.copy_global_to(guild=MY_GUILD)
    await self.tree.sync(guild=MY_GUILD)```
verbal hawk
naive briar
#

ctx.bot.tree.copy_global_to(...)

verbal hawk
naive briar
#

Show the code along with the error

#

And the guild argument is expected to be an object with id attribute

#

!d discord.Object like this one

unkempt canyonBOT
#

class discord.Object(id, *, type=...)```
Represents a generic Discord object.

The purpose of this class is to allow you to create β€˜miniature’ versions of data classes if you want to pass in just an ID. Most functions that take in a specific data class with an ID can also take in this class as a substitute instead. Note that even though this is the case, not all objects (if any) actually inherit from this class.

There are also some cases where some websocket events are received in [strange order](https://github.com/Rapptz/discord.py/issues/21) and when such events happened you would receive this class rather than the actual data class. These cases are extremely rare.

x == y Checks if two objects are equal.

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

hash(x) Returns the object’s hash.
verbal hawk
# naive briar Show the code along with the error
async def sync(ctx):
    ctx.bot.tree.copy_global_to(guild=1045046418387251301)
    await ctx.tree.sync(guild=1045046418387251301)

The error:

line 70 in sync
    ctx.bot.tree.copy_global_to(guild=1045046418387251301)
  File "C:\Users\\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\app_commands\tree.py", line 246, in copy_global_to       
    mapping = self._guild_commands[guild.id].copy()
AttributeError: 'int' object has no attribute 'id'
shrewd fjord
verbal hawk
shrewd fjord
#

Yea, u can use bot too instead of ctx.bot

verbal hawk
verbal hawk
#

what could I do if I need both the ctx and the discord.Interaction in a function? They both have to be the first argument

naive briar
#

Why would you need both of them

verbal hawk
naive briar
#

!d discord.Interaction.followup

unkempt canyonBOT
naive briar
#

!d discord.Interaction.channel

unkempt canyonBOT
naive briar
#

Or that

verbal hawk
thin raft
#

Can you do an autocompletion like this wirh dpy?

fading marlin
#

With images? no

thin raft
#

can you make it with Discord's API?

fading marlin
opaque trail
#

any clue why event interaction_create doesnt work when i click the buttons, i have GUILDS and GUILD_MESSAGES intents

#

yesterday it worked fine

hushed galleon
#

i dont think any gateway intents are required for interaction events, but we need to see your code to give a better answer

sullen roost
forest oyster
#

does someone know how to solve this error?

#

"In allowed_mentions.replied_user: must be either true or false:"

smoky sinew
#

you can only reply to one user at a time, so it's pointless to make the distinction to only ping certain users in a reply

#

@forest oyster

slate swan
#

bro i am so confused

#

@smoky sinew can u help me

#

my command bugging

smoky sinew
#

bruh

#

just join the list with an empty string

unkempt canyonBOT
#

:incoming_envelope: :ok_hand: applied mute to @slate swan until <t:1677193566:f> (10 minutes) (reason: discord_emojis rule: sent 25 emojis in 10s).

The <@&831776746206265384> have been alerted for review.

smoky sinew
#

!e ```py
my_list = ["a", "b", "c"]
print(my_list)
print("".join(my_list))

unkempt canyonBOT
#

@smoky sinew :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | ['a', 'b', 'c']
002 | abc
sick birch
#

Yeah might wanna be careful with that many emojis

smoky sinew
#

rip

velvet compass
#

!unmute 707617200722149447

unkempt canyonBOT
#

:incoming_envelope: :ok_hand: pardoned infraction mute for @slate swan.

velvet compass
#

A screenshot is probably better

sick birch
#

the process is mostly the same but slightly different

smoky sinew
#

i mean just join the inner list items and then the outer list items

slate swan
#

hi

#

@smoky sinew

smoky sinew
#

hi

slate swan
#

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

bot = discord.Bot(command_prefix=commands.when_mentioned_or("!"))

headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36',
'X-Auth-Token': auth_token
}

params = {'size': '10', 'page': '0'}

def get_mine_locations():
response = requests.get('https://rest-bf.blox.land/games/mines/history', headers=headers, params=params)
data = json.loads(response.text)
return [location for game in data['data'] for location in game['mineLocations']]

import requests
import random

def get_safe_spots(mine_locations):
# Create a set of all safe spots
all_spots = set(range(25))
mine_spots = set(mine_locations)
safe_spots = all_spots - mine_spots

# Choose 5 random safe spots
safe_spots_list = list(safe_spots)
random_safe_spots = random.sample(safe_spots_list, 5)

# Sort the mine locations by row then column
sorted_mine_locations = sorted(mine_locations, key=lambda loc: (loc // 5, loc % 5))

# Create the grid with emojis
grid = []
for i in range(5):
    row = []
    for j in range(5):
        index = i * 5 + j
        if index in random_safe_spots:
            row.append('🟩')
        elif index in mine_locations:
            row.append('πŸ’£')
        else:
            row.append('🟦')
    grid.append(row)

return grid

def predict():
mine_locations = get_mine_locations()
grid = get_safe_spots(mine_locations)
for row in grid:

    return grid

predict()

@bot.slash_command(name="minesplay_bomb")
@commands.has_role("Buyer")
async def bloxflip(ctx):
raid = predict()
embed = discord.Embed(title="Radiant Predictor", description=f"{raid}")
await ctx.respond(embed=embed)

#

im confused

#

what do i do to fix

smoky sinew
slate swan
#

yes

smoky sinew
#

why

slate swan
smoky sinew
#

if it's a user endpoint then you shouldn't scrape it at all

slate swan
#

im confused

slate swan
smoky sinew
#

it can be against the server rules

slate swan
#

😭

#

i just need help plss

#

@smoky sinew

smoky sinew
#

i already gave help with that though

slate swan
#

what do u do then

slate swan
#

im deadass stupid

#

it dont work i tried it

smoky sinew
#

it worked inside the bot

slate swan
#

idk

#

can u fix it for me??

#

@smoky sinew

smoky sinew
#

i can help you with what problem you're having but i can't code your program for you

slate swan
#

idk im confused as hell

sick birch
#

!e @slate swan here is how I'd personally go about displaying a 2D list:

my_2d_list = [["row 1 col 1", "row 1 col 2"], ["row 2 col 1", "row 2 col 2"]]
print("\n".join([" | ".join(row) for row in my_2d_list]))
unkempt canyonBOT
#

@sick birch :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | row 1 col 1 | row 1 col 2
002 | row 2 col 1 | row 2 col 2
smoky sinew
#

also what's the point of this?

sick birch
#

yeah that'll do

slate swan
smoky sinew
slate swan
#

i do?

smoky sinew
#

no, i'm asking why you would do that

sick birch
slate swan
smoky sinew
#

you were bored so you needed to import numpy 5 times?? i don't get it

slate swan
#

lol

#

i was just messing around

sick birch
#

FWIW I do idly do :w when I'm thinking, lol

slate swan
#

broo

smoky sinew
slate swan
#

the thing isnt working

#

i cant get it to fix

smoky sinew
slate swan
#

its still like this kinda dumb

smoky sinew
#

show your updated code please

slate swan
#

i kinda deleted it cuz it wasent working

#

🀣

smoky sinew
#

ok

slate swan
#

let me

#

try

#

again

#

im dying

#

@sick birch @smoky sinew

#

πŸ’€

#

@smoky sinew @sick birch

smoky sinew
#

you don't need to ping me twice

slate swan
#

ok

smoky sinew
#

you're only joining one row together and returning immediately after

slate swan
#

what do i do then