lunarflu HF staff commited on
Commit
2a906f6
·
verified ·
1 Parent(s): ae4f533

await give verified roles + reread csv from scratch each time to stay up to date

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -42,26 +42,26 @@ intents = discord.Intents.all()
42
  bot = commands.Bot(command_prefix='!', intents=intents)
43
 
44
 
45
- global_df = pd.DataFrame()
46
- test_merge = pd.read_csv("https://docs.google.com/spreadsheets/d/1C8aLqgCqLYcMiIFf-P_Aosaa03C_WLIB_UyqvjSdWg8/export?format=csv&gid=0")
47
 
48
 
49
  @bot.event
50
  async def on_ready():
51
- global global_df
52
  """import data from google sheets -> HF Space df (doesn't make API call this way, as it's read-only)"""
53
- global_df = test_merge
54
- print(f"csv successfully retrieved: \n {global_df}")
55
  print(f"We have logged in as {bot.user}")
56
-
57
 
58
 
59
  async def give_verified_roles():
60
  while True:
61
  try:
 
 
 
 
62
  print("Starting the give_verified_roles task...")
63
 
64
- global global_df
65
  guild = bot.get_guild(879548962464493619)
66
  role = guild.get_role(900063512829755413)
67
 
 
42
  bot = commands.Bot(command_prefix='!', intents=intents)
43
 
44
 
45
+
 
46
 
47
 
48
  @bot.event
49
  async def on_ready():
 
50
  """import data from google sheets -> HF Space df (doesn't make API call this way, as it's read-only)"""
 
 
51
  print(f"We have logged in as {bot.user}")
52
+ await give_verified_roles()
53
 
54
 
55
  async def give_verified_roles():
56
  while True:
57
  try:
58
+ global_df = pd.DataFrame()
59
+ test_merge = pd.read_csv("https://docs.google.com/spreadsheets/d/1C8aLqgCqLYcMiIFf-P_Aosaa03C_WLIB_UyqvjSdWg8/export?format=csv&gid=0")
60
+ global_df = test_merge
61
+ print(f"csv successfully retrieved: \n {global_df}")
62
  print("Starting the give_verified_roles task...")
63
 
64
+
65
  guild = bot.get_guild(879548962464493619)
66
  role = guild.get_role(900063512829755413)
67