#discord-bots

1 messages · Page 758 of 1

vale wing
#

As for me, it's more convenient to press win+v and search the emoji that I need rather than go to that website, search for the code and then insert it to here. That's very personal

slate swan
#

;-;

vale wing
slate swan
#

I mean ,

#

!charinfo ➡️

unkempt canyonBOT
ember magnet
#

channel = await bot.fetch_channel(payload.channel_id) message = await channel.fetch_message(payload.message_id) reaction = discord.utils.get(message.reactions, emoji=payload.emoji.name) await reaction.remove(payload.member)

It works thanks again xD

heavy radish
#

the If Role == Unlock part, is just incase someone manually locked the channel before 1 min. Will that work?

honest vessel
#

@placid skiffinstead of miles of if-statements u can do it other ways.

#
import random


#self.embed_colour = ["blue", "blurple", "brand_green", "brand_red", "dark_blue", "dark_gold", "dark_grey",
#                             "dark_magenta", "dark_orange", "dark_purple", "dark_red", "dark_teal", "dark_theme",
#                             "darker_grey", "fuchsia", "gold", "green", "greyple", "light_grey",
#                             "lighter_grey", "magenta", "og_blurple",
#                             "orange", "purple", "red", "yellow", "teal"]
#
#async def choice_color(self):
#        color = choice(self.embed_colour)
#        if color == "blue":
#            return Colour.blue()
#        elif color == "blurple":
#            return Colour.blurple()
#        elif color == "brand_green":
#            return Colour.brand_green()
#        elif color == "dark_blue":
#            return Colour.dark_blue()
#        elif color == "dark_gold":
#            return Colour.dark_gold()
#        elif color == "dark_grey":
#            return Colour.dark_grey()
#        elif color == "dark_magenta":
#        ...


embed_colour = {"brand_green": "0x57F287", "green": "0x2ecc71"}

def choice_color():
    color = random.choice(list(embed_colour.values()))
    return color

print(choice_color())
``` example or 
```py
embed_colour = {"blurple": Colour.blurple(), "green": Colour.green()}
cobalt jacinth
#

is it possible to get args in this way
?command <integer > <mention> <mention>....

honest vessel
#

like two members?

#

why wouldt it

boreal ravine
#

or you could use commands.Greedy or use the * symbol in the command, both do the same thing iirc

cobalt jacinth
#

how to get the id of the mentions like this ?
for i in args[1:]:
i.mentions.id

boreal ravine
cobalt jacinth
#

all the arguments ..first one is interger rest all must be mentions

boreal ravine
#

whats the type of args[1:]

cobalt jacinth
#
async def whitelist(ctx,*,args):
    for i in args[1:]:
        print(i.mentions.id)
#

like this

heavy radish
#

What's wrong with my COGs?

honest vessel
#

@cobalt jacinth```py
def test2(*args):
print(args)
for i in args[1:]:
print(i)

test2(5, "hello", "world")

output:
`(5, 'hello', 'world')
hello
world
`
#
def test2(number, *args):
    print(args)
    for i in args:
        print(i)
#

@cobalt jacinthhere pretty much ```py
@bot.command()
async def ping(ctx, number: int, *args: discord.Member):
for i in args:
print(i.id)

cobalt jacinth
#

ahhh thanku

honest vessel
#

@cobalt jacinth```py
@bot.command()
async def ping2(ctx, number: int, users: commands.Greedy[discord.Member]):
for i in users:
print(i.id)

#

both does same

fervent shard
slate swan
#

i have all gateway intents enabled but i still get an error 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

slate swan
#

they are all enabled

final iron
#

Hmm

fervent shard
final iron
#

Use

#

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

final iron
#

Put it in here. Pastebin formatting is fucked on mobile

boreal ravine
#

and show me your file directory

heavy radish
#

Thank You

boreal ravine
#

👍

heavy radish
#

BTW, I wont be doing it now but is it possible to do this

#

Create an event or listener command where when someone does RPG miniboss @player1, @player2, @player3, we give just the mentioned players a role?

heavy radish
heavy radish
#

ye

slate swan
#

ok how do i make it so that 1 = '=' and 2 = '==' and 3 = '===' etc.

#

bc im doing this game with like for loops and blah blah

final iron
slate swan
#

uh

#

shush

heavy radish
heavy radish
final iron
boreal ravine
#

theres literally an extension in discord.py for that

slate swan
#

wait

heavy radish
#

Yes, i meant like an on_message or on_ready

final iron
#

That's what he meant

#

You don't use an on_message for commands

heavy radish
#

i didn't know how to say it

#

Alr, a piece of code either listen or event with on_message, where I can add a role to the pinged users

#

Is that better?

slate swan
#
@bot.command()
async def pp(ctx, word=None):
    if word == None:
        await ctx.send(f'{ctx.message.author.mention}, You need to mention someone')
    else:
        rint = random.randint(1, 20)
        await ctx.send(f'8{rint}D')
#

ok i want the numbers to equal '='

#

so like 1 = '=', 2 = '=='

final iron
#

This is why I needed a use-case

slate swan
#

etc

final iron
#

Use string multiplication

heavy radish
final iron
#

!e

import random
print(f"8{random.randint(1, 9) * '='}D")
heavy radish
#

Imma go to bed. GN

final iron
#

Writing shit on mobile is so hard

final iron
#

What I wrote was wrong

slate swan
#

ok what if i did that

final iron
#

!e
import random
print(f"8{random.randint(1, 9) * '='}D")

unkempt canyonBOT
#

@final iron :white_check_mark: Your eval job has completed with return code 0.

8=====D
final iron
#

There

slate swan
#

thanks

pine crown
#

how to make a unban script and if they entered a wrong username and tag it will say that its wrong?

final iron
#

!d discord.Member.unban

unkempt canyonBOT
#

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

Unbans this member. Equivalent to [`Guild.unban()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.unban "discord.Guild.unban").
final iron
#

You can use this to unban a user

pine crown
#

just that?

#

ok

pine crown
# final iron You can use this to unban a user
@commands.has_permissions(ban_members=True)
@client.slash_command(description="Unbans a user")
async def unban(ctx, id: int = None):
  if id is None:
    embed=disnake.Embed(color=0xb30000, title="User not found", description="Please enter the ID of the user you want to unban.")
    await ctx.send(embed=embed)
  else:
    user = await client.fetch_user(id)
    await ctx.guild.unban(user)
    embed=disnake.Embed(color=0x00d60e, title=f"Successfully unbanned {user}", description=f"{user.name} has been successfully unbanned by {ctx.author.mention}")

I do this script and it says please enter a valid integer when i try to do it

final iron
#

Just typehint to discord.Member

pine crown
pine crown
final iron
#

member: discord.Member

pine crown
#

next?

final iron
#

Then unban them

#

No need to fetch the user

spring flax
#

No

#

How will that work

pine crown
#

?\

slim ibex
#

hello world

spring flax
final iron
#

Oh yeah I forgor

pine crown
# spring flax a member object is a user in the guild. If you try to unban a `discord.Member`,...

how do i fix it

@commands.has_permissions(ban_members=True)
@client.slash_command(description="Unbans a user")
async def unban(ctx, id: int = None):
  if id is None:
    embed=disnake.Embed(color=0xb30000, title="User not found", description="Please enter the ID of the user you want to unban.")
    await ctx.send(embed=embed)
  else:
    user = await client.fetch_user(id)
    await ctx.guild.unban(user)
    embed=disnake.Embed(color=0x00d60e, title=f"Successfully unbanned {user}", description=f"{user.name} has been successfully unbanned by {ctx.author.mention}")
slim ibex
pine crown
#

says this

slim ibex
#

instead of an id (int), i would do a user (disnake.Member)

slate swan
slate swan
spring flax
#

that also won't work, binds

slim ibex
#

oh didnt see that

#

well for unban, you can use member name and discriminator but you won't want to remember every banned users name LMAO

spring flax
#

Do this

async def unban(ctx, user : int):
  user_to_unban = discord.Object(user)
  await ctx.guild.unban(user_to_unban)
slate swan
#

Do this but , int(user) inside discord.Object

pine crown
spring flax
slim ibex
#

you could do a try except block with the MemberNotFound exception?

pine crown
spring flax
#

@slate swan also you can DM a discord.Object right? using send

pine crown
vale wing
slim ibex
#

you can make a bannedmember converter, and say if user is not BannedMember

slim ibex
placid skiff
tawdry perch
spring flax
#

yes

tawdry perch
#

I see

slate swan
#

nah

vale wing
slim ibex
# vale wing Does it really raise that error?
try:
  entry = await ctx.guild.get_ban(user)
except discord.NotFound:
  await user.send('You are not in the ban list')
  return
await ctx.send(f'{user.name} is in the ban list')

You could do something like this i think

vale wing
#

Yeah this is even better

#

Unban command is the one causing many questions

slim ibex
#

my unban uses member name and discriminator to unban, but then my ban is timed so it will automatically unban the user after the time

severe rampart
#

how does one

#

attach a button to an embed using disnake specifically

slim ibex
#

views

#

or something like that

placid skiff
severe rampart
#

the first thing i saw was having to make an entire class

slim ibex
#

!d disnake.Activity.buttons

unkempt canyonBOT
#

An list of dictionaries representing custom buttons shown in a rich presence. Each dictionary contains the following keys:

label: A string representing the text shown on the button.

url: A string representing the URL opened upon clicking the button.

New in version 2.0.

severe rampart
#

which i didn't want to do, given it seemed specific to one color

vale wing
#

It's simple if you look closer at the examples on disnake repo

slate swan
#

yo

severe rampart
#

hm.... interesting

slate swan
#

me dont got that

#

help

vale wing
#

I have my custom class for creating the views with buttons quickly tho

severe rampart
#

._.

severe rampart
#

wait- how are buttons actually useful lol-

slate swan
#

uh i dont got that

#

wtffffffff

slim ibex
#

idk if disnake has this, but it would look something like this on nextcord

class Dropdown(nextcord.ui.Select):
  def __init__(self, options: list[nextcord.SelectOption]):
    super().__init__(placeholder="Choose", min_values=1, max_values=1, options=options)
  
  async def callback(self, interaction: Interaction):
    ...
vale wing
severe rampart
#

well yeah

#

but besides for turning pages and stuff

slate swan
#

ok rip

severe rampart
#

like that at least

slim ibex
severe rampart
#

is what i just said

slim ibex
#

oh my fault

severe rampart
#

for like a poll or something?

#

but that would timeout quickly

vale wing
# slim ibex idk if disnake has this, but it would look something like this on nextcord ```py...

In disnake it is a bit easier, for example this a view with confirm button

class ConfirmView(disnake.ui.View):
    def __init__(self):
        super().__init__()
        self.result = None

    @disnake.ui.button(label='Confirm', style=disnake.ButtonStyle.green)
    async def confirm_button(self, *_): #dont mind I just ignore these args usually
        self.result = True
        self.stop()

Then you can do this where you need the view

view = ConfirmView()
await ctx.send(..., view=view)
await view.wait()
#and then we can get the result
print(view.result)```
#

You could simplify this by a lot tho

slim ibex
#

mhmm

vale wing
#

@severe rampart maybe this will help as well

severe rampart
#

it's alright :3

#

i kinda realized i don't really have a reason to use buttons

proud rain
#

Someone who has a meme command that they want to share?

solar anchor
#

how can i make smth work in only one server? (a guild)

I read it should be smth like @commands.guild_only() But this doesnt work for me?

slim ibex
#

guild_only makes the command only available in guilds and not in dms

solar anchor
#

oh

#

how could i make it so that it only changes the prefix in the guild the command is sent?

#
@Bot.command()
async def changeprefix(ctx, *, newprefix):
    Bot.command_prefix = str(newprefix)
    await ctx.send('changed the prefix to ' + '"' + newprefix + '"')


slim ibex
#

context.guild

solar anchor
#

where do i need to put that?

magic ore
#

probably want to use a database for this

solar anchor
#

ah okay

#

does any1 know why this doesnt work anymore

#

view=view

slim ibex
#

whats the view and embed

solar anchor
#
        view = View()
        view.add_item(button1)
        view.add_item(button2)
        view.add_item(button3)
        view.add_item(button4)
        view.add_item(button5)
        await ctx.send(embed=em, view=view)```
#

the problem is the view

#

embed is fine

#

yesterday it worked

#

and now i get this

slim ibex
#

what lib u using

solar anchor
#

i imported everything

#

but i just have normal python

slate swan
#

i tried to host my bot in visual studio code and i have from flask import Flask and it says ModuleNotFoundError: No module named 'flask'

slim ibex
slate swan
#

what should i do?

slim ibex
waxen granite
#
    @tasks.loop(seconds = 10)
    async def giveawaytask(self):
        for key in self.giveawaychan.keys():
            guild = self.bot.get_guild(int(key))
                    print(guild.id)
                    self.giveawaychan.pop(guild.id)```
its prints the guild.id still says Keyerror for last line
slim ibex
solar anchor
#

idk where to check my lib..

slate swan
solar anchor
#

sorry

potent spear
final iron
slim ibex
final iron
#

Let's see your imports

slim ibex
#

^

solar anchor
#

a lot

slate swan
#

mine?*

final iron
slate swan
#

ok

solar anchor
#

i have too many, but ill get rid of the unused ones later

potent spear
#

bruh

waxen granite
slim ibex
#

oh discord

solar anchor
#

yes

potent spear
slate swan
# slim ibex ^
from flask import Flask
from threading import Thread

app = Flask('')

@app.route('/')
def main():
    return "Rocket Beta#3167 is alive"

def run():
    app.run(host="0.0.0.0", port=8080)

def keep_alive():
    server = Thread(target=run)
    server.start()```
solar anchor
#

the weird thing is that view worked perfect all the days before and rn i start it and it doesnt work, as if theres been an update or sum

slim ibex
waxen granite
slate swan
slim ibex
#

thats how you usually start a flask app

potent spear
slate swan
slim ibex
#

it makes sure you don't accidentally run a script

slate swan
#

pls help

final iron
slate swan
#

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

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

lol

slate swan
#

kk

bitter depot
# slate swan kk

So ... on_member_update(before: discord.Member, after: discord.Member):

slate swan
#

still doesn’t work

#

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

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

Why are you doing after.before.activity?

#

It's just after.activity

slate swan
#

kk

#

@slate swan

#

yay i fixed it

unkempt canyonBOT
#
I'm sorry Dave, I'm afraid I can't do that.

No documentation found for the requested symbol.

final iron
#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
final iron
#

You can use this

#

Edit the message on loop

slate swan
#

yo can someone help me

#

for some reason i can’t invite my discord bot

#

in the url generator

#

i have also tried discord perms calculator

slim ibex
#

go to oauth2, url generator

#

and press bot

slate swan
#

hellooo. I have this code ```python
name = str(config['servername'])
em = nextcord.Embed(title=':green_circle: Server Is Online!', description="", color=orange)
em.set_author(name=name)
em.add_field(name = 'Online Playes:', value= str(events['clients'])+"/"+str(events['sv_maxclients']), inline = True)
em.add_field(name = 'Server Ip:', value= f"{ip}:{port}", inline = True)
await ctx.send(embed=em)

It works just fine, but i want to make it that every 1 min it updates the message to refresh the online members. Do you have any ideas how?
placid skiff
#

!d discord.ext.tasks.loop

unkempt canyonBOT
#

discord.ext.tasks.loop(*, seconds=..., minutes=..., hours=..., time=..., count=None, reconnect=True, loop=...)```
A decorator that schedules a task in the background for you with optional reconnect logic. The decorator returns a [`Loop`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop "discord.ext.tasks.Loop").
slate swan
slate swan
maiden fable
fervent shard
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.

final iron
#

Use this

maiden fable
#

It's fine

final iron
#

I prefer the syntax highlighting

#

Easier on the eyes than blinding white

fervent shard
final iron
maiden fable
final iron
#

Its not a large issue

maiden fable
#

Why not just use commands.Greedy or smth

#

!d discord.ext.commands.Greedy

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`...
fervent shard
final iron
maiden fable
fervent shard
#

oh

maiden fable
final iron
#

Literally never heard about that converter

maiden fable
#

I know too much, still I don't know anything

maiden fable
fervent shard
maiden fable
#

return warns[str(member.id)]

#

instead of return warns

#

since u wanna check for a single person, and not get each and every warn

final iron
#

@fervent shard You might want to invest some time in to learning a proper database

maiden fable
#

or just use discdb indeed

slim ibex
#

🤨

fervent shard
# maiden fable since u wanna check for a single person, and not get each and every warn

like this instead?

def save_warn(ctx, member: discord.Member):
    with open('warns.json', 'r') as f:
         warns = json.load(f)

         warns[str(member.id)] += 1

    with open('warns.json', 'w') as f:
         json.dump(warns, f)

def remove_warn(ctx, member: discord.Member, amount: int):
    with open('warns.json', 'r') as f:
         warns = json.load(f)

         warns[str(member.id)] -= amount

    with open('warns.json', 'w') as f:
         json.dump(warns, f)
    
def warns_check(member: discord.Member):
    with open('warns.json', 'r') as f:
         warns = json.load(f)

         warns[str(member.id)]
         return warns[str(member.id)]```
maiden fable
#

I prefer u learn MongoDB

final iron
#

discdb?

slim ibex
#

oh no

#

not the JSOn database

maiden fable
final iron
#

You need more documentation

maiden fable
#

Its on my profile

final iron
#

And examples

maiden fable
final iron
#

I wouldn't say its shit but its unnecessary

#

No offense but using normal databases isn't much of a hassle

maiden fable
#

It was just a challenge given to me, a long ago when I was new to this server

final iron
#

It might be unnecessary but why quit the project?

#

It's something nice to show off

#

And who knows, maybe people will use it some day

fervent shard
maiden fable
#

it was like: I challenge u to make it a proper module in 30 min

#

And I did it in 15-20 minutes or smth haha

final iron
#

Still cool that you made a package

maiden fable
maiden fable
fervent shard
maiden fable
#

Hmm mind pasting yr command code?

final iron
maiden fable
#

*Damn something is really wrong about my WiFi

final iron
#

I actually think you desperately need more examples though

fervent shard
# maiden fable Hmm mind pasting yr command code?
@bot.command()
@commands.has_permissions(manage_roles=True)
async def warn(ctx, member: discord.Member, *, reason=None):
  save_warn(ctx, member)
  if member == ctx.author:
    em2 = discord.Embed(description=f"**you** cannot `mute` yourself", colour=discord.Color.red())
    await ctx.send(embed=em2)
  else:
      em=discord.Embed(description=f"{member.mention} has been `warned` for {reason}", colour=discord.Colour.green())
      em1=discord.Embed(description=f"{member.mention}, you have been `warned` for {reason}", colour=discord.Colour.green())
      await member.send(embed=em1)
      await ctx.send(embed=em)```
spring flax
#

how do you get timestamps in the footer of an embed that adjust them to the time? Like if an embed is sent today, it will say today at [time] but it if it is sent yesterday it will say yesterday at [time].
Is this normal behavior of datetime.datetime,utcnow()?

final iron
#

I don't really understand it

maiden fable
maiden fable
final iron
#

Yeah

spring flax
maiden fable
#

I guess??? You can use any timezone BTW

slate swan
#

you just pass in any timestamp inside that , discord updates it according to itself

maiden fable
#

yea, just like unix timestamps

maiden fable
fervent shard
waxen granite
#

Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
how do i send the perms the bot is missing when this error occurs?

slate swan
#

already told ya , u need to use @bot_has_permissions checks

#

or you wont be able to handle that error

maiden fable
unkempt canyonBOT
fervent shard
slate swan
#

on whom?

maiden fable
fervent shard
waxen granite
maiden fable
fervent shard
#

example:
?warn @fervent shard bc i want to

slate swan
maiden fable
#

try adding debug prints

fervent shard
maiden fable
#

Print random things on every other line, to see which lines are getting called

waxen granite
fervent shard
maiden fable
#

Yea

#

but print different things so that u ca differentiate between lines

fervent shard
#

or every command

maiden fable
#

most common thing people print are numbers

maiden fable
waxen granite
#
    if isinstance(error, commands.BotMissingPermissions):
        return await ctx.send(f"I do not have permission to do that.\nThis may be due to either I am missing perms to do it or the member's perms are higher than mine.")

i have done this in on_command_error before but this doesnt work

slate swan
# waxen granite so for each cmd then?

yea , the check is a must for each command ,
you can have a global error handler which checks if error is an instance or commands.BotMissingPermissions example : py @bot.command() @bot_has_permissions(send_messages=True , embed_links=True) async def cmd(... and in the error handler ```py
@bot.event
async def on_command_error(ctx , error):
if isinstance(error , commands.BotMissingPermissions):

slim ibex
#

its commands.MissingPermissions

maiden fable
slate swan
waxen granite
#

missingperms is for commandInvoker not having perms, and BotMissingperms is for bot missing perms, i want help regarding the latter.

slim ibex
#

you can also do specific command specific error stuff

@command()
async def kick():
  ...

@kick.error
async def kick_error(ctx, exc):
  ...
slate swan
#

cause no checks check the other user's hierachy

fervent shard
#

no

maiden fable
#

@fervent shard found the problem?

fervent shard
maiden fable
#

Show yr latest code with the print statements

honest vessel
#

so, bot constructor in sublass or no. what is best?

sage otter
slate swan
honest vessel
#

bot_has_permission()

slate swan
sage otter
#

I thought you were talking about general hierarchy.

solar anchor
#

why does view=view not work anymore?

slate swan
#

Because you haven't defined the view variable 🤷

solar anchor
slate swan
#

Well I can tell for a fact that it still works and exists.

solar anchor
#

yesterday it worked and i didnt change a thing

#

hmm

#

weird

#

it says this for me

slate swan
#

You are running discord.py 1.7.3 and not 2.0, make sure you install that version.

solar anchor
#

how?

#

in the terminal?

warm flame
#

does anyone know how to upload your bot to google cloud?

analog barn
#

uh hey... so i'm making a discord bot,

@ethan.command()
@commands.has_role("newcomers")
async def login(et, arg, user: discord.Member):

^ (the line of code that's causing the issue)

and I need the discord.Member part to see what roles the discord user has...

But it returns this error:

Missing arguments: user is a required argument that is missing.
#

have I done something wrong?

warm flame
#

user: dicord.Member = None? idk

analog barn
#

no, that wouldn't work

warm flame
#

basically ur not specifying the user

analog barn
#

discord.Member IS specifying the user

#

its specifying the author of the command

#

I think

warm flame
#

cant u just arg.author?

solar anchor
#

send the whole code

analog barn
#

okay

solar anchor
#

below that

analog barn
#
@ethan.command()
@commands.has_role("newcomers")
async def login(et, arg, user: discord.Member):
    if arg == "76455":
        code = "76455"
# CODE ROLE IS REMOVED BECAUSE THERE IS PROFANITIES.
        role = discord.utils.find(lambda r: r.name == f'{CODE_ROLE}', et.message.server.roles)
        if role in user.roles:
            await ethan.say("{} already has this role.".format(user))
        else:
            # await ethan.add_roles(user, role)
            # await ethan.remove_roles(user, "newcomer")
            await et.send("test")

    if arg == "80427":
        code = "80427"
# CODE ROLE IS REMOVED BECAUSE THERE IS PROFANITIES.
        role = discord.utils.find(lambda r: r.name == f'{CODE_ROLE}', et.message.server.roles)
        if role in user.roles:
            await ethan.say("{} already has this role.".format(user))
        else:
            await ethan.add_roles(user, role)
            await ethan.remove_roles(user, "newcomer")

    if arg == "56354":
        code = "56354"
# CODE ROLE IS REMOVED BECAUSE THERE IS PROFANITIES.
        role = discord.utils.find(lambda r: r.name == f'{CODE_ROLE}', et.message.server.roles)
        if role in user.roles:
            await ethan.say("{} already has this role.".format(user))
        else:
            await ethan.add_roles(user, role)
            await ethan.remove_roles(user, "newcomer")

    if arg == "97036":
        code = "97036"
# CODE ROLE IS REMOVED BECAUSE THERE IS PROFANITIES.
        role = discord.utils.find(lambda r: r.name == f'{CODE_ROLE}', et.message.server.roles)
        if role in user.roles:
            await ethan.say("{} already has this role.".format(user))
        else:
            await ethan.add_roles(user, role)
            await ethan.remove_roles(user, "newcomer")

the arg and code things are just examples for rn

warm flame
#

what is et and what is arg?

analog barn
#

et substitutes for ctx

analog barn
#

yes-

final iron
#

Then use them

solar anchor
#
@ethan.command()
@commands.has_role("newcomers")
async def login(et,arg, member: discord.Member):

maybe try this

warm flame
#

are you trying to get the user that sent the message?

analog barn
#

hm

#

yes

#

so i can access its roles

analog barn
#

i find it looks more clean

final iron
analog barn
#

and f strings are ugly imo

warm flame
#

i think ctx.author does the trick, although idk ive just been fixing bugs the whole week

velvet tinsel
solar anchor
#

i still dont get why view=view doesnt work anymore ):

quick gust
#

Krypton answered you

#

you are most likely using dpy 1.7.3

solar anchor
#

im using python 3.10.1

warm flame
solar anchor
#

and i imported a lot of things

solar anchor
quick gust
analog barn
solar anchor
#

how do i change it

#

how?

analog barn
#

first go in your terminal

#

and run pip list

#

and next to it is ur version

#

if its not version 2 and it says 1.7.3

#

then run

velvet tinsel
#

iirc it's pip --upgrade

solar anchor
analog barn
#

pip --upgrade discord.py

velvet tinsel
grim oar
#

Your command uses outdated stuff @analog barn

solar anchor
#

should i do that ot?

analog barn
#

really?

#

damn

#

what is the updated version of it then?

#

I don't know haha

grim oar
#

There should be some page in docs which lists the updated stuff, will help in migration

solar anchor
#

so i dont do pip --upgrade discord.py?

analog barn
#

do it anyway

grim oar
#

pip install --upgrade discord.py

analog barn
solar anchor
solar anchor
#

or wait

analog barn
#

got it

solar anchor
grim oar
#

it's Member.remove_roles now

analog barn
#

okay

#

await ethan.add_roles(member, role)
await ethan.remove_roles(member, "newcomer")

#

these are fine right

solar anchor
grim oar
solar anchor
#

but then why doesnt view=view work

#

):

#
        view = View()
        view.add_item(button1)
        view.add_item(button2)
        view.add_item(button3)
        view.add_item(button4)
        view.add_item(button5)
        await ctx.send(embed=em, view=view)```
grim oar
#

maybe because the one on pypi doesn't have a view impl, idk, install from github in that case

solar anchor
#

it worked yeserday and i didnt change anything

grim oar
#

!d discord.ui.View

unkempt canyonBOT
#

class discord.ui.View(*, timeout=180.0)```
Represents a UI view.

This object must be inherited to create a UI within Discord.

New in version 2.0.
grim oar
#

Bruh

#

It's in 2.0

#

install from github

solar anchor
#

what?

slate swan
#

As I already said before.

solar anchor
slate swan
analog barn
#

what is the updated version of this?

await ethan.add_roles(member, role)
await ethan.remove_roles(member, "newcomer")
slate swan
#

To install the development version, do the following:
...

#

Following that will lead to the version 2.0 being installed.

solar anchor
#

okay thnx

#

can i do it cmd?

slate swan
#

Yes, you have to.

solar anchor
#

what do i need to use instead? is it -

#

nrvm

#

it still doesnt work

#

@slate swan

slate swan
#

Remove the $

solar anchor
#

i did

slate swan
#

And do you have vit installed?

solar anchor
#

it installed

#

yes

analog barn
#

okay

analog barn
solar anchor
#

@slate swan @slate swan idk whats happend now but

slate swan
#

discord.commands is not a thing

solar anchor
#

when i get rid of it it fixes that but the original problem is still there

analog barn
#

I need discord.Member to get the user's roles,

#

hm

analog barn
#

so I can't just REMOVE discord.Member

#

because its essential to the command

cerulean scaffold
#

Hello.

I am trying to make an event where an embed updates when someone reacts to the message and adds their username to the list. Effectively if i react with a tick - it will add my name to "Attending" and if i react with a cross it adds it to "Not attending" - ive been trying a while and i just don't know how to make this work. I'm not sure how to edit an embed either.

slim ibex
#

!d discord.on_raw_reaction_add

unkempt canyonBOT
#
I don't think so.

No documentation found for the requested symbol.

#

discord.on_raw_reaction_add(payload)```
Called when a message has a reaction added. Unlike [`on_reaction_add()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_reaction_add "discord.on_reaction_add"), this is called regardless of the state of the internal message cache.

This requires [`Intents.reactions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.reactions "discord.Intents.reactions") to be enabled.
slate swan
#

^

slim ibex
#

!d discord.Message.edit

unkempt canyonBOT
#

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

Edits the message.

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

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

heyy. i have this but it doenst send the message after 2 sec```python
@tasks.loop(seconds=5.0)
async def print(ctx):
await ctx.send("lol")
await asyncio.sleep(2)

@j1mk0l.command()
async def info(ctx):
j1mk0l.loop.create_task(print(ctx))

final iron
slate swan
#

i have to send the command every time after 5 sec?

final iron
#

No

slate swan
#

i want to spam lol by itself

#

not spam, send it after 2 sec

final iron
#

Then put in seconds=2 and remove the sleep

slate swan
final iron
#

Try starting it in the __init__ if you're in a cog or anywhere if you're in your main file

dire folio
#

Is there a Spotify api or smth, cause I want to make a cmd where you could look at different playlists and see what songs are in them

slate swan
#
@j1mk0l.command(pass_context=True)
async def update_member_count(ctx): 
    await ctx.send(ctx.guild.member_count)
    channel = nextcord.utils.get(ctx.guild.channels, id=933001079648555008)
    await channel.edit(name = f'Member Count: {ctx.guild.member_count}')


@tasks.loop(minutes=1)
async def update_member_count2(ctx):
    await update_member_count(ctx)

velvet tinsel
#

there should be iirc

slate swan
#

doent update

velvet tinsel
slate swan
#

doesnt update*

#

haha

waxen granite
#

Is there a way to know what perms the bot will need for executing a cmd?

dire folio
slate swan
analog barn
#

I've managed to get my issue solved from earlier, but presents a new error.

@ethan.command()
@commands.has_role("newcomers")
async def login(et,arg,user: discord.Member=None):
    
    if arg == "76455":
# REDACTED FOR PROFANITY
        role = discord.utils.find(lambda r: r.name == f'{CODE_ROLE}', et.message.guild.roles)
        if role in user.roles:
            await et.send(f"You already have role: `{CODE_ROLE}`, and thus it has not been presented to you.")
        else:
            await user.add_roles(role)
            await user.remove_roles("newcomer")
        
    if arg == "80427":
# REDACTED FOR PROFANITY
        role = discord.utils.find(lambda r: r.name == f'{CODE_ROLE}', et.message.guild.roles)
        if role in user.roles:
            await et.send(f"You already have role: `{CODE_ROLE}`, and thus it has not been presented to you.")
        else:
            await user.add_roles(role)
            await user.remove_roles("newcomer")

    if arg == "56354":
# REDACTED FOR PROFANITY
        role = discord.utils.find(lambda r: r.name == f'{CODE_ROLE}', et.message.guild.roles)
        if role in user.roles:
            await et.send(f"You already have role: `{CODE_ROLE}`, and thus it has not been presented to you.")
        else:
            await user.add_roles(role)
            await user.remove_roles("newcomer")

    if arg == "97036":
# REDACTED FOR PROFANITY
        role = discord.utils.find(lambda r: r.name == f'{CODE_ROLE}', et.message.guild.roles)
        if role in user.roles:
            await et.send(f"You already have role: `{CODE_ROLE}`, and thus it has not been presented to you.")
        else:
            await user.add_roles(role)
            await user.remove_roles("newcomer")

redacted for profanity includes: code_role, which is the role name, and code, which is, well, the code.
arg is an example until i can get this fixed.

dire folio
#

No I mean

@tasks.loop(minutes=1)
async def update_member_count(ctx):
    #stuff
analog barn
dire folio
analog barn
#

I know.

#

but I don't know what went wrong

dire folio
#

What is et?

analog barn
#

et is supposed to substitute for ctx

dire folio
#

Why don't u just use ctx?

analog barn
#

because i always use et

slate swan
#

Good evening

dire folio
#

Good evening

dire folio
analog barn
#

I just told you it was redacted for profanity

#

and explained what they are

dire folio
#

But like what if the problem is in that

slate swan
#

the user is none

#

the error says it all

analog barn
#

I thought so too

#

but i was told to put that

#

because i need the discord.User object to get the users roles

slate swan
#

you should call the command with the member

#

!e

a = None
print(a.split(" "))
unkempt canyonBOT
#

@slate swan :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | AttributeError: 'NoneType' object has no attribute 'split'
slate swan
#

see it raises a nonetype error^

analog barn
#

the code is supposed to listen for a specific message thats put in the args after .login

#

so i can't just call the command with me mentioning the member

#

because .login (arg) @member is ugly

dire folio
#

What do you want the cmd to look like?

slate swan
#

and what are you trying to do?

analog barn
#

and .login (arg) is what im going for

cerulean scaffold
#

i have this error:
TypeError: list indices must be integers or slices, not str

i am using embed.to_dict() to turn my embed into a dictionary, so that I can reuse the details to create a new embed. Although it appears that with the fields i have, it has created a dictionary inside of a dictionary. When trying to treat it as such, i get the error.

The line:
name = content['fields']['name']

The dict:
{'fields': [{'name': 'Attending', 'value': 'Nobody Attending', 'inline': True}], 'type': 'rich', 'description': "Start Time: 7:00 \n\n End Time: 14:00.", 'title': 'test:'}

dire folio
analog barn
#

that's what im trying to figure out

slate swan
analog barn
#

I want it to get the message author's roles

#

so it can check if a specific role is there or not, then if it isn't it would add the role

slate swan
#

then use the author attr

cerulean scaffold
#

@slate swan so i need to use an int?

slate swan
analog barn
#

message.author.role ?

slate swan
#

no

#

you have no message

#

et.author.roles

analog barn
#

yk what i mean by message

#

i know

slate swan
#

since ctx is et in this case

analog barn
#

again- i know-

slate swan
#

then why ask?

keen talon
slate swan
analog barn
#

no i mean the message and the ctx thing-

#

ah nvm

#

im just dum

slate swan
dire folio
#

Lol

slate swan
#

commands have contextpithink

analog barn
#

trolling

keen talon
#

Ctx and message are similar but not same

slate swan
#

ctx: commands.Context

slate swan
keen talon
analog barn
#
if role in et.author.roles:
            await et.send(f"You already have role: `{CODE_ROLE}`, and thus it has not been presented to you.")
        else:
            await user.add_roles(role)
            await user.remove_roles("newcomer")
#

so here's the thing

slate swan
analog barn
#

maybe the et.author.roles thing would work

#

however

keen talon
analog barn
#

et.author.add_roles would not

slate swan
#

its basic oop

#

yes it would

analog barn
#

it's not showing up as a valid function

slate swan
#

author returns a member

analog barn
#

am i just dumb

#

hold on

keen talon
#

Don't share screenshot lol

slate swan
vale wing
analog barn
#
@ethan.command()
@commands.has_role("newcomers")
async def login(et,arg):
    
    if arg == "76455":
# redacted cuz nsfw

        role = discord.utils.find(lambda r: r.name == f'{CODE_ROLE}', et.message.guild.roles)
        if role in et.author.roles:
            await et.send(f"You already have role: `{CODE_ROLE}`, and thus it has not been presented to you.")
        else:
            await et.author.add_roles(role)
            await et.author.remove_roles("newcomer")
rugged laurel
#

from discord.ext import commands
from prsaw import RandomStuff
bot = commands.Bot(command_prefix=">")

rs = RandomStuff(async_mode = True)

@bot.event
async def on_message(message):
if message.channel.id == 933060166121832478:
if bot.user == message.auther:
return

await bot.process_commands(message)
response = await rs.get_ai_response(message.content)
await message.reply(response)

TOKEN = "******************************************"
bot.run(TOKEN)

can anyone tell me what im doing wrong?

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
unkempt canyonBOT
#

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

doesnt work
analog barn
#

oH

slate swan
analog barn
#

today is not my day

keen talon
#

You should learn python properly first pithink

rugged laurel
#
from prsaw import RandomStuff 
bot = commands.Bot(command_prefix=">")

rs = RandomStuff(async_mode = True)

@bot.event
async def on_message(message):
    if message.channel.id == 933060166121832478:
        if bot.user == message.auther:
            return


    await bot.process_commands(message)
    response = await rs.get_ai_response(message.content)
    await message.reply(response)



TOKEN = ""
bot.run(TOKEN)```


can anyone help me? with launching this and getting it to work
analog barn
#

well hold on

slate swan
#

please dont say that herepithink

devout iris
#

command_prefix = when_mentioned_or()

analog barn
vale wing
devout iris
#

it is triggering when i send everyone

rugged laurel
#

can anyone help me with launching my bot?

slate swan
devout iris
#

:D

quick gust
vale wing
#

I would typehint and compare it to a number anyway

rugged laurel
quick gust
#

Send the traceback

analog barn
#

ok welp

#

ONE LAST THING

#

await et.author.remove_roles("newcomer")

analog barn
#

this doesn't remove roles.

slate swan
#

can your bot remove a role?

vale wing
analog barn
#

ooookay

#

got it

quick gust
analog barn
#

so it has to be an object not a string

quick gust
vale wing
#

!d discord.Member.remove_roles

unkempt canyonBOT
#

await remove_roles(*roles, reason=None, atomic=True)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).

Removes [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s from this member.

You must have the [`manage_roles`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_roles "discord.Permissions.manage_roles") permission to use this, and the removed [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")s must appear lower in the list of roles than the highest role of the member.
analog barn
unkempt canyonBOT
#

Hey @rugged laurel!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

slate swan
#

helloo. I have this command and i want to loop it that it edit the message everyo 20 sec. How can i do that? ```python

@j1mk0l.command()
async def edit(ctx, msg_id: int = None, channel: nextcord.TextChannel = None):
if not msg_id:
channel = j1mk0l.get_channel(932989135004786688)
msg_id = 933043619399610438
elif not channel:
channel = ctx.channel
name = str(config['servername'])
em = nextcord.Embed(title=':green_circle: Server Is Online!', description="", color=orange)
em.set_author(name=name)
em.add_field(name = 'Online Playes:', value= str(events['clients'])+"/"+str(events['sv_maxclients']), inline = True)
em.add_field(name = 'Server Ip:', value= f"{ip}:{port}", inline = True)
msg = await channel.fetch_message(msg_id)
await msg.edit(embed=em)
await asyncio.sleep(20)

rugged laurel
#

this is my error traceback

vale wing
#

Also you don't need elif there

spring verge
#

Was wondering if I should consider ddos protection for a bot?

quick gust
#

No not really

slate swan
vale wing
#

Yeah ddos protection is more like for sites

devout iris
devout iris
#

if i know wrong, warn me

vale wing
quick gust
#

I haven't seen/heard anyone attempting to ddos a discord bot, that's most probably them just trying to ddos the server instead

slate swan
#

they dont ddos the bot but the server or vps its in

cerulean scaffold
#

my project really has me stumped. Im trying to have an environment where there is an embed that the bot sends out. Users can react to that embed and it adds them to an "attending" list. However each time the on_reaction_add event occurs, the dictionary does not update.

Snippet of the code: https://pastehub.net/e7070ecfba5

quick gust
#

That's what I said

slate swan
spring verge
rugged laurel
#

ok i will try that

spring verge
#

Like I am considering to buy gg vps

slate swan
quick gust
vale wing
#

If it's not a big project you can just setup a firewall lol

spring verge
slate swan
quick gust
#

(infact a service provider should have DDoS protection for their hosting as a must)

unkempt canyonBOT
#
Nuh-uh.

No documentation found for the requested symbol.

vale wing
#

It's in tasks subpckg

honest vessel
#

@spring vergei can recommend vultr or digitalocean, i used digitalocean before but am more with vultr atm, 5$ for a month, enough for one or few bots

keen talon
rugged laurel
#

im still getting the same erro

quick gust
rugged laurel
#

error*

vale wing
cerulean scaffold
#

my project really has me stumped. Im trying to have an environment where there is an embed that the bot sends out. Users can react to that embed and it adds them to an "attending" list. However each time the on_reaction_add event occurs, the dictionary does not update.

Snippet of the code: https://pastehub.net/e7070ecfba5

rugged laurel
#

i get the same error with every .py file i try to run

#

somewhat atleast

slate swan
rugged laurel
#

its always some problem importing libraries

honest vessel
#

@rugged laurelwhats the errors?

slate swan
slate swan
#

you simply cannot import such a thing

rugged laurel
slate swan
vale wing
#

!e

from typing import NoReturn```
unkempt canyonBOT
#

@vale wing :warning: Your eval job has completed with return code 0.

[No output]
vale wing
#

Works

spring verge
#

@vale wing so it costed u 6 dollars with ddos protection included?

slate swan
wicked quest
vale wing
spring verge
keen talon
rugged laurel
#
ImportError: cannot import name 'NoReturn'```
honest vessel
#

@cerulean scaffoldcause the attending is cleared each time a new reaction is added, u need to move that list to like global or inside a class and use self.attended = [] self.attended.append(user) kinda

rugged laurel
#

still got the error

wicked quest
#

i prob will never get ddos prot cuz of the amount of requests im sending to it xD

vale wing
wicked quest
#

@rugged laurel What are you trying to do?

vale wing
#

!e
print('NoReturn' == 'NoReturn')

unkempt canyonBOT
#

@vale wing :white_check_mark: Your eval job has completed with return code 0.

True
rugged laurel
spring verge
rugged laurel
#

atleast for now

wicked quest
#

and whats the no return thing for?

slate swan
wicked quest
#

lol

cerulean scaffold
#

@honest vessel im only really just getting into learning python as its something we've picked up at my school, so i've not done classes, only basic procedures/functions. You are saying to add those who have reacted to attending to a list, and then make that list be what is displayed?

rugged laurel
vale wing
#

I remember how I created e girl AI chatbot (that was very weird)

wicked quest
#

👏 Learn 👏 classes 👏

devout iris
#

Can i make a command for see how many messages from an user in that server?

rugged laurel
slate swan
#

ai doesnt make it fancy

rugged laurel
#

tried hundreds of different classes

wicked quest
#

rolley why do you need the typing library anyways?

devout iris
#

Can i make a command for this?

cloud dawn
#

morning yall

honest vessel
cerulean scaffold
rugged laurel
#

but like

wicked quest
vale wing
rugged laurel
#

its like i cant run any python file

wicked quest
#

when you can learn classes and async

unkempt canyonBOT
#

When adding functions or classes to a program, it can be tempting to reference inaccessible variables by declaring them as global. Doing this can result in code that is harder to read, debug and test. Instead of using globals, pass variables or objects as parameters and receive return values.

Instead of writing

def update_score():
    global score, roll
    score = score + roll
update_score()

do this instead

def update_score(score, roll):
    return score + roll
score = update_score(score, roll)

For in-depth explanations on why global variables are bad news in a variety of situations, see this Stack Overflow answer.

honest vessel
#

classes are very nice

rugged laurel
#

i also tried to download a python chatbot that was already made and it didnt work either

vale wing
wicked quest
#

@rugged laurel What is your goal

rugged laurel
#

idk why i cant run

spring verge
#

@vale wing Is it fine if I dm again regarding gg

wicked quest
#

What tf does typing library even do 💀

cloud dawn
wicked quest
rugged laurel
vale wing
wicked quest
#

but thats very resource-exhausting

#

yeah lol

honest vessel
#

classes can be confused first look, but when u get it - its awesome @cerulean scaffold i would recommend doing simple classses and play around, like a class Person: make functions that can edit data of persons etc

wicked quest
#

it could work tho

quick gust
wicked quest
#

just a bit slower

rugged laurel
wicked quest
vale wing
#

Usually the bot that is made for stats just stores the data since it was invited

rugged laurel
#

k

wicked quest
#

if ur trying to make a chatbot just use a chatbot api

#

or make ur own ai

rugged laurel
#

i did

cloud dawn
#

In this Python Object-Oriented Tutorial, we will begin our series by learning how to create and use classes within Python. Classes allow us to logically group our data and functions in a way that is easy to reuse and also easy to build upon if need be. Let's get started.

Python OOP 1 - Classes and Instances - https://youtu.be/ZDa-Z5JzLYM
Python...

▶ Play video
rugged laurel
#

i have tried all different chatbot apis

wicked quest
#

and?

cerulean scaffold
wicked quest
#

what doesnt work

rugged laurel
#

ive visited almost every yt video on the topic

#

and it says theres no errors

#

but when i try to run i always get error

slate swan
#

didnt knew bots were so hard to make

wicked quest
#

they arent

slate swan
#

^

wicked quest
slate swan
#

ik

cloud dawn
rugged laurel
#

well when using tensorflow or any other

slate swan
slate swan
rugged laurel
#

its always error importing

wicked quest
slate swan
wicked quest
slate swan
honest vessel
#
class Person:
    def __init__(self, Name, Age):
        self.name = Name
        self.age = Age

     def changename(self, Name):
         # sets new name
         self.name = Name

# Add a person
person1 = Person("Bob", 101)
person1.changename("Bob Hund") #changes name
``` you can learn n play around with classes with stuff like this n see how shit works together @cerulean scaffold keep it simple,
rugged laurel
#

yet i imported it

cerulean scaffold
#

@wicked quest we have other things on the syllabus we are still learning, and that is when my teacher is going to teach it. That has no effect on the difference in time it would take to learn, but alright.

slate swan
rugged laurel
#

from typing import NoReturn
ImportError: cannot import name 'NoReturn'

#

mostly this

wicked quest
slate swan
rugged laurel
cloud dawn
slate swan
wicked quest
slate swan
#

welp im gonna make an api wrapper see ya guyspithink

slate swan
honest vessel
#

@cloud dawn:D yeah am not so much pep8

honest vessel
#

@slate swantoo sloooow brotha!

slate swan
slate swan
wicked quest
#

api wrappers seem boring to make

wicked quest
#

although i woudnt know

slate swan
wicked quest
#

its prob pretty fun

honest vessel
#

@cloud dawndef i spammed space, thing was just the visual

cloud dawn
#

!e ```py
class Person:
def init(self, Name, Age):
self.name = Name
self.age = Age

 def changename(self, Name):
     # sets new name
     self.name = Name

Add a person

person1 = Person("Bob", 101)
person1.changename("Bob Hund") #changes name

print(person1.name)

unkempt canyonBOT
#

@cloud dawn :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 6
002 |     def changename(self, Name):
003 |                                ^
004 | IndentationError: unindent does not match any outer indentation level
wicked quest
#

i would do it but i dont have an idea on what to make the wrapper for

cloud dawn
#

lmfao

wicked quest
#

lmao

honest vessel
#

i could have made it in paint

slate swan
cloud dawn
wicked quest
cloud dawn
slate swan
wicked quest
#

i would make one but everything is already made 🥱

honest vessel
#

i guess u care more about pep8 if others are going to view ur codes 👼🏻

cloud dawn
honest vessel
#

^

slate swan
wicked quest
#

tell me a bad api wrapper

slate swan
cloud dawn
wicked quest
#

why would you copy an api

slate swan
wicked quest
wicked quest
slate swan
#

its a website that searches for apis mr

honest vessel
#

rapid-api too

cloud dawn
#

Huge pp for who coded this.

slate swan
#

im just making a private api wrapper to learn mostly

slate swan
#

big chad

wicked quest
#

ok guys

honest vessel
#

ok god

wicked quest
#

give me an api wrapper idea, something that doesnt exist

slate swan
wicked quest
#

and that would be useful

slate swan
#

searches cute pics of shrekpithink

rugged laurel
honest vessel
#

leaked pics of onlyfans api

rugged laurel
#

i tried an old tutorial

slate swan
wicked quest
#

why would anyone need an api to fetch all the images of shrek?

cloud dawn
wicked quest
#

amen

cloud dawn
rugged laurel
#

for some reason

cloud dawn
#

Why aren't you using keras?

vale wing
#

Tensorflow 😳

rugged laurel
rugged laurel
#

but then i would have to reedit the entire script

#

i made traceback and script in the same file

#

if thats what you mean

wicked quest
#

and first of all

cloud dawn
#

ML is fun to learn :)

wicked quest
#

never

cloud dawn
rugged laurel
#

well its bc

#

im building a discord bot

#

with it

wicked quest
#

yeah but

rugged laurel
#

but i need to run it first

vale wing
rugged laurel
#

to see what my error running is

cloud dawn
wicked quest
#

i could be making an python script to connect with js frontend but i wont ask for help in javascript related discord server

#

like

#

whats the logic in that

cloud dawn
#

!pypi discord-.js

unkempt canyonBOT
wicked quest
#

you are making an ai and you ask for help in discord bots

#

and post code that contains 0 trace of anything discord related

cloud dawn
# unkempt canyon
from discordjs import Client
from javascript import console

client = Client()

client.on("ready", lambda:
    console.log("Bot is ready")
)

async def msg(message):
    if message.content.startswith("!ping"):
        await message.channel.send("pong")

client.on("message", msg)

client.login('Token')
``` your welcome
wicked quest
slate swan
#

Anyone got a cog that would kick members if they join too quickly one after another ? I can't code it rn but i need it, because my server has been targeted by some fatherless child

wicked quest
#

use john wick bot

#

if its that urgent

slate swan
#

nah..just if they join too quickly. I mean 3-4 members per minute

cloud dawn
#

We don't suggest other bots here, kinda defeats the purpose of coding.

cloud dawn
wicked quest
slate swan
#

my head is falling of my shoulders..i have covid. i can't code it..i want to but i can't

honest vessel
slate swan
honest vessel
#

its harder to make new bots than rejoin if only kicked

wicked quest
honest vessel
cloud dawn
slate swan
wicked quest
#

lmao

honest vessel
wicked quest
#

kick ❌
ban ❌
mute ❌
give sus role ✅

devout iris
#

Umm...

is

is same with "=="???

honest vessel
#

no

devout iris
#

what are differences?

cloud dawn
#

https://www.google-bot.xyz repl.it bot intensifies.

honest vessel
#

think is check objects and == check data like strings or interger

devout iris
#

if i == 0:
if i is 0:
Are they different?

devout iris
#

Alright i understand now, tysm

cloud dawn
honest vessel
#

but it can work with is and is not etc but

devout iris
honest vessel
#

if 1 !=0:

bitter perch
#

is compares references

#

== compares equality

honest vessel
#

^

cloud dawn
#

php be like ===

slate swan
#

ew

#

ruby is the same lol

honest vessel
#

ugly

#

== is pretty much standard

slate swan
#

yes

honest vessel
#

nah we wanna feel n be diffrent 🙂 ==========

slate swan
#

most lans i think have it since its standard operators

devout iris
#

Lmao why u r speaking them

cloud dawn
#

=== in php means if same object and same value

honest vessel
#

ah

devout iris
#

😅

cloud dawn
#

You can code Discord bots in php

honest vessel
#

pretty much any with sockets etc

#

but afterall we are in python-community

slate swan
#

Does ```py
member.guild.me.joined_at

tell me the time when a user joined?
honest vessel
#

that will tell when bot joined

cloud dawn
#

!d disnake.Member.joined_at

unkempt canyonBOT
#

An aware datetime object that specifies the date and time in UTC that the member joined the guild. If the member left and rejoined the guild, this will be the latest date. In certain cases, this can be None.

slate swan
#

anything for py-cord ?

cloud dawn
#

replace disnake with pycord

honest vessel
#

its same

cloud dawn
#

pycord has no docs though.

honest vessel
#

why use pycords then?

slate swan
honest vessel