#development
1 messages · Page 1905 of 1
self is needed when ur bot has sharding
thats cogs
Ooo
or sharding
K
not needed atm
yea sorry forgot to remove the self part
even without the self it still works the same
yep
im too used to have self, ctx
Self is for instance methods, unrelated to sharding nor cogs doe
U sure about that
class CogName(commands.Cog):
def init(self, bot):
self.bot = bot
So you do need self
yeah
atleast in dpy
Not really
Not really?
It's not like you're supposed to have instance methods
i don't use cogs but i know its needed for them
It's not needed for cogs specifically
i know
hmm yea okay
Cogs are just classes, and if you have an instance method on it, then you need the self. But it's not necessary. Not that it won't work without self
Yes
add @commands.is_owner() under@client.command() on the commands you want to restrict
Order doesn't matter doe, it can be above it as well
any js user here?
Decorators execute from bottom, so actually having it above the command makes the command instantiated first before adding the check. It makes the most sense to me, but again, it doesn't matter kek
dont think so
python or js is good
both are good
discord.py prob
i like python as thats what i use in school
but there are soms forks here and there
i'm starting to teach myself js
i know js
help me
but i dont know to make bots
i only make games
in js
kaboom
yes?
threejs, p5, unity scripting...
@onyx torrent get this error when ```js
const Topgg = require('@top-gg/sdk');
const topgg = new Topgg.Api("TOP.GG_TOKEN")
let voted = await topgg.hasVoted(message.author.id);
if (!voted) {
return message.reply('not voted')
}```
Hikari looks so different
whats the error?
inside it code
code blocks
code blocks
how
```language
eg.
```js
return "a"
```
return "a"
bot send message after bot bot also work that commad
console.log("shit")```
op
"stanky"
like for work command need vote first
didnt understand
helllo```
can you explain him please
not rlly
come dms
i wanna make a bank that stores keys 🔑
5 key = open box
inside it tips for poketwo
why does so many people want those bank stuff bots like dank memer

anyone knows to make bank
👀
idk atall
use any database
and not json
I use Mongodb
well
i dont know nothing about database
i need ot migrate away from json
i store 1.1k blacklised userids using json
I use Postgres
op wht bot you make
and it checks the json everytime someone joins or leaves
Ah thats hard
Nah but it depends if you bot is in alot of guilds or not
@austere scaffold you use djs?
thats how many it has
aaah
can i black list from using my bot
why py people only here
using your bot @spark flint
I use Postgres just to store data for rpg
only 122 but its in servers like discord bots and discord boats where it still checks the members joining and leaving
i'm working on making the API public
oh
someone help him he wants to edit command handler to make few commands premium only i cant because he thinks i am a newbie
Then read djs docs
No
so you can do https://blacklister.xyz/api?userid=USERID&apikey=APIKEY and check if a user is blacklsited
this only work by top.gg api noob
my main got hacked
I'm not sharing the JSON of blacklisted users
also dpy noob
and got blacklisted
why u call everyone noob noone will help if you behave like this
from a bot
I am saying that you should read the docs
???
Does anyone got sometimes AccessDenied Errors from Discords CDN? I upload a png as an attachment in an embed but it doesnt load and show this error upon opening in the browser
But when i execute the same command again, everything works
Ur are the noob since you have to ask other devs to solve your problem
not really
Read DOCS\
bru rat ha gusa a raha
Hi
hello
🤨
i still ask for help even tho i call myself a good dev
i explained him everything in dms then hes saying me i am a noob lmao
ye ||me too||\
kha he tu
it's been deleted somehow
us
acha
oh i see the context for the noob thing
lmao
steal 7732569351
lmao
i noticed its been displayed in the embed for a brief second and then its gone 
Bruh
i thought you were calling people who ask for help noobs
f
but what could be the cause for that
difference is that he calls me out for an noob and being disrespectfull towards me and you are asking help in a normal way
who have play roblox
true true
oo welcome mod
dude you were asking for a development question in #topgg-api and said your code worked perfectly - you can't really talk
economy system?
xd
ye
no
yes give me 2 min
ok
thats a developement question
spoun feed not allow
stfu
ask any mod
mods please mute him
ok
reason?
i guess its not there in rules
py
ok
guys ignore him he has a lots of time to waste
@rustic nova sorry for ping - can you ask this guy to stop replying to random messages to get people to move to general and is now being quite annoying towards all of us
ok
code with swastik tutorials
all the mods are offline 
mac is online 24/7 and nom is away
@vivid fulcrum
but the really weird thing is, when i reloaded discord the image can be displayed normally, so it doesnt seem like an error on my end, or?
is there any use of studing ms access
so learn about databases (mongodb preferred) then make a schema. start with basic commands like bal,pay,rob. Search if d.py has any packages for that it will make it eaier
@earnest phoenix stop minimodding
@earnest phoenix get your facts straight, you are the one calling me out for an noob for no actuall reason, you are the one that's asking for help and i simple said that you should read the discord.js docs because 99% of reading the docs will solve your problem.
they need more staff
nah they have enough staff
ok
just that a few are on break atm
oh
and mods are allowed a life away from discord 
Software-Engineering omg
(:
Ok

My bad
oof
Same
no u were correct
he doesnt even understands how command handler works
Anyways
That's why i said read the docs
lmao
Command handler already set
oh but could you sent any basic code of bank
then add a field to command data in every command file individually premium: true
actually i use d.js
also remember the #development etiquette in the pinned messages 👍
oh sed ;-;
how do i notify when a user gets a certain role?
say to them
in a specific channel?
Omy god how much underrated people in world
@eternal osprey
My apologies
@rustic nova can we please have some moderation from ur side
uh?
general client.on*

but thats a nice response
taunting bro
f
@earnest phoenix just gonna give you the final warning regarding the etiquette, if you're not willing to contribute in #development and not be helpful, dont talk here
Maybe apply for lot's of person here
he said his code was correct in #topgg-api when I said it was a code issue not a top.gg issue
@spark flint is there any packages for bank l
i am assuming ur bot is adding a role to a user and u want to get notified directly in your discord client. If not then explain to me
@earnest phoenix you are the one that called me an noob?
nope
No sir
i think we can ignore him.... we're wasting our own time
Sorry sir
For my bad behaviour
Vaibhav shut the fuck up and be helpful instead of acting tuff and calling others noobs. If not, go to another channel. According to your shit you've been saying: #memes-and-media
Ok sorry
could you send a basic code for it
oh sed ;-;
the bot is only detecting if users have a new role, for example named Role1. It then needs to send a message to a certain channel.
let server = client.guilds.cache.get('server_id');
var memberRole= server.roles.cache.find(role => role.name === "role_name");
// check for all members in the server individually here
try {
await client.channels.cache.get(`channel_id`).send(`your certain message here`);
} catch(e){
console.log(e);
}```
Yeah, but it needs to notify when the role is added.
Not if the user already had it
Just use the guildMemberUpdate event
it'll return the old member object and the new one
just check which role is added/removed in the new one
huh how would i compare the new and old member object then?
You just check the roles of one object and the roles of the other
and if there's a nw one in the new object a new role has been added
'''
@mint spearient.command()
async def balance(ctx):
await open_account(ctx.author)
async def open_account(user):
with open('mainbank.json','r') as f:
users = json.load(f)
if str(user.id) in users:
return False
else:
users[str(user.id)]['wallet']= 0
users[str(user.id)]['bank']= 0
with open('mainbank.json','w') as f:
json.dump(users,f)
'''
did u import json?
@client.command()
async def balance(ctx):
await open_account(ctx.author)
async def open_account(user):
with open('mainbank.json','r') as f:
users = json.load(f)
if str(user.id) in users:
return False
else:
users[str(user.id)]['wallet']= 0
users[str(user.id)]['bank']= 0
with open('mainbank.json','w') as f:
json.dump(users,f)
@tulip ledge oh
did u import json?
haha happens to the best of us
Hint: you'll have to move away from your .sjon file database system to an appropriate one that is able to actually handle your needs
werent u mod?
Was
Oh, what happened?
Shit
Ignoring exception in command balance:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 77, in balance
await open_account(ctx.author)
File "main.py", line 85, in open_account
users[str(user.id)]['wallet']= 0
KeyError: '892251811732406272'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: '892251811732406272'
wht error is this
Not the best at python but I think your object users is missing the '892251811732406272' key
try printing users
That means there's no data for a user with that ID
Just call setdefault to ensure the key always exists
Ignoring exception in command balance:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 79, in balance
wallet_amt = users[str(user.id)]['wallet']
UnboundLocalError: local variable 'users' referenced before assignment
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UnboundLocalError: local variable 'users' referenced before assignment
see
@client.command()
async def balance(ctx):
await open_account(ctx.author)
user = ctx.author
wallet_amt = users[str(user.id)]['wallet']
bank_amt = users[str(user.id)]['bank']
users = await get_bank_data()
em = discord.Embed(title =f"{ctx.author.name}'s balance",color=discord.Color.red())
em.add_field(name = 'Wallet balance',value = wallet_amt)
em.add_field(name = 'bank balance',value = bank_amt)
await ctx.send(embed=em)
async def open_account(user):
users = await get_bank_data()
if str(user.id) in users:
return False
else:
users[str(user.id)] = {}
users[str(user.id)]['wallet']= 0
users[str(user.id)]['bank']= 0
with open('mainbank.json','w') as f:
json.dump(users,f)
return True
async def get_bank_data():
with open('mainbank.json','r') as f:
users = json.load(f)
return users
That error usually shows that you're creating a variable only in one branch of if-else and not in both
any error check in this code
Format your code 
^ please for the love of God
I wonder why it returns boolean when you don't even care about the return value when calling it
It would make more sense for open_account to return the dict instead so that the command callback doesn't need to call get_bank_data again
Copied code!
Ah yes, gotta be it
It’s not me, no
ban him
my server got raided
yesterday
400+ members
one moderrator got hacked
and sent this same thing
banned ig
Weird flex but ok
nice
In other words people who actually think they can get something for free on the 'net
how to
add
^give @spark flint 1
@client.command()
async def give(ctx,*,keey):
await open_account(ctx.author)
users = await get_bank_data()
user = ctx.author
earnings = keey
users[str(user.id)]['wallet'] += earnings
made this
much
then how
async def give(ctx, user:discord.User, amount):
then don't do user = ctx.author
or do async def give(ctx, amount, user:discord.User=None):
and add py if not user: user = ctx.author
now you can do
^give 10 @deft citrus
im more of a user = user or ctx.author fan
Quick Question: I have created an inbound rule on my Firewall (on my server) but can't seem to get any response. Telnet tells me that the port is closed. Am I missing something here?
Did you set the right protocol?
Just show a screenshot of the role please, as well as the input policy to be sure.
Rest is set to any
This is simple and clear
I personally prefer it
And it's an inbound rule? Already had people accidently creating an outgoing rule.
Yes it's an Inbound Rule
Is this a webhook listener (regarding the name)?
Yes
Alright and sending a request to port 5000 doesn't go through?
sadly not
Is it actually a system firewall or... ? Looks a little like Windows firewall manager.
Well
localhost won't bring you far
I know know haha, but also doesn't work with the right one
What about my question above?
Ah okay yeah as I assumed
Do you host the code locally (at home) or a server with static IP?
on a server with an static ip
Does the provider maybe has a configurable firewall in his panel (active) as well?
Don't think so
I bought an root server, I did set it up myself.
So they don't even know it's an windows server
and can't seem to find any settings regarding this
Hmm nothing wrong it, to not pay the fucking license costs
As keys are cheap to get
That's getting a little difficult then
Yeah, Maby I could ask the hoster
Well make sure in the first place there's really no firewall active in your server admin panel somewhere
That's very often case for default (linux) servers with preconfigured rules
Windows in your case is running on the server not as container or VM?
ok, the rule should work then
You may wanna try a different service to send a webhook
curl -d '{"key":"value", "key2":"value2"}' -H "Content-Type: application/json" -X POST http://your-ip:5000/route
You can test that yourself using curl
(preinstalled in your Windows command prompt)
The route is correct?
hmm localhost doesn't need to pass the firewall, means the service is running, but really blocked for some reason
I wonder why, if your provider would have an active firewall in place, you wouldn't be able to connect to RDP, too I guess
You may wanna try a different port
Will do that
Like 31500
I'm now getting an diffrent error
maby it's wokring now
but the application has an error
Ok, which error?
never mind. I was looking wrong. Hopes died really fast lol
I changed the port now, but sadly still an timeout
Also changed the firewall rule?
I'm getting an response on my server (localhost)
yes
Errr... does the API even listen to non local requests?
That's what I thought now too
localhost usually means localhost, not 0.0.0.0 as synonym for your external network IP
isn't there a PORT env variable on VPSs that you're supposed to listen to?
should i try with 0.0.0.0:31500 or with my external ip?
by default there'll be only ssh port open
Oh * as placeholder
it'll automatically cover everything needed iirc
Why using the same as everyone else if you can use a different one
yeah, thanks man
client.command()
@commands.is_owner()
async def give(ctx, user:discord.User, amount):
user = ctx.author
await open_account(ctx.author)
users = await get_bank_data()
user = ctx.author
earnings = amount
if not user:
user = ctx.author
users[str(user.id)]['wallet'] += earnings
correct

op
I'm trying again now, also obviously thanks to you @boreal iron I owe you something
If you would only have sent a that a bit earlier 
based

SHUT UP JAVA USER
client.command()
@commands.is_owner()
async def give(ctx, user:discord.User, amount):
user = ctx.author
await open_account(ctx.author)
users = await get_bank_data()
user = ctx.author
earnings = amount
if not user:
user = ctx.author
users[str(user.id)]['wallet'] += earnings
is it correct
Success?
I'm used to the kind of questions in #development
FUCK YES, now I'm getting an response
I'm so happy right now
and I'm hating myself for being such an idiot
Great, also thank cry for clarifing the placeholder
not that he would deserve it but why not

@boreal iron Thanks alot for sticking around with me, really helped me alot
yee np, invoice is on it's way
You already helped me twice, on the third I would really expect an invoice 

until you forgor 💀
how old are you?
well I usually don't share private infos in the 'net 
understandable
let's say around 30
alright, gonna get some food, see ya
sure man, enjoy
I feel like 70 when I'm ill
"is it correct?"
ye
did u even try ur code?
then show the error
@client.command()
@commands.is_owner()
async def give(ctx, user:discord.User, amount):
if not user:
user = ctx.author
await open_account(ctx.author)
users = await get_bank_data()
earnings = amount
users[str(user.id)]['wallet'] += earnings
@client.command()
async def balance(ctx):
user = ctx.author
await open_account(ctx.author)
users = await get_bank_data()
wallet_amt = users[str(user.id)]['wallet']
bank_amt = users[str(user.id)]['bank']
em = discord.Embed(title =f"{ctx.author.name}'s balance",color=discord.Color.red())
em.add_field(name = 'Keys',value = wallet_amt)
em.add_field(name = 'Boxes',value = bank_amt)
await ctx.send(embed=em)
async def open_account(user):
users = await get_bank_data()
if str(user.id) in users:
return False
else:
users[str(user.id)] = {}
users[str(user.id)]['wallet']= 0
users[str(user.id)]['bank']= 0
with open('mainbank.json','w') as f:
json.dump(users,f)
return True
async def get_bank_data():
with open('mainbank.json','r') as f:
users = json.load(f)
return users
showing only the code doesn't help at all
Ignoring exception in command give:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 86, in give
users[str(user.id)]['wallet'] += earnings
TypeError: unsupported operand type(s) for +=: 'int' and 'str'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: unsupported operand type(s) for +=: 'int' and 'str'
see
error
@lyric mountain
don't ping, I'm reading
O
the issue is that you're trying to += two values of different types
but the youtuber show that
the youtuber knows nothing abt your use-case, don't copy other people's code
do print(users[str(user.id)]['wallet'])
and print(earnings)
then show the console result

weeew does imgur now block Discord's user agent wtf
pictures are available but not in Discord
hmm may embed doesn't show it anymore, the chat does
weird
and there we go, magically working again
I wonder since imgur recently block TeamSpeak for some reason
teamspeak is shit
well it's actually not, the fact you can host local servers with no ping issues and there's a full encryption of the chat and voice, makes it still the leader in it's segment
but you can't compare it to an entire different platform like Discord, mostly focusing on chatting
Even if Discord may supports an higher (possible) bandwith for voice streams, it still has a high ping, instable connection and like no guaranteed security
Which is horrible for the segment that relies on TeamSpeak like E-Sports
Still… the reliability of the client and group chats are bad
Or impossible
Also the new TeamSpeak is build using the chromium framework makes it available later on any platform and browser without needing to support different apps
Except Android, since it’s shit 
Nah the embed just didn’t show it a few times i tried
Probably a temporary timeout or something
how to remove old lockfile ?
I would like to know if there is a problem with the title and the color of the categories in the computer version and after I updated Microsoft Edge neither the title nor the categories are working in the computer version but in the mobile version it is still working. I don't understand the error.
0
100
Your bot isnt here
oh
i forget
Ignoring exception in command give:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 84, in give
users[str(user.id)]['wallet'] += earnings
TypeError: unsupported operand type(s) for +=: 'int' and 'str'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: unsupported operand type(s) for +=: 'int' and 'str'
pls fix
@spark flint
see
Do int(earnings)
@client.command()
@commands.is_owner()
async def give(ctx, user:discord.User, amount):
await open_account(ctx.author)
users = await get_bank_data()
if not user:
user = ctx.author
print(users[str(user.id)]['wallet'])
print(amount)
users[str(user.id)]['wallet'] += amount
Just type hint amount with int
am just removing music command from my bot :)
Make sure the output is an int
as its on youtube api
bro its not working
Same error?
Do this ^^
yes
done
@client.command()
@commands.is_owner()
async def give(ctx, user:discord.User, amount):
await open_account(ctx.author)
users = await get_bank_data()
if not user:
user = ctx.author
int(amount)
int(users[str(user.id)][“wallet”]) += amount
see
Do int(amount) too
@client.command()
@commands.is_owner()
async def give(ctx, user:discord.User, amount):
await open_account(ctx.author)
users = await get_bank_data()
if not user:
user = ctx.author
int(amount)
int(users[str(user.id)][“wallet”]) += amount
int(amount)
bro
correct
Ignoring exception in command give:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 84, in give
(users[str(user.id)]['wallet']) += amount
TypeError: unsupported operand type(s) for +=: 'int' and 'str'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 859, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: unsupported operand type(s) for +=: 'int' and 'str
@spark flint
error
Lemme fix when I get home
File "main.py", line 84
int(users[str(user.id)]['wallet']) += amount
^
SyntaxError: cannot assign to function call
Don’t spoonfeed him though
Seems very apparent that he’s just looking for someone to write his code for him 😛
i got the code from youtube not from him
Same concept applies
This error?
Seems like a pretty basic fix to me
Seriously, take a step back and get a hang of basic Python first
All issues so far you've faced could've been prevented if you did that
Learning how to read errors is an invaluable skill in programming
no bro still not working
Where did you put it?
Show
@client.command()
@commands.is_owner()
async def give(ctx, user:discord.User,*, amount):
amount: int
await open_account(ctx.author)
users = await get_bank_data()
if not user:
user = ctx.author
users[str(user.id)]['wallet'] += amount
🤦♂️
norizon suggested you to typehint the amount argument
Also read this
i just started 3 days before
That’s why he’s saying to step back and learn python
Back to my point - don’t code if you don’t know the language well enough
I learnt python for 6 months before starting bot development
I started off programming with making a discord bot
Looking back on the code
It was horrendous
But I took a step back to learn js before continuing
And it helped a ton
My first bot was a genuine disaster
Same
Same
I did the same shit you did, got into Discord bots before learning Python itself
It bit me a lot
I’m proud of myself for not creating an event listener for every command though at least!
I understand the appeal of making a discord bot to start with
It’s fun to see your creation actually used
Don't we all do it?
I saw somebody sharing this today or yesterday as well
Lmfao
Same
😂 True
Though at least I knew a bit about how to do js
My CS teacher just realized today that Java applets are dead
Like the fact that it sucks AF
They’ve been dead since 2019
I'm waiting for those game websites to realise Flash is dead
You will be remembered flash
Imagine if Adobe brings back flash as an april fools joke
Flash and Java should both be forbidden, banned, shot, hanged, drowned etc.
Imagine the message intent is just a big April fools joke
also I heard the language that flash uses is based on ecmascript 4 spec
aye, not only message intent, but everything intent

“Message intent releasing in April 2022”
April 2022: “April fools! We just wanted you losers to use slash commands for once!”

slash commands being dropped in april
fuck dude, upgrading my small 1080p secondarys to 4k
the arm holding the monitor just looks like a banana
even if it says, they can hold up to 8 kg per monitor
whats wrong with a banana
they can shit
Nothing Sir! It's just not supposed to be a banana
tomorrow the last one arrives
then both sides are bend as fuck

let's hope it doesn't break and fell down
fuck x3 28" is even larger than my desk, looks so funny
its means
hi qt
Looks back

@client.command()
@commands.is_owner()
async def give(ctx, user:discord.User,*, amount):
amount: int
if not user:
user = ctx.author
users = await get_bank_data()
users[str(user.id)]['wallet'] += amount
await open_account(ctx.author)
is this correct
norizon

;-; wht is the wrong pls say
Have you seen the first link I sent? There's an example there
I’m no python user, but I can almost certainly guarantee that if you read what norizon sent that you’ll be able to tell what to do
oh i understand
the link was not loading
when i click
but now it loaded
ty
very much
int(users[str(user.id)]['wallet']) += amount
why showing error in this
?
Because you're not assigning a value to a variable
Get rid of that int
You're the one who set the initial value, and I saw it was 0. So there's no need to cast it to int
@client.command()
@commands.is_owner()
async def give(ctx, user:discord.User,amount: int):
user = ctx.author
await open_account(ctx.author)
users = await get_bank_data()
users[str(user.id)]['wallet'] += amount
print(amount)
no error showing but
amount not adding
You ain't writing back to the file
id understand
how to write it
You already have it in your other function
@client.command()
@commands.is_owner()
async def give(ctx, user:discord.User,amount: int):
user = ctx.author
await open_account(ctx.author)
users = await get_bank_data()
users[str(user.id)]['wallet'] += amount
print(amount)
@client.command()
async def balance(ctx):
user = ctx.author
await open_account(ctx.author)
users = await get_bank_data()
wallet_amt = users[str(user.id)]['wallet']
bank_amt = users[str(user.id)]['bank']
em = discord.Embed(title =f"{ctx.author.name}'s balance",color=discord.Color.red())
em.add_field(name = 'Keys',value = wallet_amt)
em.add_field(name = 'Boxes',value = bank_amt)
await ctx.send(embed=em)
async def open_account(user):
users = await get_bank_data()
if str(user.id) in users:
return False
else:
users[str(user.id)] = {}
users[str(user.id)]['wallet']= 0
users[str(user.id)]['bank']= 0
with open('mainbank.json','w') as f:
json.dump(users,f)
return True
async def get_bank_data():
with open('mainbank.json','r') as f:
users = json.load(f)
return users
This one specifically
here wht to do
As people have mentioned, it's a good idea to take a step back and learn the basics first
;-; wht should i do to that line
delete
I'm telling you that's how you write back to the file
Don't blindly copy-paste people's code, try to understand them as well
bro give command was made by me
other all a youtubers
Doesn't change my point
@earnest phoenix oh i understand now
ty
worked yes
it worked
finally
anyone could sent documentation of
emojis
or animation
You're being too ambiguous with what you're asking
^
somebody send documentation for how to send a single message instead of 6

What lib are you using?
I was talking about that dude sending too many messages
Oh alright I see now
My bad sorry for the ping
hello
Yes
Ask
Script in?
Specify ur programming language
i pretty much know nothijng about scripting other than its complicated
In what programming language?
Do you know any?
There's plenty of languages

JavaScript and Python are the most popular ones by far as first-time languages
How they function, how they're compiled/interpreted, the syntax, the libraries written for them
hmmmmmmm
Different ecosystems basically
will you be able to teach me how to make a music bot soon like in a few
1:30mins or so
It's fine I was just crying about my stats in ff
ee
music bot that early? forget abt it
Music bot from scratch with no programming knowledge... yeah chief no
ill be back
It will take a LOT of time to learn, not just one hour
It took me weeks and even months to get my shit together well enough to stop breaking my stuff as often
no ill be back in 1hr and 30 mins
learning how to code with no prior knowledge in 1 hour is virtually impossible
even 1 week is stretching a lot
i just wanna learn how to script
Independence is appreciated in the world of programming
how much will you pay me
I doubt you'll find anyone here willing to teach you personally
......
Yeah, see? It takes time and effort, so it's either generic tutorials or paid tutoring
there's no real difference between the two
Why don't you just... use free courses on the Internet?
teach yourself man
it's just a skill like anything else
if you can't do that then it's just not for you
Py and JS are popular as hell, they have lots of coverage on the internet
play yeah.-. i cant teach myself how to type abdeca and =
like, start with the concepts, learn what each thing means
eee
the download required tools to try it yourself and play with it around
How old are you btw
I don't
It took me too long to realize pre tags in react do nothing as newlines are ignored in jsx
lol
why appears signal:killed in my console?
i can't make my bot work
it doesn't give any clue on what it is making that signal:killed
ty i made my shop command very welL ty Guys!!!!!!!!!!!!!
show console
or ["color", "colour"].contains(arg)
I have an array, for example [{id:1}, {id:1}, {id:1}, {id:2}, {id:2}, {id:3}]And i want to get a list like 1st: ID of 1 with 3 entries. 2nd: ID of 2 with 2 entries. 3rd: ID of 3 with 1 entry
Does someone know how to do this?
/home/runner/boro-bott/node_modules/bindings/bindings.js:135
throw err;
^
Error: Could not locate the bindings file. Tried:
``` bruh
whyy
now it's the above thing
my node is v12 and i can't update it so updating lib will work or it'll give more errors?
can't tell, check the lib npm page
.contains?
plus arg.toLowerCase() probs
c:\users\callu\appdata\local\node-gyp\cache\17.0.0\include\node\v8-persistent-handle.h(10): fatal error C1083: Cannot open include file: 'v8-weak-callback-info.h': No such file or directory [E:\Developing\Ryft\Discord-Bot\node_modules\erlpack\build\erlpack.vcxproj]
../src/node-opus.cc: In member function 'Napi::Value OpusEncoder::Decode(const Napi::CallbackInfo&)':
../src/node-opus.cc:134:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
``` what??
adding discordjs/opus
tf is .cc?
c source code
idk
used interchangably with C++ sometimes
wouldn't it be .c?
.cc = .cpp
this is a warning though it shouldn't prevent you from compiling
oh then it's compiled?
Seems like an issue with the package
i added in 30 minutes so if it's added i won't need to add it again
Try reinstalling it
k
Although it’s a warning so it shouldn’t be preventing you from running your project
gyp ERR! node -v v12.22.6
gyp ERR! node-gyp -v v8.2.0
gyp ERR! not ok
lol
bruhhh
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - executable path is "/usr/bin/python"
gyp ERR! find Python - version is "2.7.13"
gyp ERR! find Python - version is 2.7.13 - should be >=3.6.0
gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
finding python??
install python3
in js it's possible?
the build tool for node is written in python
and how do i install it
if you want to compile native addons on the go you need to be able to run the build tool
idk google it
npm install python #--cringe

class MessageDelete {
constructor(client) {
this.client = client;
};
async run(message) {
if (message.author.bot) return;
if (!message.content) return;
const regex = /<@!?(1|\d{17,19})>/;
if (message.content.match(regex)) {
const embed = new RichEmbed()
.setColor('RED')
.setAuthor(message.author.username, message.author.displayAvatarURL)
.setDescription(`Well well well, **${message.author.username}** decided to ghost-ping a user..`)
.addField('Their Message', `\`\`\`${Util.escapeMarkdown(message.content)}\`\`\``);
return message.channel.send(message.author, embed);
};
};
};
module.exports = MessageDelete; ```
Will this work
ok yeah cringe
oh quick.db needs python to be downloaded
i didn't know? I have a bot running without python and quick.db
when python installs, i'll check if works
What like all ids or what
How do you securely make your front end communicate with your backend for accounts etc?
I already have a database hooked up to an api which uses jwt for verification but do I have to use the IP of the server hosting the database in the code of the front end?
Because won't that make it vulnerable to attacks?
Members aren’t cached at any time
You fetch all members if you really need to
yea i think i found it, would message.guild.members.fetch() be a solution to this?
server leaderboard for points in a simulated betting system
although i think i'm gonna find a different way to go about this as i'm sure it may get messy for bigger servers
Your server side language no matter what you use does only render the site and it’s content for the user.
He can’t see any code.
Other than this is client sided code for example some JS or frameworks to implement some fancy features
This can always be seen in the source code and can be manipulated at any time by the client
Server side code can’t
Might be a better idea to fetch the users only on request and cache them after
I mean the users name and tag can be stored in your database
Doesn’t need to be fetched and live
anyone happen to know how to get the first 16 bits from a 32 bit number?
In which language
just bitshift?
actually i need to get the bits between 8 and 15 (yeah weird)
in assembly but it really doesnt matter here
some shifting and anding probably
let myRole = message.guild.roles.cache.get("821785879961927720");
user.roles.add(myRole)```
why isnt this working
user is defined as
User {
id: '293060399106883584',
system: null,
locale: null,
flags: UserFlags { bitfield: 640 },
username: 'samm',
bot: false,
discriminator: '0021',
avatar: 'a_701ceb57a053c8fb7b9473b58327f449',
lastMessageID: '900482019224596532',
lastMessageChannelID: '898358737880879104'
}
not going to pretend I understand it fully 👀
https://stackoverflow.com/a/51301008/16910071
actually i got it lol
i first shifted it to the right by 8 bits to get the low 8 bits at the start and then anded by 0xFF to extract the 8 bits
shr eax, 8
and eax, 0xFF
ah ic tyy
what are you working on with assembly? 👀
an os 😳
oh hype
need this to be able to save the attributes of the flags register
well i can save it in an 8 bit number
actually i should
instead of converting it to 32 bits and back for convenience which wastes performance
actually wait i have the member thing but its still not working
what is your code?
let myRole = message.guild.roles.cache.get("821785879961927720");
member.roles.add(myRole)```
how did you get member?
const member = message.guild.members.fetch(user)
this prints
lastMessageID: '900483475507916862',
lastMessageChannelID: '898358737880879104',
premiumSinceTimestamp: 0,
deleted: false,
nickname: 'Lxphere',
_roles: [
'745165233911365665',
'898698578212585513',
'866846789391089744',
'868923073427017778',
'898700495215022100',
'868664428831309855',
'821572340507738143'
],```
i cut off most of it
but thats what some of ikt prints
top part says this
Promise {
GuildMember {
guild: Guild {
members: [GuildMemberManager],
channels: [GuildChannelManager],
roles: [RoleManager],
presences: [PresenceManager],
voiceStates: [VoiceStateManager],
deleted: false,
available: true,```
this is what user is defined as btw
file:///home/runner/bott/index.js:1
const mongoose = require("mongoose");
^
ReferenceError: require is not defined
whatt??
whatlanguage are you using??
do you have it installed on whatever you're running it on??
did you install node.js...
yeah
go to the console and run node -v
it's v12
and ss what it prints
send your package.json here
you need to await the promise, fetch returns a promise
oh ty
hello
i need help with something on discord py, its hard to explain on text so can someone hop on vc and try to help?
i found when people ask for help and then when you leave them for a while they're forced to try and research on their own more thoroughly which leads them to solve their own issue
Even more strange is the fact to ask in Discord than asking google 
ive been searching for the whole day
google doesnt understand my question lol
i lost so much sleep because of my operating system
huh? How
its a really unique experience though
one that no program no matter how low level can give you
its painful yet rewarding
you also learn a lot of c++ and assembly
one day I will work on a compiler when I'm bored enough
nicee
in my os i implemented a pilot version of a task scheduler/switcher
works nicely
took a month though since i took a big break since i couldnt figure something out
only works with assembly programs atm
c++ will probably require restoration of more registers and a custom stack
https://youtu.be/bnnacleqg6k this dude is so good
Rust is a unique programming language that blends imperative and functional concepts to make low-level systems safer. However, compared to other modern languages, designing APIs in Rust requires a fundamentally different mindset -- for example, designing without classes or inheritance. In this talk, I will live-code the design of a simple Rust A...
no
for(const test of [1, 2, 3){}```
how can I make it face not all of a sudden but every 1 second for example
create a promise with setTimeout tp resolve it and await
create an asyncIterator that waits 1 second after yielding the next value

for await (const test of intersperse(wait(1), [1, 2, 3])) {
}
epic gamers
intersperse takes an item and puts in in between every other element in an array so you get
[1, wait(1), 2, wait(1), 3]
but these functions don't exist in js so you'd have to make it work by hand
Ah
but like this is a stupid idea so it doesn't matter
Tf what?
Was that a thing in js since when?
a couple years
I never heard abt that, albeit being a quite handy function
very good, watching it now
How to edit with normal message and embed message in discord.py
My code:
(f"**:yay: GIVEAWAY ENDED :yay:**", embed=new_emb_msg)
Error: edit() takes 1 positional argument but 2 were given
you can do that yourself using string.slice lol
Pass the string to the content parameter explicitly, the only pos arg is self which is the instance itself
Actually I got it :). Anyways Thanks!
(content=f"**:yay: GIVEAWAY ENDED :yay:**", embed=new_emb_msg)

This used to work and now it say botfile not a function
const bots = ["anti system"];
for(const bot of bots) {
const botFile = require(`./${bot}/index.js`);
botFile()
}
there's other ways to do xss though if that's the point
the problem might be spaces in "anti system" or the dir address is incorrect
<img onerror="alert(\"xss\")" src="invalid-url"/>
hello how solve bot token leak problem for some time some bot token got leak
you immediately get an email from discord

