55
66# get path name for csv file
77file_path = os .path .join (os .getcwd (), "data" )
8- file_path = os .path .join (file_path , "" )
8+ csv_file = "data.csv"
9+ file_path = os .path .join (file_path , csv_file )
10+ print (file_path )
911
1012class Leaderboard (commands .Cog ):
1113 def __init__ (self ,bot ):
@@ -15,12 +17,12 @@ def __init__(self,bot):
1517 async def on_ready (self ):
1618 print (f"leaderboard - Loaded" )
1719
18- @nextcord .slash_command (name = "leaderboard" , description = "Frong leaderboard" )
20+ @nextcord .slash_command (name = "leaderboard" , description = "Frong leaderboard" , guild_ids = [ 414625175217242113 ] )
1921 async def leaderboard (self , interaction : nextcord .Interaction ):
2022 csv_dict = {}
2123 data = ""
2224 total = 0
23- with open (file_path + "data.csv" , 'r' ) as file :
25+ with open (file_path , 'r' ) as file :
2426 reader = csv .DictReader (file )
2527
2628 # turn csv into dictionary
@@ -44,7 +46,7 @@ async def leaderboard(self, interaction: nextcord.Interaction):
4446 embed = nextcord .Embed (title = ":crown: **LEADERBOARD**" , color = 0xd6b509 )
4547 embed .add_field (name = ":speech_balloon: __FRONGS BY USER__" , value = data ,inline = False )
4648 embed .add_field (name = ":loudspeaker: __TOTAL FRONGS__" , value = total ,inline = False )
47- await interaction .response .send_message (embed = embed , ephemeral = True )
49+ await interaction .response .send_message (embed = embed , ephemeral = False )
4850
4951def setup (bot ):
5052 bot .add_cog (Leaderboard (bot ))
0 commit comments