#discord-bots

1 messages · Page 355 of 1

viscid hornet
#

imagine if all of discord’s messages were sent one after the other

#

imagine how big that queue would be. thats why we use async funcs

craggy anvil
#
async def send_message(username):
    embed = discord.Embed(
        title="asd",
        description="Description",
        color=discord.Color.blue()
    )
    
    await webhook.send(username=username, avatar_url="https://media.discordapp.net/attachments/1201232387896512636/1232335459297001553/reaper.gif?ex=66291555&is=6627c3d5&hm=5583c74af19e2af31888f9c92b1ee9711369065b4f5b595ac1b00477c9cb8e42&=", embed=embed)
#

did i do it right?

#

oh wait man but this isn't ran by a command?

#

it's ran by an exe file

#

i want it to send embed after i run my python file, i dont want to send it after i type command in my chat

slate swan
craggy anvil
craggy anvil
#

!d discord.Webhook.from_url

unkempt canyonBOT
#

classmethod from_url(url, *, session=..., client=..., bot_token=None)```
Creates a partial [`Webhook`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Webhook) from a webhook URL.

Changed in version 2.0: This function will now raise [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError) instead of `InvalidArgument`.
limpid marsh
#

Hello do you help me?

leaden olive
#

no errors and only the first 2 prints are getting printed

limpid marsh
#

My bot not upload commands

viscid hornet
#

error tells you right there shrug

limpid marsh
viscid hornet
limpid marsh
#

how do i install

viscid hornet
limpid marsh
#

commands are in the Scrim folder

viscid hornet
viscid hornet
#

hmm, might’ve already told you then pithink

limpid marsh
#

When

leaden olive
#

thats only thing:

reminder-create command called
User: fantasyyonfire#0
limpid marsh
viscid hornet
#

@limpid marsh

viscid hornet
#

properly this time

limpid marsh
limpid marsh
viscid hornet
#

show me what you wrote

limpid marsh
#

What does wdym mean?

limpid marsh
limpid marsh
#

Line 19-25

viscid hornet
# limpid marsh

put the load extensions into a @bot.event called setup_hook

limpid marsh
#

how do i do it?

viscid hornet
#

you made a recursive function btw and never called it

viscid hornet
#

basic dpy bro 😭

limpid marsh
#

How do I call??

slate swan
#

pithink infinite loop?

viscid hornet
#

should heat correctly prettythumbsup

viscid hornet
limpid marsh
#

I need to get it out of the infinite loop, how do I do that?

slate swan
#

I do ducky_angel

viscid hornet
#

change them damn spaces 🗣

viscid hornet
viscid hornet
#

alr told you what to do broski

limpid marsh
limpid marsh
slate swan
limpid marsh
#

😢

viscid hornet
upbeat otter
slate swan
#

vscode

viscid hornet
limpid marsh
upbeat otter
viscid hornet
viscid hornet
upbeat otter
slate swan
#

hm what was the doc

#

!d discord.Client.setup_hook

viscid hornet
unkempt canyonBOT
#

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

A coroutine to be called to setup the bot, by default this is blank.

To perform asynchronous setup after the bot is logged in but before it has connected to the Websocket, overwrite this coroutine.

This is only called once, in [`login()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.login), and will be called before any events are dispatched, making it a better solution than doing such setup in the [`on_ready()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.on_ready) event.

Warning

Since this is called *before* the websocket connection is made therefore anything that waits for the websocket will deadlock, this includes things like [`wait_for()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.wait_for) and [`wait_until_ready()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.wait_until_ready)...
limpid marsh
viscid hornet
upbeat otter
viscid hornet
slate swan
viscid hornet
limpid marsh
viscid hornet
upbeat otter
viscid hornet
limpid marsh
#

Oke

viscid hornet
viscid hornet
#

mf you gotta be more specific on your problems

#

you cant just say "error" and expect a followup answer

slate swan
#

anyone know why note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for aiohttp
ERROR: Could not build wheels for aiohttp, which is required to install pyproject.toml-based projects?

#

i have pip updated. just started using PyCharm and it gives this error.

#

happens when i try to install any package on pycharm

viscid hornet
slate swan
#

oh yeah forgot

weary verge
#

Hello i was asking if anyone can make for me a announcements command for slash I tried to make it but when i run the command it say error so i want anyone to make for me or give me

slate swan
#

just made the switch over to py charm, and fixed everything that pycharm was having a problem with. i have cogs setup (works fine on my server and in vs code) but when i try to on pycharm i just get no commands found with no errrors or anything

hushed galleon
hushed galleon
#

oh lol i missed the top one

vapid parcel
#

But, so with dyno, dyno has an AFK system right, and it edits your nickname to have [AFK]whateveryourgoofynameis, but if you are a role above or the owner, dyno still does it.. how does dyno do that?

#

Unless I am wrong and dyno can't do that. Because from personal experience I am pretty sure it can.. but I have not used that bot in many years.

hushed galleon
vapid parcel
#

Hm, so it just, edits based on its permission? If it doesn't have permission it just continues and skips nickname edit?

hushed galleon
#

https://docs.dyno.gg/en/modules/afk

Due to how Discord permissions work, Dyno can never change the owner’s nickname. As long as his role is above the role of any other using the command and he has the Manage Nicknames permission, he will change their nicknames.

vapid parcel
#

Alright then, well thank you lol

viscid hornet
vapid parcel
#

Just was a lil confused, because I thought he did but then I was confused cuz it wasn't possible

viscid hornet
vapid parcel
viscid hornet
viscid hornet
vapid parcel
#

Nope

#

and don't care to know GoofySkull

vapid parcel
pale zenith
#

stuff's getting heated in the nerds department

#

all bot.event does is setattr(client, func.__name__, func)

slate swan
hushed galleon
#

try using setup_hook to handle your startup stuff

#

e.g. py @bot.event async def setup_hook(): await bot.load_extension("path.to.ext")

slate swan
#

alright ll try that

wispy aspen
#

can someone help me out im trying to add jishaku to my bots code but im kinda confused idk why 😭

golden portal
odd socket
#

yo can i get some help here?

#

i tried use this {member.avatar_url} to set someone profile pic in the welcome message embed and i got an error , didnt use discord.py for a long time did they changed it?

velvet current
#

I"m having an issue where when I try import requests

#

it just underlines requests saying I dont have the module

#

but I actually do and reinstalled it twice already

golden portal
unkempt canyonBOT
#

property display_avatar```
Returns the member’s display avatar.

For regular members this is just their avatar, but if they have a guild specific avatar then that is returned instead.

New in version 2.0.
golden portal
#

use that instead to get asset

#

then .url to get the url

#

o i guess just str also gives u the url so kinda redundant

slate swan
#

can a button timeout if i put timeout=None?

midnight oracle
slate swan
#

okay thanks

midnight oracle
#

:D

vapid parcel
odd socket
#

oh dam

#

thx man

vapid parcel
# odd socket thx man

No problem!

you got member.avatar.url, member.avatar, member.display_avatar

and if you are using user, you can also replace these

and also, inside of the display avatar, you can also do .url at the end, to do the url, but I still don't recommend that.

But I think this error only happens with discord.Member if you use discord.User then you should be fine with using user.avatar.url or member.avatar.url how ever you labeled it. I think discord.Member is a little different from discord.User and I kinda have no clue why, but that would be a question for @hushed galleon.

golden portal
#

i mean i specifically said display_avatar so you dont get attr error

vapid parcel
#

Well yeah, my bad.

#

But ive noticed when you use discord.User you won't get the attr error.. but when you use discord.Member and use .url you will get the error. So I know it has to be something related to discord.Member I am assuming?

#

unless im stupid and just tweaking lmao

torn solar
#

how do i fill the completions for a command parameter

#

like if i have /command <string>

vapid parcel
torn solar
#

i want the options to be something like banana, apple, orange

#

to show up

torn solar
#

ty

vapid parcel
#

np

vapid parcel
torn solar
# vapid parcel np
@bot.tree.command(name="admin-give-coin", description="Admin commands")
async def givecoin(interaction: discord.Interaction, player: discord.Member, coin: str, amount: int):
    print('g')
    
@givecoin.autocomplete('coin')
async def givecoin_autocomplete(
    interaction: discord.Interaction,
    current: str,
) -> List[app_commands.Choice[str]]:
    options = ['Robert Coin']
    return [
        app_commands.Choice(name=option, value=option)
        for option in options if current.lower() in option.lower()
    ]```
#

im getting app_commands and List not found

#

am i being dumb

vapid parcel
#

So make sure to do

from typing import List

torn solar
#

that solved list

#

but not app_commands

vapid parcel
#

oh mb mb

torn solar
#

from discord.ext import commands

#

i have that imported for my commands

vapid parcel
#

i think its

from discord.ext import app_commands

or

from discord import app_commands

#

one of the 2, can't remember which one lol

#

@torn solar also make sure to add

@app_commands.autocomplete(coin=givecoin_autocomplete)

torn solar
#

above the autocomplete function?

drifting arrow
#

Hey

#

Im here now. What we working on? :D

restive dagger
#

bro

#

my bot keeps getting blocked from accesing the api

#

i didn't send that much requests

#

the code is a slash command example copied from stack overflow

#

i don't know why this is happening.

hushed galleon
#

if you're using repl.it, that happens because other people are trying to host bots on the same datacenters

restive dagger
#

also the guild argument ill remove it

restive dagger
midnight oracle
#

Can I "fetch" a member object with just the name?

#

The new username thing xd

naive briar
unkempt canyonBOT
#

get_member_named(name, /)```
Returns the first member found that matches the name provided.

The name is looked up in the following order...
midnight oracle
hushed galleon
midnight oracle
#
Traceback (most recent call last):
  File "/home/codespace/.python/current/lib/python3.10/site-packages/discord/app_commands/tree.py", line 1248, in _call
    await command._invoke_with_namespace(interaction, namespace)
  File "/home/codespace/.python/current/lib/python3.10/site-packages/discord/app_commands/commands.py", line 853, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
  File "/home/codespace/.python/current/lib/python3.10/site-packages/discord/app_commands/commands.py", line 846, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'close' raised an exception: AttributeError: 'Bot' object has no attribute 'get_member_named'

#

deamm

#

xd

golden portal
#

it's guild.get_member_named

slate swan
#

using discord.py 2.0 what do i use for slash commands? i see a bunch of stuff but im confused what to use. im using discordpy 2.3.2 the latest

slate swan
#

yikes my brain is fucked

golden portal
#

welcome

slate swan
#

Can someone @ me and point me in the right direction I’m looking to have a discord bot made & bought.

slate swan
# golden portal welcome

what does thia mean?
File "C:\Users\xz0v\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 441, in _run_event
await coro(*args, **kwargs)
File "C:\Users\xz0v\Desktop\jealousy_discord_bot\main.py", line 22, in on_ready
await bot.load_extension("cogs.ping")
File "C:\Users\xz0v\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ext\commands\bot.py", line 1013, in load_extension
await self._load_from_module_spec(spec, name)
File "C:\Users\xz0v\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ext\commands\bot.py", line 938, in load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.ping' raised an error: ImportError: cannot import name 'Option' from 'discord.app_commands' (C:\Users\xz0v\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\app_commands_init
.py)

golden portal
viscid hornet
viscid hornet
unkempt canyonBOT
#

9. Do not offer or ask for paid work of any kind.

viscid hornet
#

we dont do that here

ebon ocean
#
# cogs/fun.py
import discord
from discord.ext import commands

class Fun(commands.Cog):
    # typehint is useful for writing code
    def __init__(self, bot: commands.Bot):
        self.bot = bot

    @commands.command(name = 'hello')
    async def hello(self, ctx):
        await ctx.reply(f"Hello, {ctx.author.mention}")

# -------- cut the cog there, other commands can be added ---------

# this is very important. your code won't run otherwise
async def setup(bot): # requires a bot arg
    await bot.add_cog(Fun(bot)) # add the cog with the bot param

Can anybody figure out how to change this example one I using to work with client instead of bot? Please?

client = commands.Bot(command_prefix = '?', intents = discord.Intents.all())

#

That is like the biggest wall I have right now.

viscid hornet
#

in your case, client is literally just a name

#

so just replace “bot” and “self.bot” in those cases with “client” andself.client”

ebon ocean
#

Alrighty. I appreciate you tremendously by the way.

#

AttributeError: loop attribute cannot be accessed in non-async contexts. Consider using either an asynchronous main function and passing it to asyncio.run or using asynchronous initialisation hooks such as Client.setup_hook

#
import discord
import random
import asyncio
import datetime
from discord.ext import commands

client = commands.Bot(command_prefix = '?', intents = discord.Intents.all())

class DealGame(commands.Cog):
    def __init__(self, client: commands.Bot):
        self.client = client

    #DEAL GAME UPDATED
    @commands.command(name = "dond", aliases=["deal"])
    async def dond(self, ctx):

#At the end of the Deal program
async def setup(bot):
    await bot.add_cog(DealGame(bot))
#

Well, that didn't work.

#

I guess it IMPOSSIBLE to have it as client unless the MAIN file needs to be changed up to.

#
import discord
import random
import asyncio
import datetime
import aiohttp
from discord.ui import Button, View
from discord.ext import commands

#client = commands.Bot(command_prefix = '?', intents = discord.Intents.all())

class DiscordBot(commands.Bot):
    def __init__(self):
        super().__init__(
            command_prefix = '?',
            intents = discord.Intents.all()
        )

    async def setup_hook(self): # this replaces on_ready
        await self.load_extension('cogs.Fun')
        await self.load_extension('cogs.Weather')
        await self.load_extension('cogs.Fraction')
        await self.load_extension('cogs.DealGame') # loads the fun cog

client = DiscordBot()
#

That is what the main file cog looks like.

turbid condor
#

and how are u running the bot?

ebon ocean
#

I just open the file and it runs.

turbid condor
#

no i mean what does your run func looks like

ebon ocean
#

I just want to use a cog that uses "client" instead of "bot" in the cog file I think it called.

turbid condor
#

like you run it like client.run('Token') or something else

ebon ocean
#

Oh that.

#

client.run('TOKEN REMOVED')

turbid condor
#

ok then can you show the whole traceback for error

ebon ocean
#

Yes. Let me remake it.

turbid condor
ebon ocean
#

Gonna run it again without the client = this on the Deal file and see what error shows up.

ebon ocean
#

pickcase = await client.wait_for('message', timeout=300, check=check)
NameError: name 'client' is not defined

turbid condor
#

use self.client if its a cog instead of just client

ebon ocean
#

Alright, lets see if that works.

viscid hornet
turbid condor
#

you will get a mail with in 24hr to claim your badge and to keep the badge u will need the command to be used once every 30 days to keep the badge

ebon ocean
#

I wish there was a way to just select all "client" showing up instead of just typing and trying to find everyone.

turbid condor
#

in vsc its ctrl + F2 to select all occurences

ebon ocean
#

I use visual studio code.

ebon ocean
#

Whoa that is shockingly convienent.

#

Time for the test. Also there was 12 of those to changed and that was a new thing you taught me.

#

No errors... yet.

#

Nope, it works.

#

Thank you @viscid hornet very much! 🍪🍪🍪🍪🍪🍪🍪
Thank you @turbid condor very much! 🍪🍪🍪🍪🍪🍪🍪

restive dagger
#

im not sure it has it's own ip addres tho

turbid condor
restive dagger
slate swan
viscid hornet
slate swan
#

the old deprecated shit i didnt remove it BassBoostedJamPepe

viscid hornet
#

buttons? selects?

slate swan
#

for slash but its old

turbid condor
viscid hornet
turbid condor
#

yup but static

#

autocomplete is dynamic

upbeat otter
viscid hornet
viscid hornet
turbid condor
slate swan
#

slash commands confuse me lmfao

turbid condor
viscid hornet
upbeat otter
slate swan
turbid condor
#

not much different from normal prefix

viscid hornet
upbeat otter
#

So why not use choices

viscid hornet
slate swan
viscid hornet
#

its like the ancient version of choices

slate swan
#

i think ive heard that once

#

does it work well?

turbid condor
#

and just don't process_commands in on_message

upbeat otter
slate swan
upbeat otter
#

Then why were you using it

#

😭

turbid condor
slate swan
#

ill keep looking into geting slash command working without hybrid then, will be a last resort

turbid condor
#

gl

slate swan
#

where can i find more about hybird?

viscid hornet
viscid hornet
#

like a car with just the rims and no back two wheels lmao

upbeat otter
viscid hornet
slate swan
#

well i tried making a basic echo command but i get an error and im not sure what it means, let me send screenshot

#

confused at this part

turbid condor
#

can you type the full line

slate swan
#

yeah that would help more eh

bot.tree.command(name="echo", description="Echoes a message.") @app_commands.describe(message="The message to echo.") async def echo(interaction: discord.Interaction, message: str) -> None: await interaction.response.send_message(message)

turbid condor
#

no issue might be a linter problem

#

just add @ before bot.tree.command()

slate swan
#

sorry i cut that out

turbid condor
#

yeah no issue it seems might be the linter

shrewd apex
#

!d discord.InteractionResponse.send_message

unkempt canyonBOT
#

await send_message(content=None, *, embed=..., embeds=..., file=..., files=..., view=..., tts=False, ephemeral=False, allowed_mentions=..., suppress_embeds=False, silent=False, delete_after=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Responds to this interaction by sending a message.
shrewd apex
#

are you sure you don't have multiple discord libs installed

#

which might cause naming conflicts

slate swan
#

ive been doing a lot of installing.. so i probably do

turbid condor
#

if that's replit then i'm sure its discord instead of discord.py

slate swan
#

replit?

turbid condor
#

nvm

slate swan
#

no shot that exists still ahah

turbid condor
#

try doing pip freeze in terminal and show what it prints

slate swan
#

oh cant do that oopsies

#

i have some i need to uninstall

#

like salsh and interactions 😭

turbid condor
#

discord-ext-forms==3.0.3 discord-py-interactions==5.11.0 discord-py-slash-command==4.2.1 discord-typings==0.8.0 discord.py==2.3.2

shrewd apex
#

just run this script ```py
import os
import sys

py_exec = sys.executable
uninstall_list = " -m pip uninstall nextcord py-cord interactions.py disnake dislash discord-py-slash-command discord.py-message-components enhanced-discord.py novus hata discord-interactions discord.py-self discord.py-self.embed discord2 python-discord reactionmenu discord_py_buttons discord_slash discord.py discord discord-ext-forms discord-ext-alternatives dpy-appcommands discord-ext-slash"

os.system(py_exec + uninstall_list)
os.system(py_exec + " -m pip install discord.py --no-cache-dir")

turbid condor
#

remove these and then reinstall just discord.py

blissful grove
#

Anyone have any idea how I can attach a csv file as a hyperlink inside the embed?

blissful grove
blissful grove
#

Like transaction records associated with a user

shrewd apex
#

you need to upload it somewhere and link it to the button

turbid condor
#

upload the csv on a host and share the link to it

shrewd apex
#

u can use some cloud file store like firestore or s3

blissful grove
#

How can I achieve that? I want it all to happen when this slash command is used

shrewd apex
#

or just upload it to a dump channel on discord and give a link to the attachment now

slate swan
#

alrighty uninstalled that then re installed discord py

slate swan
#

How to program a dc bot

shrewd apex
shrewd apex
slate swan
#

still getting this though, not sure

turbid condor
slate swan
#

just did, no errors. ran fine

#

not seein it though. i have slash commands enabled etc

turbid condor
#

u synced the commands?

shrewd apex
#

oh that's a weird goal but ok, u need to know the following

  • python upto classes and instances
  • asynchronous programming
  • bit about apis help
slate swan
turbid condor
shrewd apex
slate swan
#

i just did it on-web

#

still not seein it

#

odd

turbid condor
#

can you do it like

synced = await bot.tree.sync()
print(f'Number of Synced Commands: {len(synced)}')
```at the place where you syncing
#

and see what it prints

slate swan
#

it somewhat- worked? .. im nots sure

#

import sys; print('Python %s on %s' % (sys.version, sys.platform))

turbid condor
slate swan
#

🙂 so

#

lol

turbid condor
#

then why did it say bot not found?

slate swan
#

not sure.

turbid condor
#

unless you changed the code

slate swan
#

codes the same. just synced my commands

restive dagger
#

is syncing a command instant?

slate swan
#

have 2 synced commands. all my other commands are cog

turbid condor
restive dagger
turbid condor
slate swan
#

alrighty

turbid condor
slate swan
#

i just do web

restive dagger
slate swan
#

yes

#

or use web

turbid condor
turbid condor
#

but u got slash commands

restive dagger
slate swan
#

yes have echo and ping, just none work

restive dagger
turbid condor
#

stick to Bot it's better

restive dagger
#

Ik

turbid condor
restive dagger
#

k

turbid condor
#

tho idk why it replies with bot not found

slate swan
#

im a lucky man

restive dagger
#

If i have a bot that uses commands , slash commands, can i get the active developer badge?

slate swan
#

i think you can easily get it

restive dagger
#

Alr

slate swan
#

without that

turbid condor
slate swan
#

ohh

restive dagger
restive dagger
turbid condor
#

it doesn't matter if it has prefix command or not it just needs one app_command that is used

slate swan
#

here

turbid condor
slate swan
#

it has before. i dont think i ever tried buttons again because i couldnt bother i could try to make a button and see?

turbid condor
#

don't, get your command fixed first

#

try using your ping command

slate swan
#

i have

#

same error. /reply

restive dagger
#

I try to get active developer badge but it says i have no apps that use app_command.

slate swan
#

im running it on a server- but its off so its not like that can be a problem

restive dagger
turbid condor
#

but then again you should receive two responses

#

or an error

candid steeple
#

Can anyone help me with running raspberry pi camera

slate swan
#

wait maybe it is on

turbid condor
slate swan
#

yeah its off

#

havent seen anyone else with this problem. lol

turbid condor
#

hmm its very creepy now it shouldn't do that unless you are overwriting your message

#

in the code

slate swan
#

it might be me being dumb not sure

#

!longtext

#

no clue what the things called

#

i guess i broke my normal commands as well

#

🙂

#

fixed my cogs- had my shit setup wrong

#

no luck on slash though

blissful grove
#

Is there a way I can move the attachment below the embed instead of this?

viscid hornet
#

i recommend either a link, discord attachment (idk if taht counts as an attachment) or just not attach that file

viscid hornet
slate swan
#

got it

#

ignore the name. had to make a new one

#

not sure why that worked

viscid hornet
viscid hornet
#

but do you know how slash commands work

#

thats important to know as well

slate swan
#

fuck nah 🙊

viscid hornet
# slate swan fuck nah 🙊
from discord import Interaction # easier import

@app_commands.command() # for a cog, uses self
@bot.tree.command() # for a main file
async def your_command(self, interaction: Interaction):
    await interaction.response.send_message("Hello!") # sends a message as a response```
#

this is as basic as it gets

upbeat otter
#

See asher's guide to slash commands

viscid hornet
#

there's different types of .responses, like:

  • interaction.response.defer()
  • interaction.response.edit_message()
viscid hornet
viscid hornet
upbeat otter
#

Bro spent a lot of his life making every single page of this guide 😭

slate swan
#

w mans

upbeat otter
#

They should unpin my gist and pin this up tbh this is more helpful 💀

ebon ocean
#

I hate to ask this, but how do you get the user name shown on screen?

ctx.author.display_name = tailstellstales
ctx.author = tailstellstales#0
ctx.author.name = "tailstellstales
ctx.author.id = ID Number of Name
??? = TailsTellsTales

I even looked up discord py doc thing and nothing.

safe stag
#
class Ticket(ezcord.Cog, emoji="🎫"):
    def __init__(self, bot):
        self.bot = bot
        self.ticket_owner = None

    @ezcord.Cog.listener()
    async def on_ready(self):
        self.bot.add_view(TicketRole(self.channel_name, self.logs_channel_name, self.ticket_feedback))
        self.bot.add_view(TicketView())
        self.bot.add_view(CreateTicketSelect())
        self.bot.add_view(QuestionsButton(self.ticket_owner))
``` ```py
[ERROR] Error while sending error report to webhook. Please check if the URL is correct.
[ERROR] Error in event on_ready 
Traceback (most recent call last):
  File "C:\Users\Dark_Angel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 400, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\Dark_Angel\Desktop\Jinx-Bot\cogs\ticket.py", line 94, in on_ready
    self.bot.add_view(TicketRole(self.channel_name, self.logs_channel_name, self.ticket_feedback))
AttributeError: 'Ticket' object has no attribute 'channel_name'```
quick gust
viscid hornet
viscid hornet
# quick gust

is that your bot? i cant find any that let you use jsk yourself

quick gust
#

yeah it's mine

safe stag
viscid hornet
quick gust
viscid hornet
viscid hornet
safe stag
quick gust
#

make a very cool bot related to something for which not many exist already

safe stag
viscid hornet
safe stag
#

What do you think ?

ebon ocean
upbeat otter
viscid hornet
upbeat otter
viscid hornet
upbeat otter
unkempt canyonBOT
#

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

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

@quick gust
Example 2 with your user name.
Infernum = Doesn't exist.
infernum.. = author.display_name or author.name
infernum.
.#0 = author

There seems to not be one that can show your actual user name.

viscid hornet
#

😭

upbeat otter
#

Dpy is ded

#

💀

ebon ocean
#

I'm telling you the code I keep running shows it as I mentioned above.

ebon ocean
#

Like this should be pretty straight forward, but surpringly nobody knows.

viscid hornet
#

!d discord.Member

unkempt canyonBOT
#

class discord.Member```
Represents a Discord member to a [`Guild`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild).

This implements a lot of the functionality of [`User`](https://discordpy.readthedocs.io/en/latest/api.html#discord.User).

x == y Checks if two members are equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/latest/api.html#discord.User) instances too.

x != y Checks if two members are not equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/latest/api.html#discord.User) instances too.

hash(x) Returns the member’s hash.

str(x) Returns the member’s handle (e.g. `name` or `name#discriminator`).
ebon ocean
#

Is there any other ones I can test?

viscid hornet
#

wdym?

ebon ocean
#
@client.command()
async def testing(ctx):
    await ctx.send(ctx.author.display_name)
    await ctx.send(ctx.author)
    await ctx.send(ctx.author.name)
    await ctx.send(ctx.author.id)
    await ctx.send(ctx.author.mention) #Try these two out
    await ctx.send(ctx.member.user)
#

Like anymore names to test to see if it might show the correct user name I want?

viscid hornet
#

lemme experiment w it

ebon ocean
#

To my shocking surprise, the author.mention actually did something. I was just making stuff up lol.

#

Obviously the mention pings you.

upbeat otter
#

Yes

ebon ocean
#

Now I am curious if "author.mention" would work in an embed of discord.

upbeat otter
upbeat otter
ebon ocean
#

I honestly don't know which is why I gave detailed list above.

upbeat otter
#

Ok i think I have it

#

!d discord.User.global_name

unkempt canyonBOT
upbeat otter
#

Use this

viscid hornet
#

no way that works

upbeat otter
#

It's clearly written in the docs

ebon ocean
#

INPUT: What I want. TailsTellsTales

@client.command()
async def testing(ctx):
    await ctx.send(ctx.author.display_name)
    await ctx.send(ctx.author)
    await ctx.send(ctx.author.name)
    await ctx.send(ctx.author.id)
    await ctx.send(ctx.author.mention)

OUTPUT: What I get.
tailstellstales
tailstellstales#0
tailstellstales
I removed name ID
@ebon ocean

ebon ocean
viscid hornet
#

it worked

ebon ocean
#

So I guess that would be ctx.send(ctx.global_name).

safe stag
viscid hornet
upbeat otter
viscid hornet
#

!d discord.ext.commands.Bot.guilds

unkempt canyonBOT
viscid hornet
#

ooh

upbeat otter
#

You could have done discord.Client.guilds to save effort 💀

ebon ocean
#

Using author.mention in an embed causes it to turn into an @ id number.

upbeat otter
#

You can only use it in description and field values

viscid hornet
#

how do you set a bot status

viscid hornet
#

!d discord.Client.status

unkempt canyonBOT
#

property status```
[`Status`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Status): The status being used upon logging on to Discord.
viscid hornet
#

woah

upbeat otter
upbeat otter
viscid hornet
ebon ocean
#

Alright, gonna try ctx.author.global_name that.

viscid hornet
#
class DiscordBot(commands.Bot):
    ...
    async def setup_hook(self):
        await self.change_presence(status = discord.Status.offline)```
upbeat otter
ebon ocean
# viscid hornet how do you set a bot status
@client.event
async def on_ready():
    await client.change_presence(status=discord.Status.online) #activity=discord.Game("Friday Night Funkin'")) (type=discord.ActivityType.watching, name=""))
    print("Bot is ready.")
upbeat otter
#

Use a task or a text command

viscid hornet
upbeat otter
#

Dont do it in on_ready

ebon ocean
#

That is my status thing I have.

viscid hornet
upbeat otter
viscid hornet
ebon ocean
#

That been on the on_ready thing for a long time now from a youtube video long ago.

viscid hornet
ebon ocean
#

Got this error.

await ctx.send(ctx.author.global_name)

AttributeError: 'Member' object has no attribute 'global_name'

ebon ocean
#

Yeah, basically. At least I learned how to mention a name.

slate swan
#

!d discord.Member.global_name

unkempt canyonBOT
#

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

It weird how our ACTUAL display names can not be used in the bot.

#

Unless you get pinged.

upbeat otter
#

😭💀

slate swan
#

what is your dpy version? @ebon ocean

upbeat otter
ebon ocean
slate swan
ebon ocean
#

Yeah I have no idea how to check discord python version and just gonna update it.

slate swan
#

you could check it like this

import discord
print(discord.__version__)
ebon ocean
#

I had 2.2.2 it says on updating.

slate swan
#

Alright let it update

ebon ocean
#

[notice] A new release of pip is available: 23.0.1 -> 24.0

#

I guess will update that too.

slate swan
#

yea

ebon ocean
#

Sigh! How do I run the thing?

#

-m pip install --upgrade pip

#

Screw it, I'll show my dang files. Don't hack me.

#

[notice] To update, run: C:\Users\removeduser\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip

#

After the discord update, the names are still the same lol.

ebon ocean
# slate swan yea

But seriously, do you know how to run that? Forgive me, I'm not good with computers.

upbeat otter
#

Leave that be

#

Just run your program

ebon ocean
#

Too late... I think just guessed and I already ran the program and it the same usernames as before.

upbeat otter
#

Even with global_name?

#

Can I see a screenshot of the output

viscid hornet
#

author

#

so done with roles man

#

how do you edit a role

#

oh im dumb

#

!d discord.Role.edit

unkempt canyonBOT
#

await edit(*, name=..., permissions=..., colour=..., color=..., hoist=..., display_icon=..., mentionable=..., position=..., reason=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Edits the role.

You must have [`manage_roles`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_roles) to do this.

All fields are optional.

Changed in version 1.4: Can now pass `int` to `colour` keyword-only parameter.

Changed in version 2.0: Edits are no longer in-place, the newly edited role is returned instead...
ebon ocean
#

I am gonna slap myself.

viscid hornet
ebon ocean
#

await ctx.send(ctx.author.global_name)
AttributeError: 'Member' object has no attribute 'global_name'

#

*INPUT

@client.command()
async def testing(ctx):
    await ctx.send(ctx.author.display_name)
    await ctx.send(ctx.author)
    await ctx.send(ctx.author.name)
    await ctx.send(ctx.author.id)
    await ctx.send(ctx.author.mention)
    await ctx.send(ctx.author.global_name)

OUTPUT
await ctx.send(ctx.author.global_name)
AttributeError: 'Member' object has no attribute 'global_name'

#

Anyway, y'all let me know if you ever can figure that out.

drifting arrow
#

Lookup on the documentation for author

#

It’ll tell you

ebon ocean
golden portal
#

if member.global_name is giving you an attr error, it means your dpy isn't 2.3 above

ebon ocean
#

But I just updated it.

golden portal
#

well the error says otherwise, did you update on the wrong environment?

ebon ocean
#

I don't see it, but somebody gave me download thing.

#

Here we go. pip install -U discord.py
I just use that again.

#

It says installed already.

golden portal
#

can you do print(discord.__version__) in your code and see what it says

ebon ocean
#

It says 2.3.0a

#

Not sure why it has a letter.

golden portal
#

a means alpha, its before release version

#

currently its 2.3.2

#

can you do pip --version

ebon ocean
#

Yeah it shows pip 24.0

golden portal
#

well i need to know the path as well

ebon ocean
#

pip 24.0 from C:\Users\nameremoved\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pip (python 3.9)

golden portal
#

and what do you use to run the bot? py or python, i.e py main.py or python main.py

ebon ocean
golden portal
#

no im asking the command itself not the filename

ebon ocean
golden portal
#

with what text editor? vscode? those also uses a command when you click on the play button

ebon ocean
#

I use visual studio code.

#

I only use idle shell to run a program if in a text editor thing.

#

Otherwise I just open the file in a regular file folder.

#

Is this NOT what everyone gets when they run this?

INPUT

@client.command()
async def testing(ctx):
    await ctx.send(ctx.author.display_name)
    await ctx.send(ctx.author)
    await ctx.send(ctx.author.name)
    await ctx.send(ctx.author.id)
    await ctx.send(ctx.author.mention)
    await ctx.send(ctx.author.global_name)

OUTPUT
tailstellstales
tailstellstales#0
tailstellstales
241629325223395329
@ebon ocean

await ctx.send(ctx.author.global_name)
AttributeError: 'Member' object has no attribute 'global_name'

#

I am 100% certain it's IMPOSSIBLE to get your username to show.

#

As in my user name being TailsTellsTales for example.

golden portal
#

you're looking for global_name, that is set when you set the User Profile

#

which is why its important to debug why your discord.py isn't 2.3.2

ebon ocean
#

Well global name causes error.

golden portal
#

i know, because it's not the latest its an alpha release for your discord.py

ebon ocean
#

Oh yeah, forgot to mention, that confused the alpha release.

#

Is it not ready yet?

#

Like why did it not load the normal one?

golden portal
#

no, im saying your discord.py version is in alpha release of 2.3.0, when the current version is already at 2.3.2

#

so you probably updated discordpy on the wrong environment

golden portal
#

need to know that

ebon ocean
#

Oh. Yeah, I will admit I am really bad with computers. I just opened command prompt and added that pip install thing somebody posted.

golden portal
#

dw just show me what path appears when you run it

ebon ocean
#

I am officially confused. Do you mean type run into search or run in command prompt? What am I even running?

golden portal
ebon ocean
#

I go to file explorer and click the file to run it.

#

It pops up in a command prompt.

#

C:\Windows\py.exe

golden portal
#

so i guess your os already set the python path on that file

ebon ocean
#

I have no idea.

golden portal
ebon ocean
#

Alright. I was just reading what it said on the top of the command prompt screen.

#

Okay it did something.

#

@golden portal What the fudge biscuits?! It actually shows my actual username now?!

#

Twice!

golden portal
#

nice finally works

#

yea display_name would include global_name as well

#

so it would appear twice based on your code

ebon ocean
#

That was really unexpected.

viscid hornet
#

how do i run two async funcs at the same time?

ebon ocean
#

The great thing is all my code uses author.display_name which works out.

golden portal
ebon ocean
#

Anyway let me get you your cookies.

viscid hornet
golden portal
ebon ocean
#

Thank you @golden portal for getting that figured out and yeah I will be looking into that here! 🍪🍪🍪🍪🍪🍪🍪

golden portal
#

welcome

viscid hornet
quick gust
#

if a task gets destroyed due to an error? how must I re-start it without having to re-run the bot?

quick gust
#

yes

viscid hornet
#

oh wait i read that wrong

quick gust
#

yeah, through the code (whenever it errors)

viscid hornet
quick gust
#

it can be anything

viscid hornet
#

oh

#

do tasks have error handlers?

quick gust
#

¯_(ツ)_/¯

#

if they do, this would be light work

viscid hornet
#

main chat is dead so how would i do this ```py
await asyncio.gather(
task1(),
task2(),
task3()
)

only after the gather task has finished

print("All done!")```

#

nvm alr got an answer

slate swan
quick gust
slate swan
#

!d asyncio.TaskGroup

unkempt canyonBOT
#

class asyncio.TaskGroup```
An [asynchronous context manager](https://docs.python.org/3/reference/datamodel.html#async-context-managers) holding a group of tasks. Tasks can be added to the group using [`create_task()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task). All tasks are awaited when the context manager exits.

New in version 3.11.
viscid hornet
slate swan
#

💀

#

wait TaskGroup wouldnt actually work

#

Im curious now pithink

viscid hornet
#

fr

quick gust
#

im loyal to this channel 🙏

viscid hornet
#

their server got raided 💀

upbeat otter
#

Lmao

blissful grove
#

Is it just me or discord is really slow today? My commands take forever to sync. I literally have to kick my bot and re-invite it for the commands to appear

golden portal
#

perhaps you're hitting the sync ratelimit

blissful grove
#

or how long do I wait?

golden portal
#

if you see a warning you would know the time

blissful grove
#

I'll take a break anyways. I've been doing bot stuff all day.

I enter a wormhole when I do bot stuff where time just warps by lol

minor kernel
#

applesauce or choco pudding?

viscid hornet
#

how often are you doing that?

#

wait my wifi just came back

weary verge
#

i didn't gat it what wrong

upbeat otter
viscid hornet
weary verge
viscid hornet
#

!paste

unkempt canyonBOT
#
Pasting large amounts of code

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

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

weary verge
restive dagger
#

How can i make a slash command only available to admins

#

Or only runnable by admins

viscid hornet
#

cogs exist for a reason

viscid hornet
restive dagger
restive dagger
viscid hornet
#

its cool if i have a rolls royce but whats the point of it if it has no engine

#

cant use it to go anywhere

viscid hornet
# restive dagger How can i check ?

initialise a role object for your admins, eg. py guild = ... # use bot to get guild special_role = ... # admin role gotten from the guild
then in your code, check if interaction.user has that role, eg. py @your_slash_command() async def admin_only(self, interaction: Interaction): if special_role not in interaction.user.roles: # they dont have the role return # abort the func

#

theres probably a deco for this

viscid hornet
# weary verge done
from typing import Type
import discord
import sys
import asyncio
import random
from discord.ext.commands.bot import _default
from discord.ui import Button, View
import time as pyTime
import json, random
import json
from discord import app_commands
from discord.ext import commands
import time
import configparser
from discord.ui import button, Button, view```
#

what the hell are these imports

restive dagger
#

There is.

viscid hornet
#

woah

#

what is it

#

oh you can make your own decos, i forgot

woeful thistle
#

Hello, I am quite new into coding and I have been making a timezone bot that would put the time in the voice channel but I have no idea on how I would update the time every 10 or so minutes, I looked into tasks.loop but I have no clue on what I can do to look for the channel and edit the time.

#

I have been stuck here for a while now and I think I already hit the wall in what I know so I might need an external help. Thank you. I will put the code in a sec.

viscid hornet
# restive dagger guess what
async def only_for_admins():
    async def check(interaction):
        return interaction.user.guild_permissions.administrator

    return app_commands.check(check)```
#

this checks if the user is an admin (perms)

restive dagger
viscid hornet
#

theres also @app_commands.has_role() if admins are defined by a role

viscid hornet
restive dagger
# viscid hornet wdym?

Like whenever i check interaction.user.guild_penrissions.traitor it doesn't do anything. I made it to check if it has and if it does it will run and else it will say no perms, but when i run it nothin happen

woeful thistle
#

the one i use is something that goes like:
if not interaction.user.guild_permission.administrator:
return await interaction.response.send_message('Admin priv only')

woeful thistle
#

I also tried the decorator for the role but nothing happens too

viscid hornet
viscid hornet
woeful thistle
#

or maybe a way to manually input the channel ID for it to start updating. I tried putting tasks.loop in app_commands.command and it seems that it doesnt work too.

viscid hornet
woeful thistle
#

I was thinking of making a slash command to input the ID and it would start updating.

viscid hornet
#

i recommend just getting the channel

viscid hornet
#

it doesnt count as an API call because it's loaded into cache

woeful thistle
#

I see, okay I will try this out thank you.

upbeat otter
viscid hornet
upbeat otter
viscid hornet
#

but fair point

woeful thistle
#

sorry for the delay, it did return a none type
AttributeError: 'NoneType' object has no attribute 'get_channel'

viscid hornet
#

by returning a NoneType, it means this: py def func(): return None

slate swan
#

(you had to use this in a private message with the bot)

#

use this in an actual guild (server)

ebon ocean
#

Forecast API returns alerts and warnings issued by government agencies (USA, UK, Europe and Rest of the World) as an array if available for the location provided through the Forecast API.

By default alerts are not returned. To get alerts back in the response from Forecast API, pass the parameter alerts=yes.

I have no idea how to "pass the parameter". Not a super big deal, just curious.

upbeat otter
#

Don't tell me "It's for a discord bot" 💀

ebon ocean
#

It is.

#

I already have it finished up nicely.

upbeat otter
ebon ocean
#

It's very hard to understand API things, though the weather one is the one I understand the most. No problem if that too complicated.

slate swan
#

Alright lets believe him

#

I assume this "parameter" is an "query parameter" and you would pass it like this

https://example.com?parameter=value
upbeat otter
#

Pass the parameter using
url/whatever?alert=yes

#

Ok im slow

slate swan
#

thats fine

ebon ocean
#

Wait a second... I just noticed there already is a "param" thing in the start of the weather bot code. I wonder if I can just copy/paste it to match alert thing? Gonna find out.

slate swan
#

in the url?

ebon ocean
#

Okay, that was completely useless.

#

I don't even have a url.

upbeat otter
#

Bro writes everything he does

slate swan
#

how do you get a response from the api then?

ebon ocean
#

No idea. It works.

upbeat otter
#

Huh? 💀

#

Are you using an api wrapper

ebon ocean
#

WAIT! Here we go. "http://api.weatherapi.com/v1/forecast.json"

slate swan
#

alright I checked it and you will most likely need more than 1 query parameters

#

follow this pattern to correctly pass them

https://example.com?parameter1=value1&parameter2=value2
#

assuming that parameter1 is an API token and parameter2 is the alert

ebon ocean
#

I just realized something. Even if I "pass the parameter" I would still have no idea how to even get the alerts figured out cause it doesn't say where it belongs in the API doc thing.

#

Again, it's not a big deal. It was just a curiosity for me.

slate swan
#

you would have to access the value of alert in the response

#

when getting the JSON Response its in dict format I believe

#

so you can either use .get() function or [] (getitem) syntax on it

upbeat otter
#
from dotenv import load_env; import requests; import os

load_env() 

protocols = ('https', 'http',) 

secure = True

params = {
  'api_key': '1234', 
  'alert': 'yes',
}

if secure is True:
  response = requests.get(f'{protocols[0]}/:/weather.com/params.json(&)')
  text = response.words

pithink

#

💀

ebon ocean
#

That is something. It all good.

slate swan
ebon ocean
#

Which looks better to y'all?

upbeat otter
#

Are we actually trying to fix that I wrote cancer

slate swan
#

yeah :kekw:

ebon ocean
slate swan
#

first one

ebon ocean
#

The temps are color coded by the way.

#

I trying to make it where can look nice on mobile too.

viscid hornet
#

what is that photo 😭

ebon ocean
#

LOL.

slate swan
#

since discord messed a bit with codeblocks so it looks a bit off

#

and the text hops to the next line

#

is there a python course like duolingo?

#

im trying to learn python with anyway

upbeat otter
slate swan
ebon ocean
#

The weather icon is making it where only 21 characters on mobile for me can fit on a single line.

slate swan
#

I started with it

ebon ocean
#

I prefer the first one too.

slate swan
upbeat otter
#

Anyways this is a discord bot help channel

slate swan
#

where is a programming help channel

ebon ocean
#

I am so done with the bot today.

viscid hornet
viscid hornet
ebon ocean
viscid hornet
slate swan
#

if you could cache it, yeah :lol:

viscid hornet
#

"python int too big for sqlite integer"

slate swan
#

unless you need it after the program stops

#

but there is also redis for that

upbeat otter
#

Migrating to sqlite db ,😭😭😭

viscid hornet
#

should i just put it in as strings and call int() on them?

upbeat otter
viscid hornet
slate swan
#

Bigint

viscid hornet
slate swan
#

I never had that problem though 😭

viscid hornet
upbeat otter
#

What shit are you using 😭😭

slate swan
#

use sqlite3 :noice:

viscid hornet
viscid hornet
viscid hornet
upbeat otter
#

Just code it

viscid hornet
upbeat otter
#

😭

viscid hornet
upbeat otter
# viscid hornet

What the hell dude how do you even come up with that 😭😭😭

slate swan
#
import sqlite3

connection = sqlite3.connect("data.db")
cursor = connection.cursor()

query = "CREATE TABLE IF NOT EXISTS smth (number BIGINT)"
cursor.execute(query)
connection.commit()
viscid hornet
viscid hornet
upbeat otter
viscid hornet
upbeat otter
viscid hornet
#

"moves BIGINT"

#

watch this shit fail again

upbeat otter
#

I hope it does

slate swan
upbeat otter
viscid hornet
slate swan
viscid hornet
upbeat otter
viscid hornet
#

wait i'll get it to print whatever it failed and keep going

viscid hornet
upbeat otter
#

Use a BIGINT

slate swan
#

if bigint doesnt work the only possible thing i'd see would be making it TEXT

viscid hornet
upbeat otter
viscid hornet
#

is it a bad sign its printing at light speed?

#

LMAOOO

hushed galleon
viscid hornet
#
# last 3
Failed to upload board moves 32364511663516535572337576216.
(Evaluation: -2)
Failed to upload board moves 14711164625315265231526226375765447437733.
(Evaluation: 0)
Failed to upload board moves 2275634273633217117526375347415.
(Evaluation: -4)```
#

hmm why wont my db store these? pithink

upbeat otter
hushed galleon
slate swan
viscid hornet
upbeat otter
slate swan
#

kekw

#

problem solved

restive dagger
#

kick has raidrd an exception Member obj has no atribute "guild_permission"

viscid hornet
#

guild_permissions

#

!d discord.Member.guild_permissions

unkempt canyonBOT
#

property guild_permissions```
Returns the member’s guild permissions.

This only takes into consideration the guild permissions and not most of the implied permissions or any of the channel permission overwrites. For 100% accurate permission calculation, please use [`abc.GuildChannel.permissions_for()`](https://discordpy.readthedocs.io/en/latest/api.html#discord.abc.GuildChannel.permissions_for).

This does take into consideration guild ownership, the administrator implication, and whether the member is timed out.

Changed in version 2.0: Member timeouts are taken into consideration.
viscid hornet
#

see?

slate swan
#

minor spelling mistake 😔

restive dagger
# viscid hornet well there you go

thats when i try to use:

if not interaction.user.guild_permissions.administrator:
  await interaction.response.send_message("You can't run this")```
upbeat otter
#

What's the error

viscid hornet
#

now the spelling is fixed

restive dagger
#

im dumb

viscid hornet
restive dagger
#

breh rate limiting again

slate swan
#

what are you doing to get rate limited

#

I sense on_ready/setup_hook tree syncing

viscid hornet
slate swan
#

stop calling everyone you see a mf 😭 🙏

viscid hornet
#

its like having a person with no limbs in a dope outfit

slate swan
#

they have to begin somewhere

viscid hornet
viscid hornet
weary verge
#

That why

slate swan
#

and recommending to read the docs & official guides

viscid hornet
viscid hornet
slate swan
#

too much for my brain

#

I have only few braincells left 😔

viscid hornet
viscid hornet
ebon ocean
#

Why is visual studio code showing this as errors?!

import (discord)
import random
import asyncio
import datetime
import (aiohttp)
from (discord.ui) import Button, View
from (discord.ext) import commands
#

Is it because the extensions in V S C need to be updated?

glad cradle
#

that's invalid syntax

ebon ocean
glad cradle
ebon ocean
#

Forgot to mention that. Added parenthesis to show VSC thinks those are errors or "problems".

#

Yes, I updated it earlier today.

glad cradle
#

do you have multiple python versions installed in your pc?

ebon ocean
glad cradle
#

you're not using a Virtual environment correct?

ebon ocean
#

What is virtual environment?

glad cradle
#

...so you're not using it

glad cradle
#

are you in Windows?

ebon ocean
#

Yes, I use windows 10 I believe.

glad cradle
#

it'll show the installed python versions

ebon ocean
#

Installed Pythons found by py Launcher for Windows
-3.9-64 *

glad cradle
#

mh, did you put your python interpreter path in the PATH environment variable?

ebon ocean
#

I have no idea.

#

Honestly no idea what that means.

#

If this was 1999 when computers were much easier to use, then I might know some things.

glad cradle
#

search on Google how to add python on PATH, if you don't remember if you selected the box to add the interpreter to PATH when installing python

viscid hornet
glad cradle
#

the issue that Vs code is showing is that it's unable to locate the packages, as if they are not installed, this suggest that you have some issues with your IDE or with your interpreter

viscid hornet
ebon ocean
#

Let's look.

ebon ocean
viscid hornet
#

this is the latest version

#

😭

#

guys python version is 3 and a half years old

ebon ocean
#

Also NONE of these google searches is helping.

glad cradle
ebon ocean
#

Isn't that python?

#

Isn't pip python?

glad cradle
#

with pip you install (update, etc...) libraries, pip is just a script written in python to install third party software and make it usable in your python files

ebon ocean
#

I'm gonna be honest, I am very overwhelmed.

brazen raft
#

I suggest starting from the basics then

glad cradle
# ebon ocean I'm gonna be honest, I am very overwhelmed.

with python we refer to the interpreter, to update it you need to head to the python website, choose a python version, repeat the installation process (selecting the option to add the interpreter path to the PATH) and possibly deleting python 3.9 or at least knowing how to choose the correct python version when running commands

#

anyway this seems off topic for this channel

ebon ocean
#

Yeah, okay.

#

I'll just let my self esteem drop to 0 here, but I'll try.

#

There are 500 different python to choose from?!

#

How am I supposed to know which one to download for windows?

#

THIS WHY I always stay at home to myself and never try to do anything, beccause I CAN'T EVER DO ANYTHING!

brazen raft
#

You should be fine downloading what it suggests in the homepage

#

Tbf I don't remember whether that button links to the page of all downloads or immediately downloads the latest version of Python to your system

ebon ocean
#

It downloads a version.

#

I just assume it the correct one.

brazen raft
#

In any case the latest stable version is 3.12.3 if memory serves right

#

Do you know what your operating system is and what processor you have?

ebon ocean
#

Windows 10 and no idea the processor. I am really bad with computers.

#

I'm installing the python thing now.

#

A very slow and long download.

brazen raft
#

Make sure to add Python to path and allow administrator privileges if it wants to install the py.exe launcher under C:\Windows\System32

#

Oh you went ahead

ebon ocean
#

I just guessed and hit install.

brazen raft
#

https://docs.python.org/3/tutorial have fun reading some

ebon ocean
#

Still installing.

#

Done.

#

And the errors that are not actually errors are still there.