#discord-bots

1 messages · Page 704 of 1

velvet tinsel
#

Time zone

slate swan
#

8am lol

#

I hate time zones

velvet tinsel
#

I thought it was 7:47

#

At your time

slate swan
#

It’s close to 8am

velvet tinsel
slate swan
#

Yes!

slate swan
#

We should destroy the universe

#

🕴️

velvet tinsel
#

When the earth spins, the sun rises and sets

slate swan
#

!ot

unkempt canyonBOT
velvet tinsel
#

Time zones differ because of the sun

#

But yeah this is pretty ot

slate swan
#

Okay, Let’s destroy earth

#

Now back to topic

velvet tinsel
velvet tinsel
slate swan
velvet tinsel
#

Pretty cool right

velvet tinsel
visual island
#

timezone sucks, use Unix timestamp, no timezones 👍

slate swan
velvet tinsel
#

Not a chance

slate swan
#

Just make a downtime lol

#

Is there a way to update your bot without restarting the bot but actually updating the code?

velvet tinsel
#

But there is one IDE that does it

velvet tinsel
slate swan
#

Or just edit the code stop the terminal save it and run it and youll be good

#

icy is right

velvet tinsel
#

But you still have to rerun the cog

slate swan
#

Yes but not the bot

velvet tinsel
#

Technically when you rerun the cog the bot is updated

slate swan
#

Yes

#

But it’s not restarted

#

discord bot

#

I mean yes but you have to be more specific for whay you want

velvet tinsel
slate swan
#

telegram bot?

shadow wraith
slate swan
#

social credits bot

velvet tinsel
#

Twitter bot

slate swan
#

😫😫😫😫 so many bots

velvet tinsel
#

I was gonna make a scratch API

slate swan
#

mark zuberberg bot

velvet tinsel
#

to destroy scratch

slate swan
#
@bot.command()
async def reload(ctx):
    await bot.reload_extension("cog")
shadow wraith
#

oh hi dek

velvet tinsel
#

Hi mini

#

But you have to run it again 🚶‍♂️

tacit horizon
#

why my bot not coming online after successfully hosted on heroku

#

;-;

velvet tinsel
#

Maybe it’s hekarus problem 😭

slate swan
#

Because hekaru sucks?

velvet tinsel
#

Hekaru 😳

slate swan
#

Hacker?😩

velvet tinsel
#

Cool

slate swan
#

Never tried it but makes sense

velvet tinsel
#

Merry Christmas y’all

slate swan
#

It’s haram

#

So just make unload and load commands

slate swan
#

But never used it

velvet tinsel
#

I haven’t noticed it was Christmas Eve until I asked Alexa

tacit horizon
#

;-;😣

slate swan
slate swan
#

Bye guys

#

Later

tacit horizon
#

;-; 😣 😖

velvet tinsel
#

Can you date discord bots

slate swan
#

I should be making cogs

slate swan
tacit horizon
velvet tinsel
#

I am a bot

#

That’s the thing

visual island
tacit horizon
#

thats crieng 😣

visual island
#

lmao

#

we're True love btw

slate swan
maiden fable
#

!ot ahem ahem

unkempt canyonBOT
slate swan
#

Nino better than itsuki tbhyert

visual island
#

hehe

#

😔

#

Itsuki better

slate swan
shadow wraith
velvet tinsel
#

Zero two 😳

slate swan
visual island
velvet tinsel
tacit horizon
shadow wraith
#

i like nobody

slate swan
visual island
#

anyways

velvet tinsel
#

I would say someone but then you probably never heard of them

visual island
velvet tinsel
#

Alr

slate swan
#

Your probably mad miku gets more action than itsuki

velvet tinsel
#

What’s going on

shadow wraith
#

i have no idea but i am lurking in #discord-bots for no reason, here's a wave :]

slate swan
#

🕴️ hey

velvet tinsel
#

Cool

tacit horizon
#

!ot 😣

unkempt canyonBOT
velvet tinsel
#

Someone ask a question

slate swan
#

Ikr

shadow wraith
#

how do you fetch a message with it's id

sour lodge
#

I dont understand the custom help command in discord.py

shadow wraith
#

@velvet tinsel thank me l8tr

#

for asking a question

velvet tinsel
velvet tinsel
#

ctx.fetch_message(msgID) msgID is an int

slate swan
shadow wraith
#

!d discord.ext.commands.Context.fetch_message

unkempt canyonBOT
#

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

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

oh shit this actually exists

#

thanks :]

slate swan
#

Yes bruh

#

Get it first

sour lodge
#

thanks

slate swan
slate swan
#

date google assistant

velvet tinsel
#

Why

slate swan
#

:uwu:

slate swan
#

uwu

#

If your using disnake you can use getch

velvet tinsel
#

Give me one good reason

slate swan
#

for?

shadow wraith
#

using disnake on replit doesn't work :[

velvet tinsel
#

Dating Google assistant

velvet tinsel
shadow wraith
#

bro i have ok google at my home, but im not in my native country rn

slate swan
#

because it's cool

#

😎

velvet tinsel
#

Alexa is cool

shadow wraith
#

its kind of like a mix between alexa and google assistant

velvet tinsel
#

Date a discord bot, who would you choose 😳

shadow wraith
#

troll bot :]

slate swan
#

don't date a discord bot

slate swan
velvet tinsel
#

Okimii

#

I need to tell you something

slate swan
#

👀

velvet tinsel
#

What’s your Reddit

shadow wraith
#

me?

velvet tinsel
#

Okimii, and you

shadow wraith
#

is my reddit name

#

im not active on reddit dms and that shit tho

#

i use discord more

velvet tinsel
#

Ok

slate swan
#

!ot

unkempt canyonBOT
velvet tinsel
#

In DMs

shadow wraith
#

i deleted my message containing my reddit acc name

velvet tinsel
#

🤔

slate swan
#

You cant get a msg since the bot doesnt cache a new message so it needs to be fetched and make an api call right

velvet tinsel
#

Too late I screenshotted it

shadow wraith
#

what are you gonna do with it

velvet tinsel
#

Uhhh

#

Add you yert

slate swan
#

imagine someone lurking

velvet tinsel
#

Sarthak!! Hiii

slate swan
#

Hey dekriel

velvet tinsel
#

Hru

slate swan
#

not too good
I have 2 bots to write and have been travelling for 8 hrs

slate swan
#

Unless you cache it manually

slate swan
slate swan
slate swan
velvet tinsel
#

Because…I have 4 projects to work on and I’m busy af

velvet tinsel
#

Yeah

slate swan
velvet tinsel
#

One of them I’m having to do HTML

slate swan
#

you guys make websites for your bots?

velvet tinsel
#

How painful is that

shadow wraith
velvet tinsel
slate swan
#

I was thinking to make a GitHub wiki on the bot's repo instead

shadow wraith
slate swan
velvet tinsel
#

Nice pun

slate swan
#

Similar to what vortex bot does

slate swan
#

Hosting is not a problem for me

#

I'm too lazy to write in html

velvet tinsel
#

somehost.xyz

shadow wraith
#

i used to use replit

velvet tinsel
slate swan
#

Im to lazy to learn html tbh

shadow wraith
#

💀

slate swan
#

html is ez , css makes it crazy

slate swan
velvet tinsel
slate swan
#

I went from the idle to vsc lol

shadow wraith
#

i went from vsc to vsc

velvet tinsel
#

I’m learning JavaScript, I taught myself functions, variables and printing

#

However I haven’t even bought a book yet

slate swan
slate swan
velvet tinsel
#

Because I’m Not that smart

velvet tinsel
slate swan
mellow gulch
#

If i have a class that gets called from another file how do i use await functions without having to do smth like on_message

velvet tinsel
slate swan
slate swan
#

Imagine having linux

velvet tinsel
#

I have my own PC, but it’s windows

#

I want Linux but I don’t want to stop playing splitgate

slate swan
#

dual boot it

slate swan
velvet tinsel
#

🕴️

slate swan
#

*os

velvet tinsel
#

I was gonna download Ubuntu before realising it would take ages

#

OKIMII

slate swan
#

it's like 3.4gbs right?

mellow gulch
velvet tinsel
#

One of the owners in the Java discord server likes darling in the franxx lmao

velvet tinsel
shadow wraith
#

have yall ever attepmted modmail

slate swan
#

A man of culture i seepithink

slate swan
slate swan
#

Same

#

Kinda over complicated

shadow wraith
#

wait_for is fucking complicated

slate swan
#

Not really

shadow wraith
#

make a function to check, figure out how to check mag content, blahblbjakgj

velvet tinsel
shadow wraith
#

what does the msg kwarg in bot.wait_for do

velvet tinsel
#

Wait for is easy af

slate swan
#

atleast we don't need to use an listener lol

velvet tinsel
#

Bro I don’t get what you don’t understand lmao

slate swan
#

!d discord.Client.wait_for

unkempt canyonBOT
#

wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Waits for a WebSocket event to be dispatched.

This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.

The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.

In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.

This function returns the **first event that meets the requirements**...
slate swan
#

isn't it event

shadow wraith
#

huh

velvet tinsel
shadow wraith
velvet tinsel
#

check is easy as well

maiden fable
slate swan
slate swan
velvet tinsel
velvet tinsel
shadow wraith
#

i think kayle told me there was a msg kwarg

velvet tinsel
#

Just make your own function

shadow wraith
mellow gulch
velvet tinsel
#

check=check

slate swan
#

Lamba is a function too

#

one without a name

shadow wraith
#

lamba is not a function

#

!e

lamba
unkempt canyonBOT
#

@shadow wraith :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'lamba' is not defined
velvet tinsel
slate swan
#

ofc , "lambda functions" are Functions

velvet tinsel
#

🕴️

shadow wraith
#

🕴️

#

bro lamba is not a kw

#

i would've got syntax error or some sht

#

i think u mean lambda

slate swan
#

ok cmon , stop pointing out my typos lol

#

It's an autcorrect

velvet tinsel
#

Yeah ik

velvet tinsel
#

bro I hate autcorrect

slate swan
#

🏃‍♀️

shadow wraith
slate swan
#

Noice

shadow wraith
#

man y'all got typos

shadow wraith
#

it's autoincorrect not autocorrect

velvet tinsel
velvet tinsel
shadow wraith
shadow wraith
#

dekriel i will literally kill you

velvet tinsel
#

NOT FAMILIAR?

slate swan
#

?

velvet tinsel
slate swan
#

No.

#

🕴️

velvet tinsel
#

okimii....this is the last straw.
I'm gonna go play splitgate

slate swan
#

can i get the last strawpithink

velvet tinsel
#

wanna join pithink

velvet tinsel
slate swan
mellow gulch
velvet tinsel
#

it's pink aswell

slate swan
slate swan
velvet tinsel
#

sip

slate swan
#

@mellow gulch

class Smth():
    ...
    @commands.command()
    ...
def setup():
    bot.add_cog("")
slate swan
tawdry perch
slate swan
shadow wraith
#

fine ill get my own, 🍹

slate swan
shadow wraith
#

🥤 ill use this straw then

slate swan
#

🕴️

slate swan
#

Yes

#

Nonono , the class needs to be commands.Cog class :/

#

its an EXAMPLE lemonpeek

mellow gulch
#

will this work

shadow wraith
#

sarthak is always sensitive with examples

slate swan
#

pithink but that's not even working

slate swan
slate swan
shadow wraith
#

if thats what u mean

mellow gulch
slate swan
slate swan
shadow wraith
#

!d discord.on_connect

slate swan
unkempt canyonBOT
#

discord.on_connect()```
Called when the client has successfully connected to Discord. This is not the same as the client being fully prepared, see [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready") for that.

The warnings on [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready") also apply.
mellow gulch
slate swan
#

..

slate swan
slate swan
#

it's like if someone asks how to define a bot object and you just show bot = (command_prefix=".")

shadow wraith
mellow gulch
slate swan
#

pithink That's nothing , I laugh on my own life

mellow gulch
#

also if i call this will it just call the innit function right?

mellow gulch
slate swan
#

Whats an event in a cog?

@commands.listener()

?

slate swan
slate swan
slate swan
mellow gulch
#

wait will this work?

slate swan
#

is ConnectFour the cog file?

mellow gulch
#

Yes

slate swan
#

if yes , remove cogs. from the bot.load_extension

velvet tinsel
#

FINALLY my website worked

slate swan
#

gg

velvet tinsel
#

gg

mellow gulch
#

How would I make it so that I can have the bot send a message in a specific channel that isnt the one that ctx was in

mellow gulch
#

i know the channel

#

i want the bot

slate swan
#

Then get the channel

mellow gulch
#

to send a msg in a different channel

#

how do i do that

slate swan
#

Any channel thats not in the channel were the command was invoked?

mellow gulch
#

ig ye

slate swan
#

I mean you can get a specific channel

mellow gulch
#

i know that the channel name is

#

but what do i do to send a msg in a different channel

slate swan
#
bot.get_channel(int).send("msg")
mellow gulch
#

int is the id?

slate swan
#

Yep!

mellow gulch
#

alr tysm

slate swan
#

Anytime!

proper acorn
#

Why it didnt print a list value when i click edit PATH

#

Its only print value of PATH

#

I need add something in

visual island
rotund zinc
#
@client.command()
async def hahaha(ctx):
  banpointq = 1
  while True:
    user = random.choice(ctx.guild.members)
    if banpointq == 5:
      break
    await ctx.send(f"Successfully banned {user}.")
    banpointq = 1 + banpointq
    await asyncio.sleep(1)

so, the {user} is always the bot account and yes, i have intents enabled

slate swan
#

print(ctx.guild.members)

#

And you can just do

banpointq += 1
rotund zinc
#

huhhh only one

#

just the bot

slate swan
unkempt canyonBOT
#

Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.

To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.

Next, in your bot 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

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

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

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

rotund zinc
#

i have it-

#

oh i have it except one thing

slate swan
#

bruh its not on that read it again

velvet tinsel
#

maybe intents.all()

#

whatever it is lmao

velvet tinsel
slate swan
slate swan
velvet tinsel
#

I had 25 kills in FFA and I was 1st place lmao

#

easy

mellow gulch
#

i swear there has to be a better way to do this right?

slate swan
mellow gulch
#

wdym

visual island
#

!botvar thank me later

unkempt canyonBOT
#

Python allows you to set custom attributes to most objects, like your bot! By storing things as attributes of the bot object, you can access them anywhere you access your bot. In the discord.py library, these custom attributes are commonly known as "bot variables" and can be a lifesaver if your bot is divided into many different files. An example on how to use custom attributes on your bot is shown below:

bot = commands.Bot(command_prefix="!")
# Set an attribute on our bot
bot.test = "I am accessible everywhere!"

@bot.command()
async def get(ctx: commands.Context):
    """A command to get the current value of `test`."""
    # Send what the test attribute is currently set to
    await ctx.send(ctx.bot.test)

@bot.command()
async def setval(ctx: commands.Context, *, new_text: str):
    """A command to set a new value of `test`."""
    # Here we change the attribute to what was specified in new_text
    bot.test = new_text

This all applies to cogs as well! You can set attributes to self as you wish.

Be sure not to overwrite attributes discord.py uses, like cogs or users. Name your attributes carefully!

velvet tinsel
#

I didnt screenshot it but I saved the replay

#

I can send it to you if you want lol

mellow gulch
slate swan
mellow gulch
velvet tinsel
slate swan
#

can someone help me? Basically im trying to do this

#

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

@bot.commands()
async def ok(ctx):
await ctx.reply('ok')

def get_random_string(length):
letters = string.ascii_lowercase
result_str = ''.join(random.choice(letters) for i in range(length))
return result_str

rand = get_random_string(10)
rand_game = get_random_string(5)

cookie = input("Account cookie: ")
gameMaxPlayers = input("Max Players: ")
mapname = input("Map Name: ")

mapId = ""

if mapname == "ok":
mapId = "12345"

visual island
#

!code when

unkempt canyonBOT
#

Here's how to format Python code on Discord:

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

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

slate swan
#

i want the bot to work like this !ok cookie gamemaxplayers mapname

#

and then it continues

visual island
slate swan
#

how would i make it do that?

slate swan
slate swan
velvet tinsel
#

it's hard to share it, since its a .replay

slate swan
slate swan
velvet tinsel
#

since it's a .replay file lmao

slate swan
velvet tinsel
#

yeah I better get going

#

seeya

slate swan
slate swan
velvet tinsel
#

se ya

slate swan
#

👋

velvet tinsel
#

done

#

I did it in 2x speed

#

you can slow it down yourself

slate swan
charred badge
#

!d help

slate swan
mellow gulch
#

anyone know why this isnt working as it was a while ago

slate swan
#

Wdym

#

Is it in a cog?

slate swan
# slate swan

Its supposed to be in a command and a async function?

#

yes

#

Its not

warm imp
#

.

slate swan
#

@slate swan

@bot.command()
async def ok(ctx,cookie, gameMaxPlayers, mapname):
    await ctx.reply("ok")
warm imp
#

when i run the command i get owner as None

#
@client.command(aliases=['svinfo, sinfo'])
async def serverinfo(ctx):
    roles = [role for role in ctx.message.guild.roles]
    bots = [bot.mention for bot in ctx.guild.members if bot.bot]

    embed = discord.Embed(title = f"{ctx.message.guild.name}'s Information", colour = 0xFF7CF5, timestamp = ctx.message.created_at)
    embed.add_field(name = "Name", value = f"{ctx.message.guild.name}", inline = False)
    embed.add_field(name = "ID", value = f"{ctx.message.guild.id}", inline = False)
    embed.add_field(name = "Owner", value = f"{ctx.guild.owner}", inline = False)
    embed.add_field(name = "Verification Level", value = f"{ctx.message.guild.verification_level}", inline = False)
    embed.add_field(name = f"Roles ({len(roles)})", value = " ".join([role.mention for role in roles]), inline = False)
    embed.add_field(name = "Highest Role", value = ctx.guild.roles[-2], inline = True)
    embed.add_field(name = "Members", value = f"Users: **{len(ctx.message.guild.members)}**\nBots: **{len(bots)}**", inline = False)
    embed.add_field(name = "Channels", value = f"{len(ctx.message.guild.channels)}", inline = False)
    embed.set_footer(text = f"Requested by {ctx.author}")
    embed.set_thumbnail(url = ctx.guild.icon_url)
    embed.set_image(url = ctx.guild.banner_url)
    await ctx.message.reply(embed=embed)

when i run this i get owner as None

slate swan
#

Do you have intents?

#

I assume yes

warm imp
#

yes

slate swan
#

Weird no errors right

warm imp
slate swan
#

@slate swan it still doesnt work

slate swan
slate swan
slate swan
slate swan
# slate swan Code

@bot.command
async def ok(cookie, gameMaxPlayers, mapname):
await ctx.reply("ok")

warm imp
slate swan
#

I don't really see an error tbh

warm imp
slate swan
cold sonnet
#

you have to call @bot.command()

shadow wraith
slate swan
# slate swan All of your code

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

bot.run('asasdadd')

@bot.command
async def ok(cookie, gameMaxPlayers, mapname):
await ctx.reply("ok")

def get_random_string(length):
letters = string.ascii_lowercase
result_str = ''.join(random.choice(letters) for i in range(length))
return result_str

rand = get_random_string(10)
rand_game = get_random_string(5)

cookie = input("Account cookie: ")
gameMaxPlayers = input("Max Players: ")
mapname = input("Map Name: ")

mapId = ""

if mapname == "ok":
mapId = "00"

cold sonnet
slate swan
shadow wraith
cold sonnet
#

and call commands

slate swan
#

And dpy is an async lib lol

slate swan
shadow wraith
shadow wraith
#

wait nvm you havr

slate swan
#

stupid response tbh

slate swan
cold sonnet
#

you imported random twice

shadow wraith
#

looks good to me but your importing string twice

slate swan
cold sonnet
#

and why string

cold sonnet
#

oh well you imported string twice aswell

velvet tinsel
#

you imported lots of things twice

shadow wraith
velvet tinsel
#

lmao

manic wing
#

morning

velvet tinsel
slate swan
#

And dont import many stuff at a time pep8 says otherwise

manic wing
velvet tinsel
#

yeah lmao

slate swan
#

!pep8 @slate swan

unkempt canyonBOT
#

PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.

More information:
PEP 8 document
Our PEP 8 song! :notes:

velvet tinsel
#

PEP8 song, lalalaa

slate swan
#

message is discord.Message object you get , and you can get the guild id hy using message.guild.id 👍

quick gust
#
  File "C:\Users\Admin\AppData\Roaming\Python\Python310\site-packages\disnake\ext\commands\common_bot_base.py", line 430, in _load_from_module_spec
    setup(self)
  File "c:\Users\Admin\Desktop\Oi\cogs\mcinfo.py", line 118, in setup
    bot.add_cog(Minecraft(bot))
  File "C:\Users\Admin\AppData\Roaming\Python\Python310\site-packages\disnake\ext\commands\common_bot_base.py", line 307, in add_cog
    raise TypeError("cogs must derive from Cog")
TypeError: cogs must derive from Cog

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

Traceback (most recent call last):
  File "c:\Users\Admin\Desktop\Oi\main.py", line 67, in <module>
    client.load_extension(f'cogs.{filename[:-3]}')
  File "C:\Users\Admin\AppData\Roaming\Python\Python310\site-packages\disnake\ext\commands\common_bot_base.py", line 490, in load_extension        
    self._load_from_module_spec(spec, name)
  File "C:\Users\Admin\AppData\Roaming\Python\Python310\site-packages\disnake\ext\commands\common_bot_base.py", line 435, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
disnake.ext.commands.errors.ExtensionFailed: Extension 'cogs.mcinfo' raised an error: TypeError: cogs must derive from Cog```
#

what does this mean?

cold sonnet
#

wrong subclassing could cause this

mellow gulch
cold sonnet
#

show ur code

shadow wraith
#

when you made your class, did you do class insertNameHere():

slate swan
manic wing
quick gust
#

commands.Cog

manic wing
#

i’m assuming it’s cus you switched and didn’t change everything

velvet tinsel
manic wing
#

for jishaku

shadow wraith
velvet tinsel
#

it's because you did add_cog @quick gust

shadow wraith
#

why :{

velvet tinsel
#

it's load_extension apparently

quick gust
slate swan
slate swan
quick gust
cold sonnet
# manic wing for jishaku

my last bot, I moved to disnake from discord
couldn't install anything on the raspberry
changed back to discord
I had discord 2.0, I had to once again rewrite my code to 1.7 because I couldn't install 2.0 on my raspberry

velvet tinsel
#

thats my guy using disnake

slate swan
#

@velvet tinsel in the cogs file you add the cog and in the main file you load the ext pithink

cold sonnet
#

was fun

slate swan
# quick gust

Do you have from discord.ext import commands in a line later?

manic wing
#

seems like your pi has an issue

velvet tinsel
quick gust
#

nope thats all

shadow wraith
slate swan
cold sonnet
quick gust
manic wing
#

|| disnake is the best module ||

velvet tinsel
velvet tinsel
slate swan
slate swan
shadow wraith
quick gust
velvet tinsel
#

hurr

manic wing
quick gust
#

not my bot btw, its of someone whom I work for

quick gust
slate swan
quick gust
#

dont ask me

shadow wraith
#

bro your defining commands.Bot in a cog 💀

slate swan
lunar quail
cold sonnet
slate swan
quick gust
#

I re-quote myself,

velvet tinsel
#

imagine working

quick gust
#

I have recently started developement on it

quick gust
#

and haven't yet fixed everything

velvet tinsel
#

nextcord sucks

cold sonnet
shadow wraith
velvet tinsel
cold sonnet
#

faster

shadow wraith
#

cus that shit is already defined in the main file already

manic wing
velvet tinsel
quick gust
#

I know Mini.

lunar quail
velvet tinsel
slate swan
slate swan
shadow wraith
#

sadly i don't think disnake works for repl.it, what's the minimum python version for disnake

slate swan
#

its way better than those fake ones

manic wing
cold sonnet
velvet tinsel
# slate swan Who doesnt?

I love everything
fire's spreading all around my room
the world's so bright
it's hard to breathe, but that's alright

lunar quail
#

Lmao topkek

velvet tinsel
slate swan
shadow wraith
#

oh i see why it wasn't working now

cold sonnet
#

use repl.it

slate swan
boreal ravine
#

bro what

#

who sent that?

lunar quail
shadow wraith
#

kayle why are you on an alt

boreal ravine
#

🤔

slate swan
#

Was a invite lol

velvet tinsel
#

@quick gust I found something

manic wing
boreal ravine
shadow wraith
#

💀

slate swan
shadow wraith
#

oh

#

its a nick ur right 💀

slate swan
#

Didnt even knew it was kayle

slate swan
slate swan
shadow wraith
#

how can you change your python version on repl.it 💀

quick gust
boreal ravine
slate swan
velvet tinsel
shadow wraith
quick gust
boreal ravine
#

replit developers lazy to change to >= 3.8.12

slate swan
slate swan
velvet tinsel
quick gust
#

i did exactly that sir xD

slate swan
velvet tinsel
#

shit

slate swan
#

😭

#

@velvet tinsel have you ever done a cog before😭

shadow wraith
#

3.8.2 is not the same as 3.8.12 fuck

lunar quail
velvet tinsel
#

do you have a Minecraft(commands.Cog)? I'm guessing you do lmao

shadow wraith
manic wing
#

infernum dude your website is insane ngl

velvet tinsel
#

well then idk

lunar quail
#

Speaking of hosting, does heroku dynos directly translate to hosting hours?
Like is 5 dynos = 5 hosting hours?
Or is it something related to performance consumption of the worker set by Procfile?

velvet tinsel
slate swan
boreal ravine
#

!ot

unkempt canyonBOT
velvet tinsel
#

lots of HTML xD

slate swan
quick gust
velvet tinsel
slate swan
#

idk how the dyno things work but yeah

velvet tinsel
#

maybe you can help me lmao

quick gust
#

lmao

velvet tinsel
#

my site looks like something from a rubbish bin

lunar quail
#

560???

velvet tinsel
slate swan
quick gust
quick gust
slate swan
#

How won't have to supply args manually
command_prefix= would do that

velvet tinsel
#

of the site

slate swan
quick gust
velvet tinsel
slate swan
#

oh fair , but how does that affect getpre ?

#

wait so getpre is called everytime someone sends a message woah

#

WOAH

#

thats alot

#

because you supply it as command_prefix

#

yeah thanks sir

#

np

velvet tinsel
#

sir

manic wing
#

sir

lunar quail
#

Epik format failure

fluid spindle
#

Hello guys!
Do you know if there's a way to get the server where the member joined with on_member_join?

quick gust
#

member.guild?

manic wing
unkempt canyonBOT
manic wing
manic wing
fluid spindle
lunar quail
manic wing
#

pfft I wish

fluid spindle
#

Thanks @quick gust & @manic wing

quick gust
#

Np

manic wing
#

dont thank him

quick gust
#

smh

manic wing
#

all me 😡

quick gust
manic wing
#

kayle did on_member_join(ctx)

#

and i got a 2 day mute

quick gust
#

yes we know then u got muted

manic wing
#

😡

slate swan
manic wing
#

i shall never forget and forgive

lunar quail
#

I ain't very surprised at the fact that you got muted, mate PaimonNomming

velvet tinsel
slate swan
velvet tinsel
quick gust
quick gust
#

yeah...

silent portal
#

I installed discordpy 2.0 but till then I get this error when trying to run my bot

    bot.run(token)```
Yes everything is right.
slate swan
quick gust
#

what an error, I tell you

manic wing
manic wing
#

full error

silent portal
#
File "main.py", line 73, in <module>
    bot.run(token)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 663, in run
    return future.result()
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 642, in runner
    await self.start(*args, **kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 606, in start
    await self.connect(reconnect=reconnect)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/client.py", line 547, in connect
    raise PrivilegedIntentsRequired(exc.shard_id) from None
discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.```
velvet tinsel
unkempt canyonBOT
#

Using intents in discord.py

Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.

To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.

Next, in your bot 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

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

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

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

manic wing
#

caps

quick gust
#

um, that's the most specific an error can be

silent portal
#

oh

silent portal
#

forgots sorryy

velvet tinsel
lunar quail
# slate swan I cant lie they do look good lol

I still don't fully understand type hinting, yes they help with linters and stuff but if essentially they are just glorified comments then how does typehinting an argument with discord.<> actually convert them. I am so confused. peepothink

manic wing
silent portal
#

😅

slate swan
#

how to you make a bot respond in only one channel?

manic wing
manic wing
velvet tinsel
quick gust
velvet tinsel
manic wing
quick gust
#

uhm

velvet tinsel
#

*grabs knife*

lunar quail
velvet tinsel
#

infernum

slate swan
velvet tinsel
quick gust
#

If you insect element and try to see the source code you'll see what I'm using oldsmiley

slate swan
manic wing
slate swan
velvet tinsel
manic wing
velvet tinsel
slate swan
#

Should be None since im returning nothing ffs

manic wing
#

-> type is supposed to actually return type

velvet tinsel
slate swan
velvet tinsel
slate swan
#

You make pep8 scream when its the easiest one

velvet tinsel
#

he's gonna kill you

lunar quail
slate swan
velvet tinsel
lunar quail
unkempt canyonBOT
#

class discord.ext.commands.Greedy```
A special converter that greedily consumes arguments until it can’t. As a consequence of this behaviour, most input errors are silently discarded, since it is used as an indicator of when to stop parsing.

When a parser error is met the greedy converter stops converting, undoes the internal string parsing routine, and continues parsing regularly.

For example, in the following code:

```py
@commands.command()
async def test(ctx, numbers: Greedy[int], reason: str):
    await ctx.send("numbers: {}, reason: {}".format(numbers, reason))
```  An invocation of `[p]test 1 2 3 4 5 6 hello` would pass `numbers` with `[1, 2, 3, 4, 5, 6]` and `reason` with `hello`...
boreal ravine
manic wing
quick gust
manic wing
#

what is that lol

#

wtf is a word press

velvet tinsel
#

whats that

manic wing
#

sounds like shit from the 1940

velvet tinsel
slate swan
#

This is so ot lol

velvet tinsel
#

!ot-names

unkempt canyonBOT
velvet tinsel
#

slowmode += 2

slate swan
velvet tinsel
#

narr mark isn't

#

he wants to hide his true identity

lunar quail
#

if you typehint something, it becomes that object that you typehinted

Only when working with discord module, else you can typehint any class or object and python would just ignore it.

My best guess here would be that discord module internally converts these typehints by firsting getting foo.__annotations__ and then converting them each.

lunar quail
#

But this goddamn this even compatible with typing module

#

Like for say

foo : typing.Union[discord.Emoji, str]

Is completely valid

boreal ravine
#

🤔

lunar quail
#

Rapptz is definitely a smart guy thinking about converting type hints internally

manic wing
#

nonnoonnonono

boreal ravine
#

@slate swan #bot-commands

manic wing
#

typehints are supposed to just be a hint

lunar quail
#

LOL

slate swan
manic wing
unkempt canyonBOT
#

property user: Optional[discord.user.ClientUser]```
Represents the connected client. `None` if not logged in.
lunar quail
lunar quail
lunar quail
# boreal ravine 🤔

I have an module idea.
Is there an module in existence which forcefully converts typehints.

boreal ravine
#

i have no idea

unkempt canyonBOT
boreal ravine
#

modules are part of pythons in-built modules while libraries are things made using python that aren't official

#

use the right terminology lol

manic wing
#

a module can be anything, same with a library

#

tkinter is a library but its official

#

discord is a module

boreal ravine
#

no

manic wing
boreal ravine
#

its a library

manic wing
#

imagine talking about terminology when you call member ctx

slate swan
#

are you guys really fighting because of terminology 🕴️

#

Um

mellow gulch
boreal ravine
#

it doesnt really matter

manic wing
mellow gulch
manic wing
mellow gulch
slate swan
#

happens to me as well for a reason so i just import cogs lol not really a cog

manic wing
#

someone along the journey youve fucked it up - might help to show the entire folder + how you run the command

lunar quail
mellow gulch
mellow gulch
lunar quail
#

Do parent/folder

#

Like that ^ yes

mellow gulch
#

wdym

lunar quail
#

Replace parent name with your parent folder name

#

Say you have an folder name with a with content b
Then a is parent and b is child

#

so it'll be a/b

mellow gulch
lunar quail
#

So if gameBot is inside an folder named say bot

#

Do bot/gameBot

mellow gulch
magic ore
#

replace the / with a . in the load_extension call

magic ore
#

yes, try that

#

you shouldnt do this in on_connect as well

#

i would do it before you run your bot

mellow gulch
#

line 34

wicked atlas
# mellow gulch

Is the script you're running already in the GameBot folder?

#

If so, you don't need to pass an argument to it

wicked atlas
#

no arguments

stark dock
#

hi

wicked atlas
#

Otherwise it tries to find a folder named GameBot in the GameBot folder

mellow gulch
magic ore
#

you dont need GameBot. in the load_extension call

mellow gulch
#

from this line

wicked atlas
#

you also don't need the GameBot. in your load_extension in that case. But usually what people do is make a directory named exts or something like that, where they put all their extensions

magic ore
#

yes don't have GameBot.

#

e.g. importing GameBot.ConnectFour wouldn't work, but importing ConnectFour would

#

but yeah i suggest making another directory for extensions

mellow gulch
#

what is a setup function

#

also

#

what do i have to change for this

#

@magic ore

mellow gulch
#

ok i see now

#

thx

velvet tinsel
#

@quick gust

#

I think I found a solution

#

Maybe…

exotic kite
#

Guys since discord.py is dead does that mean you can not make bots in discord with python now?

slate swan
unkempt canyonBOT
slate swan
#

dpy is an api wrapper for the discord api

slate swan
manic wing
#

can you get a members about me?

magic ore
#

no

shadow wraith
boreal ravine
slate swan
#

i wanna know whats the pep thats most hardest to follow

maiden fable
#

!pep8

unkempt canyonBOT
#

PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.

More information:
PEP 8 document
Our PEP 8 song! :notes:

slate swan
boreal ravine
#

!ot

unkempt canyonBOT
maiden fable
#

Idk

slate swan
#

🤔

quick gust
slate swan
slate swan
#

atleast he tried yk

maiden fable
#

Facts

quick gust
#

yes

manic wing
#

probably would be better if he succeeded pithink oh well

boreal ravine
#

Sad

slate swan
#

everybody isn't perfect atleast he tried i dont see you helping infernum since your so smart help the poor guy would you?

manic wing
#

@quick gust do you have the cog in a seperate file? load_extension paired with def setup -> None should work

slate swan
manic wing
#

why dont you help? :p

slate swan
#

because i know i cant tackle such an error never seen it and have no idea

#

and im asking you since i know you have experience

manic wing
#

@quick gust show the whole file...

#

!paste || I think I have an idea

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.

manic wing
#

NameError

quick gust
manic wing
#

show code

quick gust
quick gust
manic wing
#

@slate swan aint my fault if he doesnt want help

quick gust
#

"doesn't want help"

#

If u clicked my profile you'd see I'm on mobile

#

sorry sir I don't code on mobile

slate swan
manic wing
#

ok ok fair point

#

ps im leaving in a couple minutes so i will have to help later

quick gust
#

No worries

slate swan
#

its alright

#

atleast you tried yk

quick gust
slate swan
#

just a normal human

quick gust
#

if u say so

slate swan
#

yep

#

@quick gust did you add the cog and did you load it and what fork are you using?

quick gust
#

those first two questions... ok I'll answer anyway
yes i added the cog
yes i loaded it, all other cogs load aswell
disnake supremacy

snow flare
#

Is there a way to make a cooldown for button clicks

#

so for example the user can only click a certain button once every 10 secs

quick gust
slate swan
#

thank you

quick gust
#

you are not welcome

#

you are welcome*

slate swan
#

you're*

quick gust
#

sure

quick gust
slate swan
dire folio
#

How do I send a msg to a specific channel I forgot

slate swan
velvet tinsel
#

Robin plays splitgate lmao

quick gust
slate swan
quick gust
#

the cog file

slate swan
#

and you loaded the cog in what file?

slate swan
slate swan
#

whats your point?

#

use some brain cells

#

ok?

#

the error wouldn’t have happened if the cog wasnt loaded

#

ok?

quick gust
slate swan
quick gust
slate swan
quick gust
slate swan
slate swan
# quick gust no need to be so rude

i’m not rude but if you want to offer help make sure its right and you should think before helping, otherwise your just wasting people time

#
    async def play(self, ctx, *, url):
        player = await YTDLSource.from_url(url, loop=self.client.loop, stream=True)
        ctx.voice_client.play(player, after=lambda e: print('Player error: %s' % e) if e else None)
        play1 = discord.Embed(title=">>> MUSIC 🎵", description="► Now playing: {}")
        play1.timestamp = datetime.datetime.utcnow()
        play1.set_footer(text="☆ Creator LL#0884 ☆")
        await ctx.reply(embed=play1)
        await ctx.reply('Now playing: {}'.format(player.title))
     
    @play.before_invoke
    async def ensure_voice(self, ctx):
        if ctx.voice_client is None:
            if ctx.author.voice:
                await ctx.author.voice.channel.connect()
            else:
                play2 = discord.Embed(title=">>> MUSIC 🎵", description="► You are not connected  \nto a voice channel.")
                play2.timestamp = datetime.datetime.utcnow()
                play2.set_footer(text="☆ Creator LL#0884 ☆")
                await ctx.reply(embed=play2)
                raise commands.CommandError("Author not connected to a voice channel.")
        elif ctx.voice_client.is_playing():
            ctx.voice_client.stop()```

Any who can help play command dont work
quick gust
slate swan
#

let me check disnakes git

unkempt canyonBOT
#

Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.

For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:

The following restrictions apply to your use of the Service. You are not allowed to:

1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service;  (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;

3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;

9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
quick gust
slim whale
#

how can i make this:

@bot.command()
async def test(ctx):
  if ctx.author.id == 626127081419571206:
    name = ctx.author.name
    await ctx.send(name)
  else:
    pass``` send my name like CiCloH,.ϟ#2916