#discord-bots
1 messages ยท Page 889 of 1
Its not that simple
I want a / command embed and after 3 seconds it will react and edit the colour and the top 5 fastest to click gets shown in the screen along with how fast they did
I want it to have as a embed
๐ I just gave u the pseudocode for the most basic command, learn from it and code it yourself
svelte is a good choice for frontend BTW
Cmon,I am waiting from hours,what do you want
I will give it
Just give the code
cant you code it yourself
I just gave the MOST basic code for your usecase bruv
don't wanna sound rude but you shouldn't just ask people for code
spoonfeeding wont help you
this server is to help you with your code not to help you by giving you free code
@drowsy thunder we are ready to help u but not by spoonfeeding, sorry
ic

Totally not biased towards it and JS
Depends on what type of website they're making
๐ js do be uwu, but well rule 7
Well, from what I have heard, one can make good websites with svelte and sveltekit
OOP sucks for JS ๐
very
Anyways
yse i know i love svelte too :D
but i need to kno wha type of website they're making, maybe its a bit overkill
Ouh gotcha
Did someone say svelte
Svelte is awesome you should all use svelte ok bye
Alec
Will you people fucking help or not.
No, not if you talk like that
Bro, as we said, we won't spoonfeed
One message removed from a suspended account.
!d discord.client.change_presence
No documentation found for the requested symbol.
Huh
what's with the attitude lol
its event lol
but you want it to be command
I am waiting from tommorrow
One message removed from a suspended account.
you mean yesterday?
Yeah
he's waiting for someone to write code for him
Because I am busy
in your source you have literally not written a single piece of code but the basic bot
And why we must do it ?
Cause its urgent need
how is it urgent
Just to be clear, no one here is obligated to provide you help nor write code for you. With that attitude, you're kind of just making it harder for yourself.
Cmon
Yall say its easy then do it
Cant ya?
Don't expect us to write free code for you
Rule 9
Ie, if a professional developer finds it easy to develop an AI, you can't just ask him to develop an advanced AI for you for free
!rule 9
don't change presence in on_ready
!d discord.ext.commands.Bot takes an activity kwarg
class discord.ext.commands.Bot(command_prefix, help_command=<default-help-command>, description=None, **options)```
Represents a discord bot.
This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") you can do with this bot.
This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
One message removed from a suspended account.
or make a startup task
One message removed from a suspended account.
?
he didn't want event
oh btw, if your a discord.py coder (in your bio) you should be able to know how to write your own code
One message removed from a suspended account.
what
omg
command takes ctx as the first argument
One message removed from a suspended account.
why you use procces_commands inside command?
and pass_context is highly outdated
wjhat does pass context do anyway
pass_context has been removed since v1.0.0(rewrite).
idk i got that from a tag in dpy server
but nobody uses pass_context now so
oh
The biggest change is that pass_context=True no longer exists, Context is always passed. Ergo:
it used to decide whether the ctx arg was passed or not
nice
Do I look like I care?
Ryan u r just making it hard for yourself ๐
LOL you advertise everywhere that you code discord.py but you just copy paste code
Do you know what a loop is?
let's not start an argument here plz
Yes?
yeah i agree, just dont like people who ask for free code very much
No,I dont copy paste anything
Then u can ignore them
I learn it from scratch
you know what i'm so kind i'll write the code for them
๐ด just teach/ignore them if you don't like it xD
I'mma just go from here ๐
Stay, hunter ๐

I can sense an argument starting
Weirdos
arguments lol
Its probably wrong until and unless you put valid arguments
love starting arguments but each time I do I always lose ๐
Drop it
Again, nobody's obliged to write code for you
just to clarify, pydis is not like amazon for code
One message removed from a suspended account.
channel.connect()
how can i get an id for en emoji
The emojiโs ID.
Hi guys
Can yall help for 2 things if you will
Ask and we will see what we can do
how we can message member with id
how to send message?
where?
also show code and learn python before making a bot
!d discord.ext.commands.Bot.get_user
get_user(id, /)```
Returns a user with the given ID.
and use .send()
ah i can make it public for a second then
writing some code for reaction handling but i'm worried about ratelimits
does this look good or does anyone know how i can make this use fewer api calls?
# When a reaction is added to a message
@bot.event
async def on_raw_reaction_add(payload):
# If the event was triggered by the bot
if payload.user_id == bot.user.id:
return
# Do nothing if it is not a unicode emoji
if not payload.emoji.is_unicode_emoji():
return
# If it's an emoji we don't care about
emojis = ["๐", "โ"]
if payload.emoji.name not in emojis:
return
# If it's in DMs get the message from DMs
if payload.member is None:
user = await bot.fetch_user(payload.user_id)
message = await user.fetch_message(payload.message_id)
# Otherwise get it normally
else:
message = await bot.get_channel(payload.channel_id).fetch_message(payload.message_id)
reaction = discord.utils.get(message.reactions)
# If the reaction wasn't started by the bot
if not reaction.me:
return
# Actually do reaction things here
It returns a member object
loop = get_running_loop(loop)
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\helpers.py", line 291, in get_running_loop
internal_logger.warning(
The object should be created within an async function
Stack (most recent call last):
File "c:\Users\phoen\OneDrive\Desktop\some-random-shit-rewrite\main.py", line 59, in <module>
bot = commands.Bot(command_prefix=commands.when_mentioned_or('Luv', 'Eru', 'eru', 'luv', 'love', 'Love', 'l!', 'e!', 'E!', 'L!'), strip_after_prefix = True, intents = intents, sync_commands_debug=True, case_insensitive=True, enable_debug_events=True, owner_ids = set(owners))
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 135, in __init__
super().__init__(**options)
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\core.py", line 1150, in __init__
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 244, in __init__
self.http: HTTPClient = HTTPClient(
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 327, in __init__
self.connector: aiohttp.BaseConnector = connector or aiohttp.TCPConnector(limit=0)
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 767, in __init__
resolver = DefaultResolver(loop=self._loop)
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\resolver.py", line 26, in __init__
self._loop = get_running_loop(loop)
File "C:\Users\phoen\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\helpers.py", line 291, in get_running_loop
internal_logger.warning(```
Whyyyyyyyyyyyyyy'
but I need to handle reactions in DMs as well
Ah
One message removed from a suspended account.
One message removed from a suspended account.
!ytdl
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)
basic python - learn to make a function in python and you shall know.
you were correct about that ๐
One message removed from a suspended account.
One message removed from a suspended account.
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)
Is there some method, which returns the user messages count?
you can get the user then use user.history
perms = ctx.me.guild_permissions
AttributeError: 'str' object has no attribute 'me'
somewhere u did ctx = "something"
where is ctx defined?
ctx.me? is that a thing?
Union[Member, ClientUser]: Similar to Guild.me except it may return the ClientUser in private message contexts.
links broken in my mobile client
not only in yours but in every
mobile clients are weird like that
anyone got a good tutorial on how to use buttons with dpy 2.0
mobile client bugs bro smh
the dpy repo got a few examples
readthedocs or the legit source code
github
ty
checkout the examples folder
wdym?
theres no hyperlink
its not formatted as a hyperlink on my mobile client
not sure check in the dpy server
iirc nope
no application command is added to the cog until now
Totally your call tbh. Some people have lost faith in dpy, but then some people do think switching back is better
Most people are gonna end up migrating back
dpys release was a whole disaster
I doubt people are gonna rely on forks anymore. Itโs the same as relying on third party software.
Migration is a pain in the ass so we'll see how this goes
im not quite sure if they even tested after release tbh
Tbh Idrc what Danny's reasons are for coming back nor do I care if they were contradictory to the reasons that he left for. He came back because he saw the impending doom discord was gonna release on its bot environment with the api 6, and 7 decommissions, and the fact that the fork ecosystem was erratic and was all way too confusing for people. Showing he does care and thatโs all you should expect from a sole maintainer.
Itโs not even released yet wdym?
2.0 is still not done nor released. All the new additions are on master branch. If you use that you're inclining yourself to possible breakage.
Since itโs not stable.
its not? like on pypi?
Itโs not
bruh btw nice og pfp
surprising you still remember that
!ot
Off-topic channel: #ot2-never-nesterโs-nightmare
Please read our off-topic etiquette before participating in conversations.
That returns user & bot DM messages count, but is there a way which shows how many messages has a user sent in a guild/certain channel
no
aww
u would need to track it urself
That's sad
its kinda irrelevant for most users anyway
You have to modify directly through code
discord.ClientUser.edit()
Regenerate it
I literally just saw the same thing and after regenerating I saw it
I mean you can messily. You can look at TextChannel.history() and just logically check the message author and count with that. But it can be rather expensive since itโs an api call. This also doesnโt account for deleted messages as well.
ayyyo Rapptz is back
I've spend 2 weeks for a single automation in PyCord now I'll have to do it again in Discord.py
If it does promise newer features and improvements, however, then I'll definitely be doing it
But I'll be waiting in the meanwhile for some good updated Docs and Examples
yeah, I'm in no rush either
Because it eliminates the need to rely on forks/third party software 
Isnt dpy itself technically 3rd party from the discord api?
Thatโs not in the sense of what Iโm talking about
Dpy is still the first official Python lib for bot making
According to me ^^^
Lol
what
Source: just trust me man
alr it's official heroku is fucking w/ me
?
The problem here is light mode
eks dee
You didnโt give a reason so it probably defaulted to None

your bot hating you for light mode, 99% sure 
Oh Iโm blind
Two instances... You sure u stopped the bot on yr laptop?
high contrast > light mode
well fuck no, the app was never deployed properly on heroku for some fucking reason (even tho it said it was) so i had to run heroku local on my cmd line
Oh, hmm so the problem is fixed now?
full saturation is the best, I agree 
no it isn't
but im fucked either way
you dont need to fuck so much, dude 
Just delete rhe project on heroku and make another one 
heroku 

replit
i'll try something soon
Im trying to store a list of people who send pics in a certain channel.
After a certain amount of people the channel will be locked and the bot will give the people within the list a specific role.
Any ideas on how to do that?
Ping difference a bit too less
that heart beat latency
Weird, for some reason I am enjoying the headache I'm getting from seeing the pic lol

Hmm
my help command has the ctx parameter tho, whats its problem?
youre missing self
Which library are your using?
its in a cog i suppose as youre using the deco so youre missing self as youre in a class
oh yeah, i though I had that
nextcord
Why not use discord.py?
subclass help command for the love of god
LETS GOOO

turns out i made a typo in the imports
lolll
now my buttons class isnt defined ๐ค

!d nextcord.ext.commands.MinimalHelpCommand
class nextcord.ext.commands.MinimalHelpCommand(*args, **kwargs)```
An implementation of a help command with minimal output.
This inherits from [`HelpCommand`](https://nextcord.readthedocs.io/en/latest/ext/commands/api.html#nextcord.ext.commands.HelpCommand "nextcord.ext.commands.HelpCommand").
that name smh
dang i wish
๐ฅ
did someone face this issue before ?
but it is defined in the class
i can get my code real quick to show you
I don't code on mac so dunno also this issue is not discord bots related
it wont send
sorry im new here
You define class in the class?
Wtf why
its saying its not defined
Define classes separately
Bring it out of there
yeah
nested classes
someone experianced in here that could do a litlle job for me?
bro what
Depends what job
Cause rule 9 exists
whats rule 9 lol
any job is against rule 9
!rules
The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.
Paid job*
i swear no one reads the rules before coming here
!rule 9
๐ฅด
bruh
Certified bruh moment


anyone back on topic
well gues i go to fiverr then lol
๐
that's the place :thumbsup_tone5:
now back on topic
discord_bots.on_topic = True
who needs help related to discord bots?
@client.command()
async def d(ctx):
from random import choice
await ctx.send(choice(ctx.guild.members).mention)```
I don't have a random, it only notes himself
import random at the beginning smh

why import random on each command
btw, you forgot to enable members intents
show us where you defined client and move the imports to the top of the code
dude you there?
@weary gull
read my previous messages

A second please
alr
Can you write in Russian?
no
english only
!rule 4
4. Use English to the best of your ability. Be polite if someone speaks English imperfectly.
im so reformed i even memorised the rules ๐

on your application page, did you enable members intents?
hmm, my bot goes offline after 30 mins on heroku
anyway
or cz others have used the command a bit tooo many times on u that u remember it now

inport on functions wtf
๐
who cares about RAM
your bot uses ram to cache stuff
I just recently started learning python so sorry
dosnt python use ram for import llibs n cache that?
alr, @weary gull do this - client = discord.commands.ext.Bot(command_prefix='+', intents=discord.Intents.all())
idk on imports tbh
and rename client to bot for godsakes
@slate swan test import alot of ranom libs n see if it drags more ram than without
!paste
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.
in school
my 16gb of ram wouldnt show a difference prob
1824 GB ram 5000 MHZ superiority
Your modules are automatically compiled (.pyc files) which are then imported into memory,
not 69gb of ram

69 isn't a base of 2, srry
that also results in faster interpretation, correct
those are all stored in the __pycache__ folder
@slate swan maybe he runs a pi with 512mb n import every time new command lol
at least dont use the import statement
anyway best is import parts of lib u use n not from discord import * or import discord
is this right?
!e
print(__import__("random").choice([1, 2]))

@slate swan :white_check_mark: Your eval job has completed with return code 0.
1
please rename client to bot
no
Literally no difference though. Since Python is interpreted you can call anything from anything anyway
i've used client all the way through
botclient
if you imported the has perms deco yeah

hey i need help with the logic of this select menu ( disnake )
async def interaction_check(self,interaction):
colors=["Gold","Light Blue","Dark Blue","Dark Red","Indigo","Violet","Cyan","Turquoise","Light Green","Dark Green","Olive Green","Purple","Raspberry Purple","Pink"]
rolenames = []
for i in interaction.author.roles[1:][::-1]:
rolenames.append(i.name.title())
for i in rolenames:
if interaction.values[0] == i:
return True
if interaction.values[0].title() in rolenames :
await interaction.response.send_message("You already have a color role",ephemeral=True)
return False
return True
``` it works to add the remove the role but i want to to make sure that if the user has one of the roles in color it cant get any unless he removes it ( by selecting the one he has )
yes
like this?
!d discord.ext.commands.core.has_permissions wrong import
No documentation found for the requested symbol.


youre sus
!d discord.ext.commands.has_permissions
@discord.ext.commands.has_permissions(**perms)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member has all of the permissions necessary.
Note that this check operates on the current channel permissions, not the guild wide permissions.
The permissions passed in must be exactly like the properties shown under [`discord.Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions").
This check raises a special exception, [`MissingPermissions`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingPermissions "discord.ext.commands.MissingPermissions") that is inherited from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
what's the right import
remoce .core
so do you know what i should do ?
hmm okay
!d discord.ext.commands.has_permissions
@discord.ext.commands.has_permissions(**perms)```
A [`check()`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.check "discord.ext.commands.check") that is added that checks if the member has all of the permissions necessary.
Note that this check operates on the current channel permissions, not the guild wide permissions.
The permissions passed in must be exactly like the properties shown under [`discord.Permissions`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions "discord.Permissions").
This check raises a special exception, [`MissingPermissions`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.MissingPermissions "discord.ext.commands.MissingPermissions") that is inherited from [`CheckFailure`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CheckFailure "discord.ext.commands.CheckFailure").
what you need?
@oak warren oh well check users roles if any in list exists in his roles
i did do that
so
from discord.exit.commands.remoce.core import has_permission
@placid skiff here
@spice basalt are u joking????
yes
for i in rolenames:
if interaction.values[0] == i:
return True
check if any of the user roles is in your roles list
from discord.ext.commands import has_permissions
Can I somehow put a bot on heroku hosting from my phone?
get the member object get his roles see if any of ur list is matching his roles
don't host discord bots on heroku
okay hang on
Why is that?
good cus almost reported u for trolling n wasting others time trying to help
its made for web apps
so it will just spin up a domain
trust from personal experience, its not good for discord bots
Imagine running a self bot on replit ๐
use a VPS like vultr
i seriously didn't know what you meant by remoce .core tho
just get the Oracle VPS if u don't even wanna spend any money lmao
@spice basalt remove .core i just misspelled
i told you 3 times
not easy wen its hard, ur forgiven
@spice basalt u should learn python tho
okay that worked but now when i remove the color role i have i cant add any updated code:
async def interaction_check(self,interaction):
colors=["Gold","Light Blue","Dark Blue","Dark Red","Indigo","Violet","Cyan","Turquoise","Light Green","Dark Green","Olive Green","Purple","Raspberry Purple","Pink"]
rolenames = []
for i in interaction.author.roles[1:][::-1]:
rolenames.append(i.name.title())
for i in rolenames:
if i in colors and i == interaction.values[0]:
return True
else:
await interaction.response.send_message("You already have a color role",ephemeral=True)
return False
i know the basics ๐ฉ
What would you recommend hosting a bot?
but i will learn from the docs
Free
not really :p
i hosted from https://discord.com/developers/applications
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
is that what you meant by hosting?
no
No
like hosting means provide/have up n running, like a webserver can host a website
host=server
probably because you're using a list created by yoursef, also identation seems wrong:
if any(role.name.title() in colors for role in interaction.author.roles[1:][::-1]):
await interaction.response.send_message("You already have a color role", ephemeral=True)
No one listens to genius people ๐ซ
genius people
My eyes gonna bleed tbh
@maiden fable i heard u now that means ... ?
I ain't one (:
lmao
๐ ๐คช
okay let me try this
fixed it
@oak warren hey ironman stop code bots n help captain america fight putin
edited it
why u do this to me ๐
World can't afford a war between putin and Marvel
too late 
๐คฆ๐ปโโ๏ธ
Lmaooo
haha thats so true tho
Captain America: Let's produce shields on a bigger scale so that everyone gets one
!ruwule 7 ๐
!rule 7
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
Anyways I'mma just stop before ash- well nvm
what 
uses the rules/ot command

Reminder: Message Content is changing to a Privileged Intent
After <t:1661904000:D> (<t:1661904000:R>), Discord bots in 100+ servers will need to be verified and approved by Discord to receive Message Content.
Applications for requesting the intent has already begun, and can be done alongside either the initial verification process in the Developer Portal, or by opening a support ticket if you've already been verified.
You can read more details about this over at:
https://support-dev.discord.com/hc/en-us/articles/4404772028055
Oh hi there Scragly
haha np
wanted to remove the pinned notice
Haha
modabuse reeee
always
discord says the SLA for intent request is 5 days but they do be taking 3 months ๐
i just said if we collab on a putin bot that nukes then its relevant n not breaking rule 7
Calm down
it's one of those things where even if it just reminds people to start working on core changes such as migrating their own commands systems, the pin will have been successful enough
but yeah earlier is better than later
๐คทโโ๏ธ guess they arenโt exactly obligated to fulfill an SLA when thereโs no mutual benefit
Yea
Well ig I am just lucky since I have access to the intent
Well, what I like to do in a situation like this: Delete the project and make another one from scratch
i've done it twice
well, maybe a third tiem?
ig
ah
Nvm that ain't a valid server
i likeembeds tho
we all do
Hey @slate swan! I noticed you posted a seemingly valid Discord API token in your message and have removed your message. This means that your token has been compromised. Please change your token immediately at: https://discordapp.com/developers/applications/me
Feel free to re-post it with the token removed. If you believe this was a mistake, please let us know!
yoinked already too slow bot
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
๐
putin nowcoming (just kidding)
it means your token is invalid/you closed the bot
smh
Regenerate ur token tho kek
Lemme run a self bot to actually save those messages
andwhen post code keep client / bot.run(token) out from it
Indeed
or use a .env to store token
Meh as if I am gonna run a self bot
just need to tell git to ignore that filetype cause i cant use git add . ๐
bruh i didn't do anything and my bot crashed
Lmaooo
heroku realy does hate me
Sure
anyone made a discordclient mimic IRC?
a client is just utilizing the same Discord API, but just using a GUI to show u the messages and stuff instead of making u write code for everything
ah yeah but a selfbot is a selfclient but it has automated features
practical same but not theoraticaly
no theoratical same not practical ? ๐
a self bot is also a client, but without any GUI/CLI and using code to control the same
Technically speaking, other modded discord clients are running self bots (won't name them)
ye so the selfbotting comes as soon u have anything automated right?
(but notcorrect either, likeifu have afk if intact 10min n change status) that would also be selfbotting but its a client too
Yea, well technically rn, we all are self bots
But just cz discord has made the client, it isn't termed as self botting
client is the app we are using to login to the Discord API and stuff
ah ok thats how u seeit
Haha I was just seeing the Discord app logs, and understood that why, sometimes it takes a good minute for discord to show someone as offline
i am always offlinestatus :S
@maiden fableHi! I am Hunter, a depressed single who also has Bipolar Disorder. urnotalone
Since u gotta ping the ws to keep u online, the client/app also pings the API. Sometimes the ping can take upto 2 min, cz of the logic, so we are shown online until the time for the ping isn't over
U do know that is OT, right?
welli sneak it in fast - no discussion needed
The presence is still being shown as invisible, not offline cz u r still pinging the API, while being in the offline status
wait what whatu mean? ifi play gameitshow i play it? no
The "status" symbol/logo is just there for others to see, the API doesn't care about it. The symbol is coded in the frontend/app, not in the API
Because it is coded in the app, not the API
hm am lil bit confused but whatever
Hello! I'm not quite sure what channel to ask this in, but I am looking to create a gui panel to play a discord bot, from my discord account;
My question is: "How can I hook onto discord in a way that I can read chat and type messages into the message box, without using a bot account"?
API is still sending the app/client, the game/rich presence information, but the client just checks if yr status is set as invisible/offline and if it is, it doesn't show the information
we are talking about the damn same thing, what a coincidence
why would u tho run discord as a python client insteadof use the app @winter shore ?
i mean theres both apps n website
not sure if wanna help xD
And yea, the API still sends the app/client, information in the same JSON format, u get, by sending raw requests
@winter shore can u explain ur not goals but whats the point=?
(lack of english)
what u gonna gain from it?
we have to be carefull tho for their intentions
eh, I ain't helping him make a GUI or smth since I haven't really read Discord's guidelines/ToS and idk if it is against their policies (probably it is)
"i want a nuclear plant for electricity -> use waste for nukebombs"
The point is to be able to play a discord bot created by another user, through a more user friendly user interface with buttons to do the actions in that game.
how can i make it send an output when the command activates like
"Kicked <member kicked>"
await ctx.send?
will the command still activate then?
....?
who said u cannot use 2 awaits
yesu cando
ah
await ctx.send()
await fetch_user()
await asyncio.sleep(666)
await ==> courountine itmeans it work asyncron
how do i set the current dir in a commandline?
indeed
yes it's related to discord bots to run commands
cd?
cd worked
dir?*
!ruwule 7 ๐
ashley stop
lol
u always chatting n then lurking to do that ๐
nah, i was watching anime, and it just started buffering to death ๐
๐
"how do I center a div? its related to a discord bot" 
good thing
Such a furry
oh he deleted msg
I don't watch it anyways ยฏ_(ใ)_/ยฏ
i might watch anime after the nukes
it works now ๐ฉ
cause u forgot mention a memberwhen executed command ;OP
๐ why did I misread it, I think I will just go from here
I don't watch cartoons, thanks
lol what did u read it as?
by the way, how can i make the bot say it like "Kicked {member}#0000"?
!ruwule 7 ๐
DMs
check the docs
await ctx.send(f'Kicked {member}.')
!d discord.Member
class discord.Member```
Represents a Discord member to a [`Guild`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild "discord.Guild").
This implements a lot of the functionality of [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User").
x == y Checks if two members are equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.
x != y Checks if two members are not equal. Note that this works with [`User`](https://discordpy.readthedocs.io/en/master/api.html#discord.User "discord.User") instances too.
hash(x) Returns the memberโs hash.
str(x) Returns the memberโs name with the discriminator.
str(x) Returns the memberโs name with the discriminator
!d class message
A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class.
Cast the member object
str(x) Returns the memberโs name with the discriminator.
oh hello sarthak
so basicly f"{member}"
or str(member)
!d class Message
A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class.
no need
or ast.literal_eval(f'"{member}"')
@formal basin!d discord.Message
thanks
!d discord.Message
class discord.Message```
Represents a message from Discord.
x == y Checks if two messages are equal.
x != y Checks if two messages are not equal.
hash(x) Returns the messageโs hash.
you do know that complication is bad when you can have simplicity
@formal basin #bot-commands for the love of god please go there
@formal basinwhat u lookingfor?
funni tho
its not
Everyone else in this channel would disagree
ashley has no humour ignore her 
anyway back on topic
easy is boring
shut up 

toxic
!rules 7
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
๐ alright
@slate swan
hm?
I wanna comment sooo bad but ๐
that topic is over ๐
dpy 1.7.3 third party libs 
๐ ik I was late cz was in a VC
Help please
๐
your scope is wrong
tf is a free variable
@commands.command()
@commands.has_permissions(mute_members=True)
async def mute(self, ctx, member: discord.Member, *, reason="Aucune"):
mutedRole = await getMutedRole(ctx)
await member.add_roles(mutedRole, reason=reason)
await member.send(f"> Tu as รฉtรฉ mute du serveur **{ctx.guild.name}**. Si tu penses que c'est une erreur, ouvre un **ticket** ou contacte les **administrateurs**.")
embed = discord.Embed(title="**Mute**", description=f"{member.mention} a รฉtรฉ mute !", url="https://youtu.be/dQw4w9WgXcQ", color=0xba1206)
embed.set_thumbnail(url="https://emoji.gg/assets/emoji/2912-peperee.png")
embed.add_field(name="Raison", value=reason)
embed.add_field(name="Modรฉrateur", value=ctx.author.name, inline=True)
await ctx.send(embed=embed)
``` hello, when i test this code, my bot say i don't have the permissions
show the error
no, create the variable every time when a message is sent ๐
What do I put then?
= i have just this and its say "missing perms"
yeah i can read french, show your error handler then
can i make the command's output send in a different channel?
is your handler in a cog?
align 1 with 1 and 2 with 2
french ๐
how
ok i haven't error in my error handler
!d disnake.TextChannel.send
await send(content=None, *, tts=False, embed=None, embeds=None, file=None, files=None, stickers=None, delete_after=None, nonce=None, allowed_mentions=None, reference=None, ...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Sends a message to the destination with the content given.
The content must be a type that can convert to a string through `str(content)`. If the content is set to `None` (the default), then the `embed` parameter must be provided.
To upload a single file, the `file` parameter should be used with a single [`File`](https://docs.disnake.dev/en/latest/api.html#disnake.File "disnake.File") object. To upload multiple files, the `files` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`File`](https://docs.disnake.dev/en/latest/api.html#disnake.File "disnake.File") objects. **Specifying both parameters will lead to an exception**.
To upload a single embed, the `embed` parameter should be used with a single [`Embed`](https://docs.disnake.dev/en/latest/api.html#disnake.Embed "disnake.Embed") object. To upload multiple embeds, the `embeds` parameter should be used with a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.10)") of [`Embed`](https://docs.disnake.dev/en/latest/api.html#disnake.Embed "disnake.Embed") objects. **Specifying both parameters will lead to an exception**.
just show your error handlers code
how do i use disnake
install the module
ok
or use whatever wrapper you have rn
!pip disnake
so i have to use vs code for that?
no
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send(f"> {ctx.author.mention} vous devez indiquez un argument pour effectuer cette commande.")
elif isinstance(error, commands.MissingPermissions):
await ctx.send(
f"> {ctx.author.mention} vous n'avez pas les permissions nรฉcessaires pour effectuer cette commande.")
```@quaint epoch
any terminal will do
alr comment out or remove your error handler for the time being, then run the command again
else:
raise error
add this line of code at the end of the handler and u r gonna be fine
so i just have to install it on https://pypi.org/project/disnake/ ?
just run py -m pip install disnake on your command line
wow ok ashley confused me with it so hard yesterday
for guild in client.guilds:
for member in guild.members:
membros = member
components = [
Select(
placeholder = "select a user",
options = [
SelectOption(label=f"{membros}", value="select this user"),
]
)
])
while True:
try:
select_interaction = await client.wait_for("select_option")
await select_interaction.send(content = f"{select_interaction.values[0]} was selected", ephemeral = False)
except:
await ctx.send("error")
``` there is any errors? because, when i try to run this command, it returns only me as a option
wait, what 
@vale sierra did you run the command after removing the handler?
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
im owner btw
why dont you just recommend pip install?
#bot-commands
she confused or u automatically got confused
thx
it won't work then lol
I like confusing people
could be me
she confused
lol get gud

๐ relatable
๐ I need to, I suck af
the bot can only mute people with a role/perms lower than it
i think its work with (ban_members) = true

thats still don't work
i think i forgot to ask this, are you trying to timeout a member?
no just mute without time
what permissions did you give your bot?
admin
do you have any other members on your server
Like this
yes
send the code, please
try muting one of them, the bot won't mute you but it should work on them
i mean the text
dude did you try reading the error?
like
if message. bla bla bla
@client.event
async def on_message(message):
if message.channel.id in no_set:
if message.id in role_set:
if message.author.id == client.user.id:
pass
msg_content = message.content.lower()
WHY U USING PASS
@quaint epoch can i dm you ? i think why but its long and i don't want to flood
if message.id in role_set:```
nvm, sorry for caps, forgot to turn them off
open a help channel
ok where ?
Yeah but look
Am I not allowed
nah it isn't that, I just forgot to turn off caps, sorry
@client.event
async def on_message(message):
if message.channel.id in no_set:
if message.id in role_set:
# do stuff
if message.author.id == client.user.id:
# do stuff
msg_content = message.content.lower()
try to use this
Ok
What happened?
role_set is an array 
lolll
use tuples
api_key = "myapikey"
base_url = "http://api.openweathermap.org/data/2.5/weather?"
@client.command()
async def weather(ctx, *, city: str):
city_name = city
complete_url = base_url + "appid=" + api_key + "&q=" + city_name
response = requests.get(complete_url)
x = response.json()
channel = ctx.message.channel
if x["cod"] != "404":
async with channel.typing():
y = x["main"]
current_temperature = y["temp"]
current_temperature_celsiuis = str(round(current_temperature - 273.15))
current_pressure = y["pressure"]
current_humidity = y["humidity"]
z = x["weather"]
weather_description = z[0]["description"]
weather_description = z[0]["description"]
embed = discord.Embed(title=f"Weather in {city_name}",
color=ctx.guild.me.top_role.color,
timestamp=ctx.message.created_at,)
embed.add_field(name="Descripition", value=f"**{weather_description}**", inline=False)
embed.add_field(name="Temperature(C)", value=f"**{current_temperature_celsiuis}ยฐC**", inline=False)
embed.add_field(name="Humidity(%)", value=f"**{current_humidity}%**", inline=False)
embed.add_field(name="Atmospheric Pressure(hPa)", value=f"**{current_pressure}hPa**", inline=False)
embed.set_thumbnail(url="https://i.ibb.co/CMrsxdX/weather.png")
embed.set_footer(text=f"Requested by {ctx.author.name}")
await channel.send(embed=embed)
else:
await channel.send("City not found.")```
The Error
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'main'
- don't use requests, it's blocking
- try reading the error, the item "main" is not in the json
What does this mean
quits self explanatory
So what do I do to fix it
make sure the awaitable is inside in asynchronous function
what does .get do
You can only use the await keyword inside an asynchronous function ie you need to put it in an async function like this:
async def foo(param):
await do_something()
oops wrong one
utils.get or bot.get_xxx?
It is right?
wrong channel
ah okay
What?
I did do that
What did you do exactly? I may need to see the code
go to line 57
Thereโs nothing
57
Ok
dude did you try reading the error before sending it here
Are you sure the await is inside that particular function beginning at line 27? You might be having some indentation problems.
Yes
best if statement ever
what's the difference between worker and web in Procfile in heroku?
yeah ikr
if blablabla:
await respond("yeyeyeyeye")
NO! ama send u to the intelligent army of anti-JS in py-thin community
i said u were a spy for JS
tryina recruit
Then send the whole function from line 27 to 57...
no, i just want a side-server option for python
i don't wanna open up pycharm or the cmd line
Let python just be python!

be happy peopels even makes pylibs
thats not how trump looked
still not a js spy
99.99% sais dont use replit
u share ip's and if one is bad u all blocked
and those places is where bad bots gets hosted
still wanting a python side-server...
Ok
can anyone help me?
dude
@formal basin if u knew little py, u would figure this out
!code
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.
@royal jasper , you need members intents enabled
i have already members intents
i can let it slip n explain - it means u try use asyncron in a function u havnt defined as a async function
show use where you defined client
client = commands.Bot(command_prefix=prefixo, intents=intents)
client.remove_command('help')
DiscordComponents(client)
prefixo = "/"
It is in an async function
@formal basincan u show code? i just read error and error tells me what i told u
from whole function decleration
bot = commands.Bot(command_prefix='prefix_here', intents=discord.Intents.all())
but it is the same, not?
did you also enable member intents in you bot app page?
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.
indentation probably incorrect, also use a pastebin for large pieces of code
Ok
!paste
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.
await message.delete()
await message.channel.send(f"{message.author.mention} you are not allowed to say that")
your spacebar not working lol?
I can't see anything wrong so it should be indentation
await message.delete()
await message.channel.send(f"{message.author.mention} you are not allowed to say that")
No it is itโs just I sent it wrong
ah ok
canu paste ur whole code then !paste
cus ur source u deleted
!paste
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.
@formal basinhttps://cdn.discordapp.com/attachments/343944376055103488/950447371953778818/unknown.png this error just sais u nvr used await
and thats the error u share with us
bruhda thats the link
and i thought i was the one getting drunk
i think its indentation issue and his await is outside function
Yes.
Have you been using spaces to indent?
Yes
@formal basin look picture dont u see anything sticking out? (pic i sent)
Cuz your indentation sure is messy.
very badly
No.
Ok let me help u more
give them the line number
the if statement is in the same line as the function, meaning its outside of it, meaning everything inside that condition is outside that function, meaning it cant use await
that is when people say indentations
your if-statement is outside function
and u try use await after it
Do I do async def on_message(message):
There are some other indentation problems too
omg
yes
Thanks
i am chill
Btw, when you are sharing the code block from above, do you mind not sending the mean list?
@formal basinlets do a practice
!e
def myfunction():
print("monkey")
print("This is outside my function")
print(myfunction())
@honest vessel :white_check_mark: Your eval job has completed with return code 0.
001 | This is outside my function
002 | monkey
003 | None
The if statement in the 4th line of code is also indented by 1 space. Do you want it indented or do you not? @formal basin
Yes
!e
def myfunction():
a = 1
a = 2
print(a)
#bot-commands
@honest vessel :white_check_mark: Your eval job has completed with return code 0.
2
itry givehimexamples
Examples of what?
!e
a = 1
while a < 5:
a += 1
print(a)
@fluid spindle :white_check_mark: Your eval job has completed with return code 0.
001 | 2
002 | 3
003 | 4
004 | 5
!e
a = 1
while a < 5:
a += 1
print(a)
@fluid spindle :white_check_mark: Your eval job has completed with return code 0.
5
stop spamming go #bot-commands
Help
do you mean msg.content ?
No
ok then
Iโll try
lmao, just lowercase the content and check if idiot is in there instead of 100 variations of idiot
same thing with, like, 5 other words
ok?
i just tried help this fellow botcoder indentations issues
i take a break bbl
are there any permission i have to give my bot explicitly to be able to send ui elements ?
I don't think so
hmm
sorry, were you talking to me?
Hello can someone help me i want to change my bots username but it says i have to do it with json can someone show me how that works
whats telling you to do it with json?
on the link it leads me here : https://discord.com/developers/docs/resources/user#modify-current-user
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
Who can help with postgresql ( heroku/git )
https://paste.disnake.dev/?id=1646678496100502
My interactions fails immediately, no errors to the terminal
Any help?
Using Disnake
What library you using? (Disnake, discord.py, Hikari, Nextcord, etc)
Some have support for it, some don't iirc
Also helps us find what you need to use
i have found the issue, still thanks
Ok :)
i used await client.user.edit(avatar='path',username='username')
Ok
Is there someone with knowledge in Temporary Voice bots?
does anyone know all embed identitiers
this is what iโm saying iโm trying to do this but my bot wonโt send the footer auto and stuff
iโm in school sorry if i donโt reply just dm me if you can
@commands.command()
async def resume(self, ctx):
client = ctx.guild.voice_client
if client.is_paused():
client.resume()
emoji = '\N{THUMBS UP SIGN}'
await message.add_reaction(emoji)
``` hello, i try to make my bot react with a emoji (๐ ) but its don't work (no error codes)
if your moving to nexcord do you just replace discord with nexcord?
Why would you do that?
idk
Unless you have a strong valid reason to switch over consider staying
yes you do, but discord.py is back now
guys how can i create a discount command? For example:! Discount @user% 10
answer: I added 10% discount to @user
I want that 10% stored for @user and maybe 20% stored for @ user2 what can I do?
staticmethod
static methon
!d static method
static
To link to static files that are saved in STATIC_ROOT Django ships with a static template tag. If the django.contrib.staticfiles app is installed, the tag will serve files using url() method of the storage specified by STATICFILES_STORAGE. For example:
{% load static %}
<img src="{% static 'images/hi.jpg' %}" alt="Hi!">
``` It is also able to consume standard context variables, e.g. assuming a `user_stylesheet` variable is passed to the template:
```py
{% load static %}
<link rel="stylesheet" href="{% static user_stylesheet %}" type="text/css" media="screen">
```...
they belong to the class, not the instance, and take in no parameters
need some help
method
!d staticmethod
@staticmethod```
Transform a method into a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
```py
class C:
@staticmethod
def f(arg1, arg2, ...): ...
``` The `@staticmethod` form is a function [decorator](https://docs.python.org/3/glossary.html#term-decorator) โ see [Function definitions](https://docs.python.org/3/reference/compound_stmts.html#function) for details.
A static method can be called either on the class (such as `C.f()`) or on an instance (such as `C().f()`). Moreover, they can be called as regular functions (such as `f()`)...
@mellow gulch
Shit this is django lmfao
i dont understand
static methods are used when you have self but you never use it
no?
static methods are methods that dont need a class instance or are not bound to a class
learn python
class Myclass:
def __init__(self, name):
self.name = name
def some_shit(self):
print(self.name)
self is used there

its kind of like the thing where you know when to use it but not know how to describe it
static methods are bound to the class
or you just dont know what it is

I know what it is
staticmethods are useless
don't say that in the presence of a c# user
@commands.Cog.listener()
async def on_member_join(self, member):
guild = member.guild
try:
data = getConfig(guild.id)
guild = member.guild
data = getConfig(guild.id)
blacklisted = data["blacklist"]
if logs.user.id in blacklisted:
await member.ban(reason=f"Blacklisted.")
except:
pass
help me please :(
from discord import app_commands
from discord.ext import commands
class Test(commands.Cog):
def __init__(self, bot):
self.bot = bot
tree = app_commands.CommandTree(bot)
@commands.Cog.listener()
async def on_ready(self):
print('Test Online')
@tree.command()
async def repeat(self, interaction: discord.Interaction, msg: str):
await interaction.response.send_message(msg)
def setup(bot):
bot.add_cog(Test(bot))```
what help
ment it like theyre not binded to a instance of the class but yes theyre methods in a class
so how would i use the staticmethod with this
oh ok
whats a c# user? you play the piano or smth?
yup
i already test and its dont work
LMAO
anyways okimii and caeden have fun helping people here
(i do play 2 instruments though)
shit i play the piano
i need to do homework lol
cโญ
caeden hates everything i do
I got chinese homework


chinese lol
@velvet tinsel how would i use the staticmethod here
why would you use a static method
Wanna help me?
the error says it all
@velvet tinsel
only know spanish and english
@amber hinge @slate swan is the expert here not me
Ask him hes smarter than me at programming

Traceback (most recent call last):
File "C:\Users\damie\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 606, in _load_from_module_spec
spec.loader.exec_module(lib)
File "<frozen importlib._bootstrap_external>", line 879, in exec_module
File "<frozen importlib._bootstrap_external>", line 1017, in get_code
File "<frozen importlib._bootstrap_external>", line 947, in source_to_code
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "D:\gg$\Bot py\GROS PROJET\Cogs\blacklistfilter.py", line 23
except:
^^^^^^
SyntaxError: invalid syntax
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\gg$\Bot py\GROS PROJET\bot.py", line 168, in <module>
bot.load_extension(f'Cogs.{filename[:-3]}')
File "C:\Users\damie\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
self._load_from_module_spec(spec, name)
File "C:\Users\damie\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'Cogs.blacklistfilter' raised an error: SyntaxError: invalid syntax (blacklistfilter.py, line 23)
error
line 23 lol
ok ! thx
idk @slate swan said that i would use it to fix this
ah i cant really help on that im not familiar with dpys methods
i didnt use piano as an insult ๐ข
of interacions
the error is just where the tree part isnt defined
I got an exam in a week
@slate swan ??
ive literally had the biggest exams in my life in this week
cus they scale upwards yk
Oh nice
Did you get your results
nah

