#discord-bots
1 messages · Page 625 of 1
I just googled it
stackoverflow helps a lot
I still use it to study PyQt5
thanks
where in docs may i read about it, I opened the docs of discord.Message but I can't see about what I can give to it
so realpython and stackoverflow
yes
For looking for questions, not asking. I get like -1 votes
Test it
My favourite part of python is testing
hmm I'm dumb
Just do what you did and then see if it works
If it doesn’t come back
What do you want to do again?
I will
I'm building a bookmark command
that made by job a lot easier
!d discord.Member.created_at returns a datetime.datetime object, you can use the timestamp() attribute on it to get the timestamp
property created_at```
Equivalent to [`User.created_at`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.created_at "discord.User.created_at")
that worked
yes
hmm if message is longer than xx characters, how can I split the content so it will only be the 40 chars or smth```py
if len(msg.content) > 40:
actually this is wrong channel, brb
sure
slice it
message[40:]
I did it nearly correctly I had : in the wrong side
!e
msg = "".join(["e"*1000])
print(msg[:20])
@visual island :white_check_mark: Your eval job has completed with return code 0.
eeeeeeeeeeeeeeeeeeee
!e py msg = "firstsecondthird" print(msg[:5])
@lament mesa :white_check_mark: Your eval job has completed with return code 0.
first
why is it now :number and not number:
That's just like the range function, like [start:stop:step]
nvm i thought you wanted to exclude the first 40 chars
oh
I wanted the first 40 characters
it means take the characters before/after the index depends on the position of :
Yea so the code is correct
So many pongs around
[5:] will exclude first 5 chars
I’m back
yeah, then its message.content[:40]
oh


how did I place the avatar + user name there?
msg.author gives the name, but what about avatar
!d discord.User.avatar
property avatar: Optional[discord.asset.Asset]```
Returns an [`Asset`](https://discordpy.readthedocs.io/en/master/api.html#discord.Asset "discord.Asset") for the avatar the user has.
If the user does not have a traditional avatar, `None` is returned. If you want the avatar that a user has displayed, consider [`display_avatar`](https://discordpy.readthedocs.io/en/master/api.html#discord.User.display_avatar "discord.User.display_avatar").
avatar = msg.author.display_avatar
``` so it would b smth like this?
sure
how can i blacklist bad words from the gifs links as well ?
how do I place it to the embed?
!d discord.Embed.set_author
set_author(*, name, url=Embed.Empty, icon_url=Embed.Empty)```
Sets the author for the embed content.
This function returns the class instance to allow for fluent-style chaining.
oo
yes, but for is a python keyword
@visual island 
cant you just see the message content?
it isnt working
it is just blacklisting the messages with the bad words
but not the gifs
I did this ```py
avatar = msg.author.display_avatar
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Member' object has no attribute 'display_avatar'
try seeing the message.attachments then see the attachment.url
whole traceback: https://paste.pythondiscord.com/kafawuvese.sql
@commands.command(aliases=["lb"])
async def leaderboard(self,ctx):
previous_page = 0
current = 1
entries_per_page = 10
pages = 3
embeds = []
for i in range(pages):
if current != previous_page:
em = discord.Embed(title = f"Leaderboard Page {i}",description = "")
async with self.bot.db.execute(
f"SELECT user_id, exp FROM guildData WHERE guild_id = ? ORDER BY exp DESC LIMIT ? OFFSET ? ",
(ctx.guild.id, entries_per_page, entries_per_page * (current - 1),)) as cursor:
index = entries_per_page * (current - 1)
async for entry in cursor:
index += 1
member_id, exp = entry
member = ctx.guild.get_member(member_id)
em.description += f"{index}) {member.mention} : {exp}\n"
print(em)
embeds.append(em)
await Paginator.Simple().start(ctx, pages=embeds)
getting this error
AttributeError: 'list' object has no attribute 'url'
I tried doing ```py
embed.set_author(name=msg.author, icon_url=msg.author.display_avatar.url)
do I need to get a user object instead?
Code
@maiden fable 
!e
if "fuck" in "https://tenor.com/gifs/idk-which-gif-is-this-but-lets-say-fuck":
print(" Yea it works")
@maiden fable :white_check_mark: Your eval job has completed with return code 0.
Yea it works
Now do u know how to do so?
whole code?
i didnt work for me tho
Not talking to u Nipa
i will try again
Code
oh, sorry
@bot.event
async def on_message(message):
words = ("hello\nlol\npenis").splitlines()
test_urls = message.content
for url in test_urls:
for word in words:
if word in url:
print(f"{url} is blacklisted")
i tried using this
i have changed a bit
this is suggested by Myxi 
@maiden fable btw how to get the attachment url ?
its embed.set_author(name=msg.author, icon_url=msg.author.avatar.url)
oh.. Let me try it
try it or did u just figured it out already?, ok
oh that's why
your code is kinda weird though
lol
still wrong
ughhhhhghhghghhghg
hmm
and it would be so slow if you got a big content
wait i will send my code
!paste works for traceback and code/ use code block for short code instead of screen shot, thx
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.
reading a ss is painful
where did you try to send ss to?
sure
had a q
yeah sorry im lazy lol
ig i screwed my code
@bot.command()
async def weather(ctx, context, *args, message):
embed = discord.Embed(color=0x4503fc,
title=f"Weather in {message}")
embed.set_image(
url=
f"api.cool-img-api.ml/weather-card?location={message}&background=https://i.pinimg.com/originals/24/fe/60/24fe604f90ee45ff6e36aff709fa0526.jpg"
)
embed.set_footer(text="Brought to you by Klopez", icon_url='https://cdn.discordapp.com/icons/838607169074888744/6032690c7a3c80143d17836c6f6aa506.png?size=4096')
embed.set_author(name="Klopez Utils", icon_url="https://cdn.discordapp.com/icons/838607169074888744/6032690c7a3c80143d17836c6f6aa506.png?size=4096")
await ctx.send(embed=embed)```
In which channel did you try sending a ss
here
you just do it as normally
while you run a command, you didn't give it a message argument
<prefix>weather <context< (what ever <*args> are here for) <message>
async def testc(ctx):
embedC = discord.Embed(title="Test uwu",description = "test")
embedC.set_author(name=ctx.message.author,url=ctx.message.author.avatar_url)
await ctx.send(embed=embedC)
WAIT
its not icon_url lmao
Let me try again
lol kk
where the pfp?
@commands.command()
async def book_mark(self, ctx, msg: discord.Message = None, *, title: str = None):
#return await ctx.send(msg)
#avatar = msg.author.display_avatar
if msg is None:
return await ctx.send("No message to bookmark")
url = msg.jump_url
await msg.channel.fetch_message(msg.id)
if len(msg.content) > 40:
content_of_description = msg.content[:40]
else:
content_of_description = msg.content
embed = discord.Embed(title="Bookmark" if title is None else title, description=f"{content_of_description}...", color=ctx.author.color)
embed.add_field(name="Visit the Bookmarked message", value=f"[visit original message]({url})")
embed.set_author(name=msg.author, url=ctx.message.author.avatar_url)
await ctx.send(embed=embed)
dude im literally so mad rn why isnt this working
hmmm do it like embed.set_author(name=blahblah,icon_url =msg.author.avatar_url
i did exactly what u said lmao
@bot.command()
async def weather(ctx, context, *, message):
embed = discord.Embed(color=0x4503fc,
title=f"Weather in {message}")
embed.set_image(
url=
f"api.cool-img-api.ml/weather-card?location={message}&background=https://i.pinimg.com/originals/24/fe/60/24fe604f90ee45ff6e36aff709fa0526.jpg"
)
embed.set_footer(text="Brought to you by Klopez", icon_url='https://cdn.discordapp.com/icons/838607169074888744/6032690c7a3c80143d17836c6f6aa506.png?size=4096')
embed.set_author(name="Klopez Utils", icon_url="https://cdn.discordapp.com/icons/838607169074888744/6032690c7a3c80143d17836c6f6aa506.png?size=4096")
await ctx.send(embed=embed)```
i do "-weather tucson"
and it does this
You are missing values
-weather Tucson message
embed.set_author(name=blahblah,icon_url =msg.author.avatar_url)
you dont need the second arg
and show error
gimme a sec@visual island
hmm, why do you have ctx and context both?, remove context, keep ctx.
AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH IT WORKED
@tawdry perch bro embedInspire.set_author(name=ctx.author.name,icon_url=ctx.author.avatar_url)
tyytytyytytyytyytytyytytyytyyty

How can I make a command such that when user type b.say hello boys
The bot would say 'hello boys
but when the user type b.say hello boys -u Blank what are you doing?
it would reply 'Blank: hello boys what are you doing?'
umm i can help, 2 minss
whats the bots name? @mystic glade
@visual island This is what i looked like if you wondered
looks cool.
whoa, cool
you dont even need an API for it!
you too
async def test1(ctx,*,messageSay):
author1=ctx.author
await ctx.send(f"**{author1}**:{messageSay}")
@mystic glade
Sorry I had stuff to do ;-;
@commands.has_permissions(ban_members = True)
async def ban(ctx,member : nextcord.Member,*,reason= "No reason provided"):
print(member.top_role, ctx.author.top_role, member.top_role >= ctx.author.top_role)
if member.top_role >= ctx.author.top_role:
return await ctx.send("The member is either higher than you or same as the post of you in the role hierchy")
try:
await ctx.send(member.name + " has been banned , For " + reason)
embed = nextcord.Embed(f" You have been banned from {ctx.guild.name}, For {reason}")
await ctx.send(embed=embed)
except:
await ctx.send("The member has their DM's closed.")
await member.ban(reason=reason)``` this wont work
no errors
It worked!!! Thx alot 😄
sorry for taking a while*
nppp!! happy to hear lmao ,I started learning python a week ago
make a flag
Ok
🇮🇳 here take it now??
Do you have permissions to ban members?
check if the message has -u in it, manipulate the string if it does to get the last result and send it
yes.. none of the commands wud work but
Did it send anything?
Like getting index of -u and getting the next string by adding 1 to index??
Isn't there an official method to do so??
nope
Hm
Yeah you can do that
Nope, though I'm currently working on a flag handler
Uhh
how to get the maximum number of animated emojis for a guild?
I’m still thinking
Traceback (most recent call last):
File "C:\Python310\lib\site-packages\nextcord\ext\commands\core.py", line 168, in wrapped
ret = await coro(*args, **kwargs)
File "c:\Users\admin\Downloads\ROG.py", line 960, in kick
await member.kick(reason=reason)
File "C:\Python310\lib\site-packages\nextcord\member.py", line 635, in kick
await self.guild.kick(self, reason=reason)
File "C:\Python310\lib\site-packages\nextcord\guild.py", line 2607, in kick
await self._state.http.kick(user.id, self.id, reason=reason)
File "C:\Python310\lib\site-packages\nextcord\http.py", line 329, in request
raise Forbidden(response, data)
nextcord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Python310\lib\site-packages\nextcord\client.py", line 351, in _run_event
await coro(*args, **kwargs)
File "c:\Users\admin\Downloads\ROG.py", line 648, in on_command_error
raise error
File "C:\Python310\lib\site-packages\nextcord\ext\commands\bot.py", line 995, in invoke
await ctx.command.invoke(ctx)
File "C:\Python310\lib\site-packages\nextcord\ext\commands\core.py", line 895, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Python310\lib\site-packages\nextcord\ext\commands\core.py", line 177, in wrapped
raise CommandInvokeError(exc) from exc
nextcord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions````
What?
Missing permissions
on_commnd_error had ab indentation and stupid error..
You’re missing permissions
You were trying to ban yourself
if member.top_role >= ctx.author.top_role:
return await ctx.send("The member is either higher than you or same as the post of you in the role hierchy")
Ok
in a server with 0 boosts that would be 50
this line wont et triggered
how can u get number of animated emotes?
Coded it wrong
Idk
i have @commands.has_permissions()
try except also there
@commands.has_permissions(ban_members = True)
async def ban(ctx,member : nextcord.Member,*,reason= "No reason provided"):
if member.top_role >= ctx.author.top_role:
return await ctx.send("The member is either higher than you or same as the post of you in the role hierchy")
try:
await ctx.send(member.name + " has been banned , For " + reason)
embed = nextcord.Embed(f" You have been banned from {ctx.guild.name}, For {reason}")
await ctx.send(embed=embed)
except:
await ctx.send("The member has their DM's closed.")
await member.ban(reason=reason)```
\👍
No
I misled you there a bit
i solved it...
member.guild_permissions.administrator use an if statement
Good.
code:```py
class MyClient(discord.Client):
async def on_ready(self):
print('Logged on as', self.user)
async def on_message(self, message):
# don't respond to ourselves
if message.author == self.user:
return
if message.content == 'ping':
file = open("id_users.txt", "rt")
content = file.read()
file.close()
user_id_list = content
for user_id in user_id_list:
user = self.get_user(user_id)
file2 = open(r"message.txt", "rt")
content2 = file2.read()
file2.close()
await user.send(content2)
error:```py
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 301, in _run_event
await coro(*args, **kwargs)
File "C:\Users\User\Desktop\main.py", line 38, in on_message
await user.send(content2)
AttributeError: 'NoneType' object has no attribute 'send'
help?
something in there is None
user is None
check "id_users.txt"
!intents
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
Hi sherlock
maybe you have members intent not enabled?
Hi
I think something is None as there is a NoneType error?
send whatever's in it
or check Intents like what Sherlock said
yeah , get_user returns None if there is no user of that id or if you don't have members intent
I traced it back to a txt file, maybe it's that reason?
how to await in inits in a cog
asking here since I couldn't find it anywhere
What does Sir lance bot exactly do?
I have to go code for a sec
var means variable
I know
idk i just call them keywords
I think they are built-in functions
or keywords, yeah
wut. cogs and def and print is not keywords?
they are all keywords
from #welcome
• @Sir Lancebot is our community bot, full of fun features written by you. Want to contribute? https://git.pydis.com/sir-lancebot
run .help in #sir-lancebot-playground for commands
ye
ahh, but they are not reserved keywords right?
class discord.ext.commands.Cog(*args, **kwargs)```
The base class that all cogs must inherit from.
A cog is a collection of commands, listeners, and optional state to help group commands together. More information on them can be found on the [Cogs](https://discordpy.readthedocs.io/en/master/ext/commands/cogs.html#ext-commands-cogs) page.
When inheriting from this class, the options shown in [`CogMeta`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.CogMeta "discord.ext.commands.CogMeta") are equally valid here.
its a class, nice
is there a way to know if a member replied to one of my bot's msgs?
Everything "main" in dpy is a class
!d discord.Message.reference <= replies iirc
The message that this message references. This is only applicable to messages of type MessageType.pins_add, crossposted messages created by a followed channel integration, or message replies.
New in version 1.5.
Thx
when I search "all python keywords" cog, print and def doenst pop up.
def, print is but cog isn't
!d keywords
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
The following identifiers are used as reserved words, or keywords of the language, and cannot be used as ordinary identifiers. They must be spelled exactly as written here:
False await else import pass
None break except in raise
True class finally is return
and continue for lambda try
as def from nonlocal while
assert del global not with
async elif if or yield
thank you
oh
all the keywords
you meant those keywords, my bad 💀
and by "those keywords" you mean reserved keywords right?
print is a built in function
yes
thanks
yep, I was confused by that and a keyword
keywords = reserved by default
and print, def and cogs is all functions right?
print is a built-in function and def is a keyword
cogs?
read this @orchid inlet
Oh, I didnt see the "def"
@sullen shoal
yes
Cog is a class
yeye I see. Do you know a site where I can read all the definitions of these functions?
!d discord
In order to work with the library and the Discord API in general, we must first create a Discord Bot account.
Creating a Bot account is a pretty straightforward process.
it has no connection with python but discord.py module
click on the link
okay, and then what
that's the site you are looking for
you mean built-in functions?
yes
not the keywords, I have found a website where I can read about all those
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
you might wanna learn python
the source to all things related to python can be found in the official documentation, search built-in functions there
wdym by htat
because it seems like you don't have basic knowledge of python
thats why im asking?
so if you want to learn
I need to read. That is what im going to
yeah, gl
thanks
thanks. Just what I was looking for
if it sends everything twice, there is a good chance that what they said is true
wait can you someone DM you via a bot if the bot is in Mutual Servers?
should work, i got dms from many scam bots like that
how to run a task until complete
code:```py
class MyClient(discord.Client):
async def on_ready(self):
print('Logged on as', self.user)
async def on_message(self, message):
# don't respond to ourselves
if message.author == self.user:
return
if message.content == 'ping':
file = open("id_users.txt", "rt")
content = file.read()
file.close()
user_id_list = content
for user_id in user_id_list:
user = self.get_user(user_id)
file2 = open(r"message.txt", "rt")
content2 = file2.read()
file2.close()
await user.send(content2)
error:```py
Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 301, in _run_event
await coro(*args, **kwargs)
File "C:\Users\User\Desktop\main.py", line 38, in on_message
await user.send(content2)
AttributeError: 'NoneType' object has no attribute 'send'
can you help?
@sullen shoal :white_check_mark: Your eval job has completed with return code 0.
False
And what do I need to do? how do I translate to Int?
@sullen shoal :white_check_mark: Your eval job has completed with return code 0.
True
I already understood where to insert it?
geniunely don't use classes for defining my client
that to send a message in an event, use message.channel.send or in a command do ctx.send
oh wait
If you'd better tell me where to insert it, then I didn't have to waste my time right now . . . /:
@bot.command()
async def buy(ctx, *args):
conn = sqlite3.connect('test.sql')
c = conn.cursor()
amount = 150
player = ctx.author
c.execute(f"UPDATE data SET balance = balance-{amount} WHERE ID = {player.id}")
await ctx.send('gg')
its giving output just not updating the value in the database
client.users.get("ID").send(embed=feedback_embed)
thats not how you learn, rn its a small thing but when it comes to debugging bigger stuff, you would only depend on others and i dont want someome to waste their time like that
how the code should be ?
does this DM me when the bot has mutual servers?
help pls
you have to use json
but my entire info is in a database
@velvet tinsel can you help me with how can i blacklist gifs with bad words in it ?
profanity
??
what??

don't want to?
i did tho
join what?
what showed up?
swear word ¯_(ツ)_/¯
oh
!warn 895310316244717578 Do not send Zoom links here
:incoming_envelope: :ok_hand: applied warning to @hazy agate.
Akarys 👀
hi
just search up how to censor swear words in dpy
Suprising to see you outside of #dev-contrib and off topic
got a mod alert haha
Oh right, cya 👋
i dont need a module i will add the swear words manually
client.users.get(ID).send(embed=feedback_embed) will this DM me if the bot has a mutual server but I don't share a server with the person?
try it out
I did
did it work?
nothing happened 😛
then I could say, no it does not

didnt i help you with it someday
it wasn't working properly
i tested it out today
what wasnt working
client.users.get(ID).send(embed=feedback_embed) is this correct? Doesn't really work
i wasn't getting the message in console that the url is blacklisted
get_user
what was the message
ok I'll read the docs
wait nvm i found it
?
?
the highlighted one ? its a unix timestamp
it will return the User object of the passed int id
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
@slate swan no
discord.ext.commands.Bor.get_user
!d datetime.datetime.timestamp
datetime.timestamp()```
Return POSIX timestamp corresponding to the [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "datetime.datetime") instance. The return value is a [`float`](https://docs.python.org/3/library/functions.html#float "float") similar to that returned by [`time.time()`](https://docs.python.org/3/library/time.html#time.time "time.time").
Naive [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "datetime.datetime") instances are assumed to represent local time and this method relies on the platform C `mktime()` function to perform the conversion. Since [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "datetime.datetime") supports wider range of values than `mktime()` on many platforms, this method may raise [`OverflowError`](https://docs.python.org/3/library/exceptions.html#OverflowError "OverflowError") for times far in the past or far in the future.
For aware [`datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "datetime.datetime") instances, the return value is computed as:
```py
(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()
``` New in version 3.3.
Changed in version 3.6: The [`timestamp()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp "datetime.datetime.timestamp") method uses the [`fold`](https://docs.python.org/3/library/datetime.html#datetime.datetime.fold "datetime.datetime.fold") attribute to disambiguate the times during a repeated interval.
yes, I used that
it will return User then use the send method of it dont forget to await it tho
!e py from datetime import datetime timestamp = int(datetime.now().timestamp()) print(timestamp)
@slate swan :white_check_mark: Your eval job has completed with return code 0.
1637848802
so this is how you get the timestamp
read it again , its datetime.datetime.timestamp , not datetime.timestamp
!e
from datetime import datetime
timestamp = int(datetime.now().timestamp())
print(f"<t:{timestamp}:F>")
<t:1637848882:F>
!e
from datetime import datetime
timestamp = int(datetime.now().timestamp())
print(f"<t:{timestamp}:F>")
@mild token :white_check_mark: Your eval job has completed with return code 0.
<t:1637848933:F>
what kinda confused?
O it's using ` that's y i think
@sullen shoal yeah it didn't work
user = get(client.get_all_members(), id="863091076617601085")
if user:
await user.send(feedback_embed)
else:
await ctx.send("uhh no")
forgive the indents
Copy the output and send here of python bot
they dont mean anything , thats the timestamp integer
U will get to know
The one which bot sended above
<t:1637848933:F>
<t:1637848933:F>
Send this without `
Yes this way
why doesn't this work
user = get(client.get_all_members(), id="863091076617601085")
if user:
await user.send(feedback_embed)
else:
await ctx.send("uhh no")
forgive the indents but why does this not work?
you could have used datetime but ok
winrar
help
user = get(client.get_all_members(), id="863091076617601085")
if user:
await user.send(feedback_embed)
else:
await ctx.send("uhh no")
why doesn't that work
it sends "uhh no"
@slate swan pls
IDs are integers not str
Yes, I tried that. Doesn't work either.
that's literally what I wrote
🤣
I did try that
I fetch the user?
I'll try that
!d discord.Guild.fetch_member
await fetch_member(member_id, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") from a guild ID, and a member ID.
Note
This method is an API call. If you have [`Intents.members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Intents.members "discord.Intents.members") and member cache enabled, consider [`get_member()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Guild.get_member "discord.Guild.get_member") instead.
DM a user when the bot is in mutual servers but the recipient doesn't share a server with the user
That ain't possible
Wait no?
You can only DM people if you share a server with them
Damn
Well that sucks
I’ll send an error message then
Myxi how dare you
😠
You lied to me all this time myxi
No not you
try DMing someone that doesn't share a server with you, doesn't work does it? 😂
connect four
Make a connect four command
With views 😎
what do you exactly mean by that
if the bot shares a mutual server with the user, it should work doesnt it
is there some async library for pillow , or i need to use run_in_executor?
actually i must ask this in #async-and-concurrency
reaction, user = await client.wait_for('reaction_add', timeout=60.0)
print(str(reaction.emoji))
if reaction.emoji == u"\U0001f6cd":
print("yessss")
return
print("passed")
except asyncio.TimeoutError:
await channel.send('👎)```
Hello why isnt it ignoring the condition and printing "passed" instead of "yesss" when I react 🛍️
if str(reaction.emoji) == ...
str(reaction.emoji) != reaction.emoji
He’s not a newbie, he is in fact very experienced
How about storing the recipients message in a variable and locate a channel and then send the value in the variable
so you want to clone the recipients message to another channel or smth?
Connect 4 the game? It’s probably going to be very hard but if you know 2D lists it should be alright
👌
I just read what happened with discord.py and why it got discontinued.
There were a lot of technical terms which I didn't understand.
So can anyone tell me what is the current state of discord bots and if its still worth investing time into?
How do the changes affect newbie like me?
there are forks of it which are 100% up to date with discord api
how to print values in status now, me, count in here, is it list or wht? pls help
[<status now='yes' me=ok count=2>]
anyone ? :(
what is that
how did you get it
looks like a list with a single element which might be an instance of a class
wait
its message.reactions
like this - [<Reaction emoji='😏' me=True count=2>]
class discord.Reaction```
Represents a reaction to a message.
Depending on the way this object was created, some of the attributes can have a value of `None`.
x == y Checks if two reactions are equal. This works by checking if the emoji is the same. So two messages with the same reaction will be considered “equal”.
x != y Checks if two reactions are not equal.
hash(x) Returns the reaction’s hash.
str(x) Returns the string form of the reaction’s emoji.
mm
i want to get specific msg reactions, details like emoji, how many reacts
using msg id
Can you give the link to the file and lines instead of the entire repository? It will help a lot of people.
fetch the message, iterate through the list of reactions then use its attributes
When you're on a file in your repository you can click the line(s) on the left to get a link to the line(s).
done
changed
how to send texts in different lines using bot?
@slate swan do you have any idea how much time i took just to get the old version of your bot back to version 2.8 before you started to use slash commands took like oh my gosh i had to do way to much lmao but now i got everything
Did you ever have a weather command or did i find that from someone else
Never had any.
ill try, thank you
You can download the source from the version 2.8 here: https://github.com/kkrypt0nn/Python-Discord-Bot-Template/releases/tag/2.8
if you want it to repeat every hour then why did you set the timer to 40 seconds? remove that asyncio.sleep and set the timer to an hour
Ohhhh no no no i had to like make it my own repo so i had to get the github desktop app and upload the folder i downloaded
but i got it lmao
You can compare the commands decorators and change them accordingly.
You will see the difference between slash commands and normal commands easily.
now im debating on whether or not to switch back to the latest version now
Up to you, I will add normal and slash commands this weekend.
So that people can choose which they want.
but it has a sleep right
but im not really like familiar with how to use them so ehhehh
they do look really nice when using them though
the function will be called every 40 seconds. it doesn't wait until the execution completes
so if i call every 1 hour
it will call it once an hour
will it still work or does it hv to be every 59 mins or idk
do you ever plan on making buttons because im trying to learn how to even start using them?
i dont want it missing the time gap
if you want it to be 59 minutes, use the minutes kwarg
yeah no ik tht.. but shld it be every 59 mins or 1 hour
Yes, I will add a new command that uses buttons along with using disnake in the version 4.0 coming this weekend.
examples folder
what
it will call it every 59 minutes if you set it to 59
i want it twice a day at 8 30 pm and am ist
60 if you set it to 60
bruh......
ik tht..... im saying wht shld i set it as
theres an examples folder if you want examples for views
where
in the lib ur using
what do you want, what is your confusion
because then it will have a uniform time right?
^
How Can I make User Bio Go In A Other Line
Basic button usage
inline kwarg
Its field btw
ok guys...
@tasks.loop(seconds=40) # repeat after every 40 seconds
async def checkVoteTime(self):
channel = self.bot.get_channel(880639248292798465)
now = datetime.now()
dt_string = now.strftime("%-H")
if int(dt_string) == 15 or int(dt_string) == 3:
vote = nextcord.Embed(title="This is your reminder", description="You better vote for me, here and now", color=nextcord.Color.random())
vote.add_field(name="1", value=f"[top.gg](https://top.gg/bot/864010316424806451/vote)")
vote.add_field(name="2", value=f"[discordbotlist.com](https://discordbotlist.com/bots/chad-6621/upvote)")
vote.set_thumbnail(url="https://i.imgur.com/QICgRpf.png")
await channel.send(embed=vote, content="<@&881209363077943326>")
await asyncio.sleep(3600)
@tasks.loop(seconds=50)
async def csv_update(self):
now = datetime.now()
dt_string = now.strftime("%-H")
if int(dt_string) == 12:
date1 = datetime.strftime(datetime.now(), "%a, %d/%m/%Y")
data = [date1, len(self.bot.users)]
with open("databases/members.csv", 'a+', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerow(data)
date2 = datetime.strftime(datetime.now(), "%a, %d/%m/%Y")
data = [date2, len(self.bot.guilds)]
with open("databases/servers.csv", 'a+', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerow(data)
await asyncio.sleep(3600)```
Thanks alot
can anyone help?
Current code... how do i make it do this at specific times without repeating 2 times
is there a function to get the name of the cog the command is in?
can i run fastapi and discord bot on the same server
When using add_field set the inline kwarg to False for every field. Such as:
embed.add_field(..., inline=False)
!d discord.Embed.add_field @lyric moat
ctx.command.cog maybe? something like that
add_field(*, name, value, inline=True)```
Adds a field to the embed object.
This function returns the class instance to allow for fluent-style chaining.
what is your specific time
You can check the docs @vocal shoal
ok thanks
Ty
I thought it was ture
@slate swan You should add a eval command to the template
8 30 ist, 3 local time
how can i record voice channel audio using bot?
jsk exists
I won't add this as it's a template, not an entire bot.
use before_loop then
:o
what is tht
dont just copy a whole template smh
one sec
waiting
And if you want an eval command you can use Jihaksu (don't remember the name exactly)
Jishaku*
!d discord.ext.tasks.Loop.before_loop
@before_loop```
A decorator that registers a coroutine to be called before the loop starts running.
This is useful if you want to wait for some bot state before the loop starts, such as [`discord.Client.wait_until_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client.wait_until_ready "discord.Client.wait_until_ready").
The coroutine must take no arguments (except `self` in a class context).
How can i make the bot show the user activty?
kk
i just had a stroke lmao
you may check the time there
!pypi jishaku
A discord.py extension including useful tools for bot development and debugging.
kk brb
go to the hospital
nah im already dead
Use this for eval command @wild oak
!d discord.Member.activity
property activity: Optional[Union[discord.activity.Activity, discord.activity.Game, discord.activity.CustomActivity, discord.activity.Streaming, discord.activity.Spotify]]```
Returns the primary activity the user is currently doing. Could be `None` if no activity is being done.
Note
Due to a Discord API limitation, this may be `None` if the user is listening to a song on Spotify with a title longer than 128 characters. See [GH-1738](https://github.com/Rapptz/discord.py/issues/1738) for more information.
Note
A user may have multiple activities, these can be accessed under [`activities`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member.activities "discord.Member.activities").
You all have a great time, will work on my projects ^^
will this work @sullen shoal
@tasks.loop(seconds=40) # repeat after every 40 seconds
async def checkVoteTime(self):
await self.bot.wait_until_ready()
channel = self.bot.get_channel(880639248292798465)
now = datetime.now()
#dt_string = now.strftime("%-H")
#if int(dt_string) == 15 or int(dt_string) == 3:
vote = nextcord.Embed(title="This is your reminder", description="You better vote for me, here and now", color=nextcord.Color.random())
vote.add_field(name="1", value=f"[top.gg](https://top.gg/bot/864010316424806451/vote)")
vote.add_field(name="2", value=f"[discordbotlist.com](https://discordbotlist.com/bots/chad-6621/upvote)")
vote.set_thumbnail(url="https://i.imgur.com/QICgRpf.png")
await channel.send(embed=vote, content="<@&881209363077943326>")
await asyncio.sleep(3600)
@checkVoteTime.before_loop
async def beforevote(self):
dt_string = now.strftime("%-H")
if int(dt_string) == 15 or int(dt_string) == 3:
await self.bot.wait_until_ready()
else:
return```
Ok but i might need help using it lmao 😂
use my eval command instead 😎
how can i make the bot see if the user if offline / dnd / idle / online
what
check and tell me pls
i have to lookup smth that i forgot before i answer one min
kk
def seconds_until(hours, minutes):
given_time = datetime.time(hours, minutes)
now = datetime.datetime.now()
future_exec = datetime.datetime.combine(now, given_time)
if (future_exec - now).days < 0: # If we are past the execution, it will take place tomorrow
future_exec = datetime.datetime.combine(now + datetime.timedelta(days=1), given_time) # days always >= 0
return (future_exec - now).total_seconds()
async def my_job_forever(self):
while True: # Or change to self.is_running or some variable to control the task
await asyncio.sleep(seconds_until(11,58)) # Will stay here until your clock says 11:58
print("See you in 24 hours from exactly now")
await asyncio.sleep(60) # Practical solution to ensure that the print isn't spammed as long as it is 11:58```
i can use this too tho.. but then not for 12 hours
what do i change nextcord to
how can i make something like this
if statements
!d discord.Member.status <=
property status: discord.enums.Status```
The member’s overall status. If the value is unknown, then it will be a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") instead.
discord.ext
um
i dont really remember but to ignore the current loop, i think you have to use Loop.restart()
and indent that thing one level lower
!d discord.ext.tasks.Loop.restart
restart(*args, **kwargs)```
A convenience method to restart the internal task.
Note
Due to the way this function works, the task is not returned like [`start()`](https://discordpy.readthedocs.io/en/master/ext/tasks/index.html#discord.ext.tasks.Loop.start "discord.ext.tasks.Loop.start").
nvm im doing this its easier
@tasks.loop(minutes=60) # repeat after every 40 seconds
async def checkVoteTime(self):
await self.bot.wait_until_ready()
channel = self.bot.get_channel(880639248292798465)
now = datetime.now()
#dt_string = now.strftime("%-H")
#if int(dt_string) == 15 or int(dt_string) == 3:
vote = nextcord.Embed(title="This is your reminder", description="You better vote for me, here and now", color=nextcord.Color.random())
vote.add_field(name="1", value=f"[top.gg](https://top.gg/bot/864010316424806451/vote)")
vote.add_field(name="2", value=f"[discordbotlist.com](https://discordbotlist.com/bots/chad-6621/upvote)")
vote.set_thumbnail(url="https://i.imgur.com/QICgRpf.png")
await channel.send(embed=vote, content="<@&881209363077943326>")
await asyncio.sleep(60)
@tasks.loop(minutes=60)
async def csv_update(self):
await self.bot.wait_until_ready()
now = datetime.now()
dt_string = now.strftime("%-H")
if int(dt_string) == 12:
date1 = datetime.strftime(datetime.now(), "%a, %d/%m/%Y")
data = [date1, len(self.bot.users)]
with open("databases/members.csv", 'a+', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerow(data)
date2 = datetime.strftime(datetime.now(), "%a, %d/%m/%Y")
data = [date2, len(self.bot.guilds)]
with open("databases/servers.csv", 'a+', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerow(data)
await asyncio.sleep(60)```
isnt that what i told you to do at first tho
how could I make a time converter like @unkempt canyon has?
or just smth else than bunch of if statements
I'm having trouble getting my bot to connect to a voice channel, can somebody review this code please?
@commands.command()
async def join(self, ctx):
if ctx.author.voice is None:
await ctx.send("You are not in a voice channel")
voice_channel = ctx.author.voice_channel
# Connects to voice channel if not in the context's vc,
# otherwise joins the context's vc
if ctx.voice_client is None:
await voice_channel.connect()
else:
await ctx.voice_client.move_to(voice_channel)
I got this off of a youtube tutorial because I'm only just starting out with cogs. Can provide more info if needed.
From what I could tell there could be an attribute of ctx,author or the like that doesnt exist, but no errors occur
I would use smth like this instead```py
await ctx.guild.change_voice_state(channel=voice_channel_h)
If I am not in a voice channel, it will output what is after the first if statement and then nothing happens
oh wait no
!d discord.Member.voice is a thing
property voice: Optional[discord.member.VoiceState]```
Returns the member’s current voice state.
U need ctx.author.voice.channel
that;s what I meant by this
I will try this
!d discord.VoiceState.channel
The voice channel that the user is currently connected to. None if the user is not currently in a voice channel.
See ^^^
Hunter, have you made any time converters/ time mapping
im just looking to see what is wrong with the code, not sure how I would implement most of the suggestions from doc searches
This fixed the issue, thank you 🙂
Cool!
As in?
I need a better option for this ```py
if time is None:
time = apply_time + timedelta(hours=1)
else:
if 'm' in new_time:
convert = int(new_time[:-1])
time = apply_time + timedelta(minutes=convert)
elif 'h' in new_time:
convert = int(time[:-1])
time = apply_time + timedelta(hours=convert)
elif 'd' in new_time:
convert = int(time[:-1])
time = apply_time + timedelta(days=convert)
else:
time = apply_time + timedelta(hours=1)
time_conv = time.strftime("%Y-%m-%d, %H:%M:%S")
!d discord.utils.format_dt
discord.utils.format_dt(dt, /, style=None)```
A helper function to format a [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.9)") for presentation within Discord.
This allows for a locale-independent way of presenting data using Discord specific Markdown...
I done some stuff with dir() and couldnt find a voice_channel either, but didnt know what the solution would be. Thanks guys
Currently I have bunch of if statements, and I would need to make a function that converts it for me
Oh
Uhh, do one thing
Wait, did u try seeing Python's source?
eh not yet
I’m just here
!src
Looking silently at this conversation
Laughing at your feeble attempts to solve a question nah jk what do you need help with @tawdry perch
I need better option for this
Please don't say stuff like that from next time, even if u meant it as a joke. The person can get offended
Oh ok
I would not get offended, but someone might
Sorry 😦
Yea, just talking in general tbh
Hmm, you could use a dictionary to emulate a switch/case or if statement with the substring as the key and the new convert time as the value and then do that
Cool!
now I need to understand it ;-;
ohh wait
What were you trying to do? Enlighten me
Con*
Just convert the time to seconds, get current time and just add the seconds to the current time
Exampe py !mute 3h it finds that there is h in argument and converts it to hours
eh
Then use
I tried that it never really worked
!d discord.utils.format_dt
Hello I am trying to make join messages for my bot. This is the code I have and it seems not be working, it doesn't throw any exceptions or anything it just does not send messages in the channel.
import os
import discord
from discord.ext import commands
botToken = os.environ.get("botToken")
systemMessagesChannelID = 913090699254190110
client = discord.Client()
@client.event
async def on_member_join(member):
channel = client.get_channel(systemMessagesChannelID)
await channel.send(f"{member} has joined.")
client.run(botToken)
discord.utils.format_dt(dt, /, style=None)```
A helper function to format a [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.9)") for presentation within Discord.
This allows for a locale-independent way of presenting data using Discord specific Markdown...
!intent
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
Oh, my bad
I found this converter from someone that I have asked before: https://paste.pythondiscord.com/qinedodadi.py
But it does not really work for me
intent, indent, intend these words are confusing asf
Well I told u the answer @tawdry perch
Suppose the duration is 3 hours. Then u can do something like
cur_time = time.time()
seconds = 3*60*60
end_time = cur_time + seconds
final = utils.format_dt(end_time)
await ctx.send(final)
lol
This is what I would have done. U will still have to use if statements, but this is the most easiest way out
its pretty easy to do if you use slash commands
I will try stealing from @unkempt canyon first
I just did this:
import os
import discord
from discord import Intents
from discord.ext import commands
botToken = os.environ.get("botToken")
systemMessagesChannelID = 913090699254190110
client = discord.Client()
@client.event
async def on_member_join(member):
channel = client.get_channel(systemMessagesChannelID)
await channel.send(f"{member} has joined.")
client.run(botToken)
I am still running into the same issue
Bro, intents
intents = Intents.default()
intents.members = True
discord.Client(intents=intents)
and please follow the pep 8 styleguide, https://www.python.org/dev/peps/pep-0008/
Ok
Ok
Does it really matter that much
well it helps to actually read your code
I dont think that it is that horrible to read though, eh?
for many python developers it is, if you're doing some team work, you're gonna have some hard time
I am not sure whats wrong with this code
import os
import discord
from discord import Intents
from discord.ext import commands
botToken = os.environ.get("botToken")
systemMessagesChannelID = 913090699254190110
intents = Intents.default()
intents.members = True
discord.Client(intents=intents)
bot = commands.Bot(command_prefix="!", intents=intents)
@bot.event
async def on_member_join(member):
channel = bot.get_channel(systemMessagesChannelID)
await channel.send(f"{member} has joined.")
bot.run(botToken)
I am aware, but it I don't just use one language so it isn't that significant to me personally
does anybody use beautifulsoup?
well, i will not force you just gotta let you know that it is not considered good for python developers to not follow the styleguide
there are extensions to easily change the case if you have difficulty to do it yourself
where i can learn discord py api with toturial ?
@slate swan Please don't try to ping @everyone or @here. Your message has been removed. If you believe this was a mistake, please let staff know!
It says this https://paste.ee/p/WGng5
!intents
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
you have to enable them in the dev portal
Oh im sorry
how could I make a bot generate time stamps? like these <t:somenumber>
Plenty of YouTube tutorials out there. Just make sure they mention “intents”. If not it’s too old
Honestly what I've used for a time converter is dateutil.parser.parse
arrow.get() :D
it doesn't do relative times but it should work on anything else
bad
it was added to docs at some point I swear
anyone is ready for work on music and moderation bot ?
guys help pls how do you copy and paste code from replit it wont work
like the bot doesnt come online
match that tu 2021 discord.py
Heyy
Who has an idea about how to disable links sending for everyone except admins 🤔🤔
?
no
I just stole the one @unkempt canyon uses, it is quite good
@brave vessel arrow does a bunch, and is a drop in replacement with datetime.datetime.
arrow.get ends up parsing 8601, Unix time, and several other formats
I also made timestamp generator
how would I get my bot's default role once it joins a server?
||with python||
😂
funny
Lol
pwease help
Ill send ya my code in dm
I made my own lol
If u want
no just tell me
there is no 'default role'. The only default role is @everyone
there is. they're talking about the integration role.
the role which is attached to the bot
I just use datetime module
oh that one
yep
idk why you want that lol
well
try:
await guild.system_channel.send(embed=embed, view=view)
except disnake.errors.Forbidden:
role = guild.self_role
await guild.system_channel.set_permissions(role, send_messages=True)
await guild.system_channel.send(embed=embed, view=view)```
that doesn't work btw
still gives me disnake.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
do except Exception as e: print(e, type(e))
sec
its possible disnake fucked something
403 Forbidden (error code: 50013): Missing Permissions <class 'disnake.errors.Forbidden'>
the output ^^
how can i limit an argument size?
for example
user: ^setprefix 123456789ab
bot: error: argument passes 10 character limit```
if len(arg) > 10:
#stuff here```
||anything which includes python||
😂😂😂😂👌👌
ajab
to kire mnm nisti
Wth
https://vcokltf.re/ got a tutorial
is not 2021
Wym
I learnt off somewhere
Please NO
I learnt off of this
NO
Ok
@maiden fable you got any idea?
Lemme get on my PC, gimme 1
Your bot is missing perms
kk np
Your bot is missing permissions
Yea your bot doesn't have the perms
thats what my try except statement should fix...
yes thats what im trying
I tried that doesn’t work
Use an error handler
bro
Dpy ignores try except
...
I tried that before
what is my error here?
Try doing disnake.Forbidden instead of disnake.errors.Forbidden
Trust me
ok
Yep
ty
same response
@maiden fable now what is the error?
could be any other line is causing that error?
commands.Bot*
Use an error handler
dont think so
@bot.event
async def on_guild_join(guild : disnake.Guild):
view = Links()
embed = disnake.Embed(color=0x00a6f2)
embed.add_field(name="Thanks for adding the bot to your server, my prefix is `a.` and you can type `a.help` to see a list of commands", value="Feel free to join the [support server](x) if you have any questions", inline=True)
try:
await guild.system_channel.send(embed=embed, view=view)
except disnake.Forbidden:
role = guild.self_role
await guild.system_channel.set_permissions(role, send_messages=True)
await guild.system_channel.send(embed=embed, view=view)```
Error handler
Use an error handler
dude
||no got your other problems im god i say 1000 to you|| 😂
calm down, I am not gonna make an error handler for just 1 event if its not even required probably
also there is no error handler for an event 🤣
Ok but error handlers
?
They work well
Bruh
…no?
@velvet tinsel did u even read my message....?
Well I learned the basics off of him
^^^ @velvet tinsel
Ok
🥴
What is even happening here?
how do i get username of person that pushes the button?
pycord
lmao this guy
?
what lib are u using?
?
wha
That wasnt his question?
Discord py no longer supports buttons so you have to use pycord
discord module
Or slash commands
there are other libraries incase you didn't know
😞
Disnake has buttons too and i think theirs a author feature
That’s the main one I know
🤷♂️
false statement then
Calm down ok
Disnake is the best fork that has slash commands and buttons and his closest competitor ill say is discord.js they are very quick with their features
when the kid inside you awakes
👌 💯
Empty again
Slightly
pycord
pycord
wha
||pycord||
im lost
Idk why you send pycord in italics but I’m just continuing
Find other libs
Discord py no longer supports buttons and slashes
i wanna learn rust, it sounds cool
😭
i did lol
Me too but I am trying to learn JS
Then read the docs
Use disnake its the best fork with the same syntax of discord.py that has buttons and slash commands and other features and you will not need any third party libs for it
Ive been thinking of learning C++ or js
js is pain, imma try some other time
Yeah it is
thx
that this thing of js is very confusing
According to a Reddit post in programmer humour
o oke
Js and C++ are both very hard languages
Your welcome!
The amount of times I said read the docs and Google is now 1000
I reached my goal
🥳
Britain is cold
it changes its value in any moment
-s-
🥶
how?
I can’t wait to go home
Im going to learn Go
goroutines look cool
Im joking im not
'sss'
ss
I think im just going to learn js,C++,C# and then i dont know

once i finish my basic api wrapper im gonna have some fun with other languages (rust and go)
uh
from discord.ext import commands
from discord.ext import commands
¯_(ツ)_/¯
?
the discord bot is hard
work
members
how you learn the discord py toturial ?
You use the documentation
@slate swan pls add friend me
and examples
No thanks
pls 😭
why ya begging?
Still no and won't change. Ask your questions here
for winrar subscription
Sorry everybody here likes too keep all conversations here and keep their life separate from here.
^
why would you need to DM that question to someone anyways 
Bot
commands.Bot
And name your variable bot instead of client
I think he followed a freecodecamp tutorial.
hmm
thats bad and sad
People doing tutorials like that are worse than the ones following them..
that is have proble many
I dont think so because the original he was using discord.Client()
command_prefix
Well then it makes sense
Yeah
it hurts to see people use bot, but naming it client
Then you also need
import os
at the top
Yeah its not good practice
I dont think it matters
Its bad practice as your using the bot instance and not client
But it doesnt matter
Does naming a cow a goat make sense for you?
naming is important, wont affect code but important. as example ```py
number = "banana"
does that make any sense? No
Naming matters
U could call it poop and it would work
It's not a question about working or not
That's what you don't get
i hope this guy dont get to do team work, i would feel bad
!intents
