Menu

Learn how to start playing on JartexNetwork in just 60 seconds!
Play Now
Learn how to join our server
and start playing in 60 seconds
Play Now
CLICK TO JOIN JOIN OUR DISCORD
0
0

Hey anyone know Python?

not_Nuggets

Addicted Member
Banned
Donator
Joined
August 14, 2020
Messages
2,123
Points
249
Age
18
IGN
not_Nuggets
Hey so I need some help..

Specifically with discord.py, the Python Wrapper for Discord!

I am making a bot, and need to get something from a JSON database

1614861649872.png

this is my players.json file, where when someone uses a command, Ex: =command funni

it saves "funni" with their id.

and I am creating a command that requires the name (funni), however I cannot figure out how to do that.


1614861751075.png


so I have this code, and before you tell me some of it is wrong, I know that

the var lol is wrong, as it clearly gets the member id.

However, how can I get the name (funni)

Thanks in advance
 
  • Pensive
Reactions: Yuu
AUTHOR
AUTHOR
not_Nuggets

not_Nuggets

Addicted Member
Banned
Donator
Joined
August 14, 2020
Messages
2,123
Points
249
Age
18
IGN
not_Nuggets
me being the smartest being on the planet, forgot a str() around the member.id part. I also made it way easier and compact
 
AUTHOR
AUTHOR
not_Nuggets

not_Nuggets

Addicted Member
Banned
Donator
Joined
August 14, 2020
Messages
2,123
Points
249
Age
18
IGN
not_Nuggets
Do you use any special classes? Do you use pip.discord?
no I just do the basic pip install discord
and then I just import discord and from discord.ext import commands, tasks
etc etc
 

vortex91

Addicted Member
Joined
May 12, 2020
Messages
2,021
Points
147
IGN
UntilNightfall
Hey so I need some help..

Specifically with discord.py, the Python Wrapper for Discord!

I am making a bot, and need to get something from a JSON database

View attachment 13181

this is my players.json file, where when someone uses a command, Ex: =command funni

it saves "funni" with their id.

and I am creating a command that requires the name (funni), however I cannot figure out how to do that.


View attachment 13182


so I have this code, and before you tell me some of it is wrong, I know that

the var lol is wrong, as it clearly gets the member id.

However, how can I get the name (funni)

Thanks in advance
Ask Pace
 

Heroic

Addicted Member
Donator
Joined
November 26, 2020
Messages
1,848
Points
236
bro, I started learning python like a month ago, still nothing in brain, btw nice
 
AUTHOR
AUTHOR
not_Nuggets

not_Nuggets

Addicted Member
Banned
Donator
Joined
August 14, 2020
Messages
2,123
Points
249
Age
18
IGN
not_Nuggets
just gotta figure out how to make this command work for 4 pings. so =test @Nuggets @test2 T Test3 @test4
 
Top