#discord-bots
1 messages · Page 1004 of 1
check if you have multiple @bot.command() in your code.
gosh these dudes are annoying
They can enjoy their pings 
How to make a bot recognize emojis like general emojis not server specific ones
How
Recognize?
Elaborate on recognize
This is named yert and can be used to recognize as
if 'yert' in message.content
Same way for others
if '🗿' in message.content:
...
Of course words won't work
you need to use the unicode form of the emoji
How
You're trying to find the emoji
I just typed the emoji in it didn't work
Use the unicode
mind showing your code?
K
you pointed your middle finger at me😡
Wanna see a very inefficient method
🗿
im finger-less
You type with your toes
Guess that's a yes
erm i came to ask a question is now a bad time?
apparently i got burns on my right hand so that does make sense
def not, ask!
not at all
remove those spaces
aight snm
I don't think it will work but ok will try
!e ```py
message = "🗿 yea the emoji is in this string"
if "🗿" in message:
print("works!")```
@slate swan :white_check_mark: Your eval job has completed with return code 0.
works!
yes
yes, it works for any kind of string
its just checking if a string is in a string
alright don't flame me for my dumb question. How do i separate client.events so if i have multiple they don't intefere with eachother?
!d discord.ext.commands.Bot.listen
@listen(name=None)```
A decorator that registers another function as an external
event listener. Basically this allows you to listen to multiple
events from different places e.g. such as [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready")
The functions being listened to must be a [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine "(in Python v3.10)").
Example...
wdym by interfere?
You ain't stealing this from me 😠
🤨
How to use same output for multiple inputs in my code
Put output in a variable and just use that variable
you can use Bot.listen(), given that your client should be a commands.Bot instance
client = commands.Bot(...)
@client.listen("on_message")
async def on_message_1(message):
...
@client.listen("on_message")
async def on_message_2(message):
...```
client should be your bot instance😵💫
like i'm using py if message.content.startswith(''): but because its empty it means any sort of message recieved by the bot does whatever my code tells it to. But i don't want it for every message only messages from users
just check ids ig im not really sure what you refer to
if message.author.bot
Like what do you want
I want same reply for hi also , so do I have to type another if loop?
If loop?
That's what i'm assuming since he said only from users
if statement you mean and no
!d or
6.11. Boolean operations
or_test ::= and_test | or_test "or" and_test
and_test ::= not_test | and_test "and" not_test
not_test ::= comparison | "not" not_test
``` In the context of Boolean operations, and also when expressions are used by control flow statements, the following values are interpreted as false: `False`, `None`, numeric zero of all types, and empty strings and containers (including strings, tuples, lists, dictionaries, sets and frozensets). All other values are interpreted as true. User-defined objects can customize their truth value by providing a `__bool__()` method.
The operator [`not`](https://docs.python.org/3/reference/expressions.html#not) yields `True` if its argument is false, `False` otherwise.
!or
When checking if something is equal to one thing or another, you might think that this is possible:
if favorite_fruit == 'grapefruit' or 'lemon':
print("That's a weird favorite fruit to have.")
While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.
So, if you want to check if something is equal to one thing or another, there are two common ways:
# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
print("That's a weird favorite fruit to have.")
# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
print("That's a weird favorite fruit to have.")
yeah
Also this
discord api
So will [(hello,hi) in message ] work?
if its allot of words just make a list of not just use or
Tuple can't be in a str
What
hm the rest part is pretty easy
!ot and lets not talk about it
not the gateway tho
if ... in message or ... in message:
Why here of all places
🙄
bro what?
!mute 841634873453051904 Investigating
:incoming_envelope: :ok_hand: applied mute to @slate swan until <t:1650975007:f> (59 minutes and 59 seconds).
essentially i'm using a twitter api to save data to a txt file, i then read that txt file into the bot and it posts to a channel, I'm tryna figure out why it won't read the file and post to a channel, so i thought it might be interfering events . this is my reading code ```py
@client.event
async def on_data(ctx):
with open('tweets.txt', 'r') as filehandler:
content = filehandler.readline()
await ctx.send('content')
thanks
!pypi akeno
ik, thats why i mentioned "resful"
make a cache implementation
i never published it😳
Fuck
How can I make a command that starts with a number?
Use akeno
?
!pip tweepy
nor was it finished the twitter api is garbage
Sadge
those are some fancy words there mate
you're literally sending "content"
It's a cache
The name of the command.
oh sorry yh i made the word a string to test it but it still didn't work
thx
oh
errors?
I should try and make a api wrapper for it after ducky
none it just doesn't post anything
yeah im just saying the gateway isnt but the restful is lol
Wanna do it with me kek
just save the data in a dict
i mean i got my twitter developer account sure
why is it an event
Are you dispatching it
Oh shit do i need one of those
Just use a random number between 100 and 1500 as your ms ping duh
I don't use twitter
ofc
Well damn
when using the actual latency would be shorter code 💀
No its not
I'll dm you about it when i finish my wrapper and somehow get a developer account
Random number is just random.randint(100, 1500).
Why random?
alr
To trick the users?
import random
random.randint(100, 1500```
vs
```py
bot.latency```
I am talking about real time latency.
Not fixed latency,,
do you have examples?
mm ok
That is why random
should it be client.command intead?
The best trick.
Real time latency showed with psuedo random numbers?
well do you want it to be a command?
Whatever
Its just numbers, then why not just randomize then
No need to calculate actual real time latency.
So that they're true?
why is this a discussion anyway
He made it a discussion
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
Imagine if food companies did this on every product
What will they randomize?
The number of ingredients?
the price, nutritional values etc
The nutrient info thing
I forgot what that's called
I just want it to read the txt file if possible otherwise i'll try cane or okimis advice
Lmao
anyways, off topic
Say my full name
😔
worth a try but i don wanna make the discord models
its like saying age is just a number
🗿
cane coke
im down to pain myself and make models for you
😳
how do you get banned from a programming discord
For free or for something in return? 😳
You break the rules
read it in what? a command? A function?
something in return 😏
ask someone who has been banned
🗿
caeden~
what do you expect
something😳 😏
im joking ill do it for experience
😔 i mean i can fanboy your wrapper ez
🤨
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
in the function
so make it a function, not an event
theres not difference
a command is a function and so is a event
🤨
or do you mean different functions?
commands and events have decorators
but there still functions just decorated
alright then
only thing that changes is their behavior
when ever i trying to open a discord.py file i am getting a long list of error anytime before
what file? the source code?
Traceback (most recent call last):
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 999, in _create_direct_connection
hosts = await asyncio.shield(host_resolved)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 865, in _resolve_host
addrs = await self._resolver.resolve(host, port, family=self._family)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\resolver.py", line 31, in resolve
infos = await self._loop.getaddrinfo(
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 855, in getaddrinfo
return await self.run_in_executor(
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11002] getaddrinfo failed
The above exception was the direct cause of the following exception:
wait
Hey @slate swan!
You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.
my code is very long
https://paste.pythondiscord.com/
paste here
!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.
Open? Do you mean run?
hello coccaine
Or is your file legit corrupted
Hello ryuga
yes
i just restarted it and all the discord.py file are not working
do you have any examples or vids/websites to implement it sounds like a good idea
An asynchronous API wrapper for https://pokeapi.co/ - pokelance/cache.py at master · sarthhh/pokelance
If you got questions ask @slate swan kek
Or just ask me
If he's off or something
is this the full error?
no
send the full error then
[errno 2] no such file or directory
how to fix?
error when starting the bot
-_-
I want to run it, but it gives an error
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!
@wraith pine
you don't need one.. just use a dictionary/list
thanks
my code pls check it
oh really why do you say that
Cache is pretty much just a dict
pokelance/cache.py lines 22 to 23
self._pokemon_cache_data: Dict[str, Any] = {}
self._sprites_cache_data: Dict[str, Union[str, Dict]] = {}```
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 999, in _create_direct_connection
hosts = await asyncio.shield(host_resolved)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 865, in _resolve_host
addrs = await self._resolver.resolve(host, port, family=self._family)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\resolver.py", line 31, in resolve
infos = await self._loop.getaddrinfo(
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 855, in getaddrinfo
return await self.run_in_executor(
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11002] getaddrinfo failed
Yeah just a normal dictionary
this
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 563, in connect
self.ws = await asyncio.wait_for(coro, timeout=60.0)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 445, in wait_for
return fut.result()
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\gateway.py", line 306, in from_client
socket = await client.http.ws_connect(gateway)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 132, in ws_connect
return await self.__session.ws_connect(url, **kwargs)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\client.py", line 754, in _ws_connect
resp = await self.request(
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\client.py", line 520, in _request
conn = await self._connector.connect(
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 535, in connect
proto = await self._create_connection(req, traces, timeout)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 892, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "C:\Users\GUDDU\AppData\Local\Programs\Python\Python310\lib\site-packages\aiohttp\connector.py", line 1011, in _create_direct_connection
raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host gateway.discord.gg:443 ssl:default [getaddrinfo failed]
During handling of the above exception, another exception occurred:```
no
i am getting this same error in all the discord files
we use it for less api calls
Click this: #discord-bots message
😫 what should i do
he said say.. not use
First of all don't use discord.Client
Use discord.ext.commands.Bot
And create commands with @bot.command for non cog implementation
🦾 👨🦲 🦾
😳
what why
👁️ 👄 👁️
[errno 2] no such file or directory
how to fix?
my cod
how about n o
becaue i am very confused right now
client = discord.Client()
no
hah
dont use that lol
then what should i use
why not 
class discord.ext.commands.Bot(command_prefix, *, help_command=<default-help-command>, tree_cls=<class 'discord.app_commands.tree.CommandTree'>, description=None, intents, **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...
a subclass
Cring
:)
?
provide the functionality to manage commands...
They should remove that "quickstart" guide from their docs
😺
Make a pr some1
yes exenifix, pls do :>
Okbro
:>
yeah, but call it a "bot" not client
variable naming🙀
💀 is it really a big issue? just asking :'/
yes
owo
well, thats just what you and ash are doing atm
is this thing good? i can use it?
LMAOO
crt.sh is not working what should i do now
💀
true
they pros😈 🙏
wait no thats not what i mean
i was talking about nicknames
Nvm they are already doing something like that in #7654
lol
hi cokecake :>
Is there a C library for something like discord.py
I was confused for a sec
he ment bare c and not cpp
C isn't a programming language any longer 😉
cap
bro
On how you could use discordcpp with c
cpp is better than c

websocket connected to the gateway and http requests for the api
Tried that
Tryna write discord bot on java you will get serious schizophrenia
Didn't work out when i had a panic attack using semicolons
c also contains semicolons;
Yes i know
i believe js and py are the most used languages for bot dev?
Yes
That's why i'm a python dev
👌
I remember how one guy made a bot with html (idk how but it worked)
Maybe he just put a script tag
💀
but that sounds hilarious lmao
other than that i've seen some people using serentiy rs
I'd like to learn cpp to have a language faster than python under my belt
eh rs? 🤔
oh and i made a bot with markdown
probably works like restcord ( php library)
rust
I know c# for unity and c++ for arduino
ooo
😳
i made a bot with notepad bro 😏
Pain
and my first bot was made with pen & paper :
achievement*
my first bot was in my head, in the form of thoughts
💀 yes, replying to commands right?
ofc
lmao
And if i ever use the unreal engine this would be handy af
connected to the v9 gateway
say what
iirc unreal uses cpp for coding the scripts
Not to brag but my first bot was stolen from FCC 😏
LOL
All the bots were quarks in prehistoric times
💀 my gawd, u really did? 😂
that's some nice handwriting though ngl, tell them I said that
the best thing is
it HAS COLORSSSSSS :>, full IDE experience :>
how did i not notice that
😭 ikr
wow
been taking it for granted ;-;
ouu
I wonder if my handwriting is good
I should post it here some day
Nah you guys would clown me
i can assure you by the quality of your profile picture and the position you are sitting in right now it is very good handwriting
💀 so what if i put pfp of an egirl? lmao
what about my handwriting then? 💀
uh
😂 nvm jk
hot
It becomes uwu
Your hand suddenly gets compelled to write uwu now
wait this is #discord-bots o.o
handwritting with normal pfp 💀
handwritting when egirl pfp \💀
i'm sorry, i'm just....👨🦯
same
Gone. Reduced to c code
How to catch Forbidden, cause this doesn't catch it
You code on mobile?
reply this first lmao
Nah I just downloaded logs from server
no., send it to replit for them to run it
oh lol nvm
Cause I'm not home
I'm teared on if i should make docs for my wrapper
It's the same isn't it
🤷♂️ doesn't look like it
My wrapper is pretty simple and has only like 5 methods
If you ctrl + press disnake.Forbidden it will get you to errors
It gets imported in main module
I don't think people would get confused without docs
well try it anyway
I even tried HTTPException it still smokes weed
if they look into code.. then they probably won't (as long as it's not too much complicated)
commented code 👍
uncommented code 👎
Well my code i think
Isn't spaghetti
Hopefully
The app is quickedit
Just a text editor
lol that's glad to know
oo thankss :>
You'll see when i finally publish it on it's github repo
alright sir
Hello okimii
Hello okimii
i need this font pls make a vsc extension and the syntax highlighting😩
:hides:
hi
hi
i will find you
I will make docs strings for it
good ducky
!rule 7
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
It just that i feel like using sphinx for this minimal library is fucking overkill
how to remove name and value?
my comments : ```py
TODO: documentation
no
Biased you use sphinx 
remove name and value from?
TabError: inconsistent use of tabs and spaces in indentation
that code has amazing formatting
sounds like a skill issue
Stop
Sometimes the more i talk to sarth or okimii the more shit i need to do
!rule 7
7. Keep discussions relevant to the channel topic. Each channel's description tells you the topic.
embed
what part of the embeds specifically?
don't talk to them anymore, easy :>
wanna talk about the docs thing in some ot?
I wonder how fast a discord bot would be if it's hosted on a super computer
Sure
it does mostly depend on internet speed, maybe discord api speed bottleneck
What if 1tbps speed
and the quality of code
that depends too
I only need a link to the image and title, can I somehow remove the rest?
in terms of just raw speed something like a message create post request
is that v1.7.3?
embeds have a url parameter
embed = discord.Embed(........ url=member.avatar_url)
^^^
1tbps is more like bandwidth, the speed of internet is the length of connector between computers (let's say a wire) divided by the time it takes for an electric signal to complete the distance. It will be almost equal to the speed of electric charge in an electric conductor
I was bad at physics at school 😳
Lots of formulas and most of them make no sense unless you know them deep enough
Like liNeAr aCcEleRaTioN
In short, u need to take memory pills in order to remember those without going in deep
I always hated mechanics and liked nuclear physics 😈
Whoops mod here
fwiw physics made calculus make sense
Time to get warned
😭
Nvm
please have mercy on our souls
I didn't say anything 😶
💀
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
the moderator has been moderated 
Oh mo
is there any library for interactions types?
Very fun
How do you loop over all messages in a channel with the v2 version?
And yeah like brad said if you already know calculus it makes physics much easier
!d discord.TextChannel.history
async for ... in history(*, limit=100, before=None, after=None, around=None, oldest_first=None)```
Returns an [asynchronous iterator](https://docs.python.org/3/glossary.html#term-asynchronous-iterator "(in Python v3.10)") that enables receiving the destination’s message history.
You must have [`read_message_history`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permissions to use this.
Examples
Usage...
could someone reply?
channel = client.get_channel(343944376055103488)
async for message in channel.history(limit=None):
print(message.content)
slash commands?
yes
I like Nextcord
isn't that a gateway library?
ah thank you, I was using .flatten() which was causing some errors
yeh but I mean, isn't that a library for discord gateway?
- discord.py
- disnake
- nextcord
- py-cord
- hikari
the above are the most used except py-cord and hikari
Partly
okay
Interactions are received through the gateway unless you specify otherwise
discord.py v2 supports interactions
u can receive interactions via https
They come in INTERACTION_CREATE payloads
I know, that’s why I said unless you specify otherwise
But you’d have to set up a web server to listen for them
however, is a good idea using https interactions?
does anyone know how to keep a bot online 24/7
not really
Hey! What should I use for a modmail bot?
why
Why not just use a library that's made for it?
You have to expose your local network to the internet
^
And also use case is kind of limited
why would you want that when you are getting full-fleshed methods and attributes directly?
You’d have to set up a web server using flask or something similar
And you get raw payloads you have to parse yourself
wym
gonna be pretty fun
well thought https interactions was the "future of discord bots"
There’s not many times where you HAVE to use HTTPS interactions over gateway ones
uh....no? I mean, yes since all the libraries do those
hm okay
Farthest thing from it
okay
where are you currently hosting it?
#discord-bot-hosting
discord moment

from os import environ
from discord.ext.commands import Bot, Intents, Context
bot = Bot(command_prefix='>', intents=Intents.all())
@bot.command()
async def ping(ctx: Context) -> None:
await ctx.send(bot.latency*1000)
bot.run(environ['TOKEN'])
```py
```sh
KeyError: 'TOKEN'
???
we dont help with selfbots
not self bot
editing bot=False wont change a thing
u editing message wont change anything
what is self bot?
we wont help ya
no.. i copied form stack overflow discord bot

reverse searched, the code doesnt exist there
and the error is pretty much self explanatory
what it mean?
it means that before developing a discord bot in python you should know python first
no..
just vsc, alright im moving to bot hoting channel sorry
xD
you can import TOKEN from config
"what is key" in 3... 2... 1...
Thanks. I'll google my error from now on.. 🥲
@sick birch sry for pinging u, but why doesn't exist a discord API library for py?
that’s what discord.py is
i literally listed 5 of those above...
oh NVM
thought they were libraries like discord.js
embeds!!!!!!
@inland beacon Like Sarth said we don't help with self bots, not knowing what a key error is whilst having perfect type annotations and return types.
organization 💀
they are but for python
API types
HTTP interactions lack a lot of things that most bots have right now e.g text based commands
could you please elaborate what you mean by that?
like the discord models such as Roles and channels?
from config import TOKEN
yes
literally every library has that
The "use case" isn't limited.
ah ok
!d discord.User
class discord.User```
Represents a Discord user.
x == y Checks if two users are equal.
x != y Checks if two users are not equal.
hash(x) Return the user’s hash.
str(x) Returns the user’s name with discriminator.
hm okay
discord packages in python are OOP based, that means that every discord model is an object in those package
you can refer to their docs and see what library suits you :D
personally i'd recommend discord.py or hikari
model?
!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.
for models i mean users, guilds, messages etc
they're models in common terms
oh well
He means that discord.py is made by using OOP, everything in python is an object.
im confused now, he explained something else-
he meant discord models as in the resources you get from discord
well what said panda is also true lol
OOP?
these
oh nvm
object oriented programming
ty
ic
OOP is a method of coding, and everything in Python is an object. Str for example can be modified and changed however you like.
your issue?
i know......?
I know what OOP is, I just meant about discord models that time
try it
???
please use a codeblock
take it like that, i use "models" to define software object to not repeat object two times in a sentence
Those are all classes that are part of discord, example discord.xxx
discord is OOP based huh?
and from what i see, its inconsistent py async def purge(ctx, x): ... await ctx.channel.purge(limit=int(x)) instead of doing this you could have typehinted x as int
await ctx.message.delete()
the message already gets deleted with the purge, simply add +1 to the purge to include that message
not discord.py, discord
almost everything is OOP based, nowadays OOP is a high level programming method
seems cool
literally just 2 lines of changes..
also, make sure the command is above bot.run
I mean, javascript is object oriented too.....
Is discord a programming language??
huh....
sick when
🤡 is it just me who is unable to process this discussion?
@slate swan
include me, i try to say something else, and is interpreted wrong
bad logic = runtimerror
just end that topic
hm well what blvck meant in the start was that "each discord model has objects in libraries", the models there mean payloads recieved from discord
and yes even though discord is not a programming language
they call those models "objects"
yeah though i got confused between both
the ... is just the code you already had, i just didnt want to rewrite everything again
anyways, imma just go away and play cr 😔
cya ash, have fun 👋
Doesn't every API with good docs call those objects?
yeah true, but look at the chats above
I, uhhh, will just go away instead
people repellent chat
hello 🙂
play coc 😄
wanna play? i'll send the link
link? for what 😄
the coc
clash of clans

oh
coc = clash of clans mate
i thought they meant clash of code
there is an api for that
imma waste my days learning cpp 
i'm laughing my ass off too
i had a lvl 1, th13 acc
accurate
!indention
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
i'm ready to waste time
youre missing imports and indentations man
learn python before u make a discord bot...
||pun intended or not?||
from datetime import datetime
+ import zoneinfo
is giving error
!e import zoneinfo
@cloud dawn :warning: Your eval job has completed with return code 0.
[No output]
Looks fine to me
I added the + sign, panda 😔
The + isn't in the `` :)
hello
Hi
I am having a problem
I'll end the convo here in the hopes of not getting warned again
parse_json = json.loads(apiData)
You got warned?
this is giving me a huge error
Could you show it?
and I dont undersand why
once, before I got banned (mistakenly) 😔
of course
Hi
Hi
wont let me send an image, and i cant copy the console for some reason
!json
When using JSON, you might run into the following error:
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
This error could have appeared because you just created the JSON file and there is nothing in it at the moment.
Whilst having empty data is no problem, the file itself may never be completely empty.
You most likely wanted to structure your JSON as a dictionary. To do this, edit your empty JSON file so that it instead contains {}.
Different data types are also supported. If you wish to read more on these, please refer to this article.
could i send it to you in dms?
the data ur trying to load is empty
0.o
i dont completely understnad
read this ^^
Yo
Hola sparky
could you explain it to me because i am not sure what that means
Well to be honest they aren't sensitive you did say some offensive things.
Im having issue with this
json.decoder.JSONDecodeError: Expecting value: line 1 column 25 (char 24)
Not 1 its 25
👀
inarguable, I agree
show ur json @slate swan
Coloum 25
Show that line.
Im trying to dump
just add {} to your json file
It's a json loads he's trying to convert it to a dict.
they are doing loads
when i open json it looks like
{"968163683282862110": [
code :
list = [newDate,winlimit]
logs1[message.id] = list
with open("giveawaytime.json", "w") as f:
json.dump(logs1, f)
i'm high, ill just go away
when u dump it creates a new dict, so u probably have 2 + dits in ur json
does everyone here just not sleep?
dont do drugs kids
all the regulars are on 24/7 helping
How come?
sleep = False
Ok so
I remove those {}
load the dict, update it and write to the file
imagine
mmm, crystals rock candy
Update it?
How do you become a regular lol
with open(file) as file:
data = json.load(file)
data.update(new_dict)
with open(file, 'w') as file:
json.dump(data, file)
@slate swan

Oh
Why not r+?
when a staff member recognizes you/ admits you come here often
i dont trust anything with +
never used update attribute ¯\_(ツ)_/¯
👀
Lol why?
I only really speak to some staff members.
isnt that a method? 😔
mina?
bad experiences in past
uh im bad at python names ;-;
nah im not gonna say that...
Then why the error come this thing doesnt have any attribute that
you use := and post in #esoteric-python, how bad could the screwup have been?
Yeah her she's awesome, bee is also a good lad and greyblue some of the mods too basically any staff member that looks in #discord-bots from time to time.
👍
i like walrus
ofc
its a new operator
sets a variables value to something and returns the value
no?
..
just like py def walrus(new): x = new return x
!pep 572
btw, can you do :-=?
Why not return new?
nah
..
Can you do -= on a newly assigned variable?
Cya
oh hm
ye i get it
Here's more info on :=
Imagine using things and not known names of it
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
Error 404 - I haven't started yet lol
Which ide?
VCS
run the file and then send the error
welp
I'll check
lemme try what Panda said first
What is ssl?
!d ssl
very helpful
Secure Sockets Layer

This module provides access to Transport Layer Security (often known as “Secure Sockets Layer”) encryption and peer authentication facilities for network sockets, both client-side and server-side. This module uses the OpenSSL library. It is available on all modern Unix systems, Windows, macOS, and probably additional platforms, as long as OpenSSL is installed on that platform.
It's more of a method to let users know that their connection is "safe".
Wow
Warning Don’t use this module without reading the Security considerations. Doing so may lead to a false sense of security, as the default settings of the ssl module are not necessarily appropriate for your application.

Thus the "safe" quote.
We can help you solve a problem regarding a command we aren't going to make it for you, regardless of how much faster we can make it.
Ok
indents
!indention again.
Indentation
Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.
Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.
Example
def foo():
bar = 'baz' # indented one level
if bar == 'baz':
print('ham') # indented two levels
return bar # indented one level
The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.
Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines
More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation
basic python
Your await is all the way to the left it needs to be inside the function.
Panda where is the lock icon? lol
Lock icon? 
🔐
ah wait ok got it i guess
🔒
🔑
🔓
u didnt change anything, we already told u what to chaneg
😂
(dont)? rob houses
Wdym?
Don't rob anything.
what are u doing
(...)? (☞゚ヮ゚)☞ ¯_(ツ)_/¯
installing the SSL certificate
..
we didnt tell u to put something, we just told u to fix indents and import the missing modules
What exactly is your issue right now?
I'll just keep it as it is lol
same, they didnt change anything ... 🤷♂️
Imagine free nitro
ngl when i hit 10 years and they give nothing kinda disappointed.
Discord is more than 10 year old ?
May 13, 2015
Oh 👍
sparky writes, deletes, writes again edits, then recurses again until he reaches an overflow error
..
it finally worked thanks :3
Couple syntax errors along the way.
:D
Ye lol
sparky compiler ignores it :p
Bad grammmer 
inspired by js
No
We aren't going to be much help if you just copy code.
I dont need to write anything right my complier makes it right :D
U can use channel.send
This got made almost 4 years ago.
hi
Hi
everyone
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Can bot create guilds and invite ppl to it?
Lucas
Or start with more simpler commands, and I recommend just running code. Check if it works, if it does not debug it and try to fix it. If you are still unable to fix it you can always come here.
@maiden fable miracle happened online classes from 1 may
Honestly I don't know what to send people anymore since everything is outdated or bad.
I could also give tutorials inside #voice-chat-text-1 :)
The purpose of this site is to help you understand and to learn the syntax of Python.
I cant explain
There should be module named syntax change
from compiler import syntax_change
Imagine
I mean you can start with pretty basic things like send text to specific channels or embeds, learning cogs and looking trough the api docs. That's how I got started.
!d inspect 
Source code: Lib/inspect.py
---...
!e
noob = ["W","e",2,3,"o",2]
idk = (noob[0],noob[4],noob[0])
print(idk)
@slate swan :white_check_mark: Your eval job has completed with return code 0.
('W', 'o', 'W')
No you're in an on topic channel.
Haha I would love to join the VC!
I would like if I had streaming rights :)
(:
anyone wanna see my discord bot's
I made
Sure.
I can only see html
It is a discord bot
Bruh my bot has been baned in discord
I use vpn so idc if u saw my ip
No i am not changing the token
For it is not nessacery
because
I wanna make a discord bot with a friend
):
rate limited*
soft baned
for rate limit
basicly it bc i use replit
as my client
correct @slate swan
soft ban is getting banned and unbanned ots
uh?
(:
like, how are you creating the picture?
