1
1
from distutils .command .check import check
2
2
from os import environ , getenv , listdir
3
3
from os .path import dirname
4
+ from requests import get as requests_get
4
5
5
6
import discord
6
- import requests
7
7
from discord .ext import commands
8
8
from dotenv import load_dotenv
9
9
from firebase_admin import credentials , db , initialize_app
@@ -104,7 +104,7 @@ async def ping(ctx):
104
104
async def doge (ctx ):
105
105
"""Return a doge pic"""
106
106
try :
107
- doge_pic_url = requests . get (
107
+ doge_pic_url = requests_get (
108
108
"https://shibe.online/api/shibes?count=1&urls=true"
109
109
).json ()[0 ]
110
110
await ctx .send (doge_pic_url )
@@ -121,7 +121,7 @@ async def sum(ctx, numOne: int, numTwo: int):
121
121
122
122
123
123
@bot .command ()
124
- @commands .has_any_role ("Board Member" )
124
+ @commands .has_any_role ("Cabinet Member" )
125
125
async def add_data (ctx , name : str , rating : int = 0 , contributions : int = 0 ):
126
126
f"""Add data to the leaderboard. Call it by { command_prefix } add_data "name" rating contribution"""
127
127
try :
@@ -172,7 +172,7 @@ async def add_data(ctx, name: str, rating: int = 0, contributions: int = 0):
172
172
173
173
174
174
@bot .command ()
175
- @commands .has_any_role ("Board Member" )
175
+ @commands .has_any_role ("Cabinet Member" )
176
176
async def add_recruits (ctx ):
177
177
f"""Add recruits by reading a members.txt file present in the same folder"""
178
178
# Place file in discord-bot folder.
@@ -199,8 +199,8 @@ async def add_recruits(ctx):
199
199
200
200
201
201
@bot .command ()
202
- @commands .has_any_role ("Board Member" )
203
- async def update_data (ctx , name : str , rating = 0 , contributions = 0 ):
202
+ @commands .has_any_role ("Cabinet Member" )
203
+ async def set_points (ctx , name : str , rating = 0 , contributions = 0 ):
204
204
try :
205
205
data = leaderboard_ref .get ()
206
206
name = name .strip ()
@@ -238,7 +238,7 @@ async def update_data(ctx, name: str, rating=0, contributions=0):
238
238
239
239
240
240
@bot .command ()
241
- @commands .has_any_role ("Member" , "Board Member" )
241
+ @commands .has_any_role ("Member" , "Cabinet Member" )
242
242
async def fetch_data (ctx , name ):
243
243
"""Fetch data from the leaderboard"""
244
244
try :
@@ -260,7 +260,7 @@ async def fetch_data(ctx, name):
260
260
261
261
262
262
@bot .command ()
263
- @commands .has_any_role ("Board Member" )
263
+ @commands .has_any_role ("Cabinet Member" )
264
264
async def delete_data (ctx , name ):
265
265
"""Delete someone from the leaderboard"""
266
266
try :
@@ -278,7 +278,7 @@ async def delete_data(ctx, name):
278
278
279
279
280
280
@bot .command ()
281
- @commands .has_any_role ("Leaderboard" , "Board Member" )
281
+ @commands .has_any_role ("Leaderboard" , "Cabinet Member" )
282
282
async def contribution (ctx , name , task ):
283
283
"""Add contribution to a member"""
284
284
try :
@@ -405,4 +405,17 @@ async def on_message(message):
405
405
await bot .process_commands (message )
406
406
407
407
408
+ def add_members_to_act (
409
+ act_num : int ,
410
+ member_names : list [str ],
411
+ discord_roles : list [str ],
412
+ add_roles_to_discord : bool = False ,
413
+ ):
414
+ ...
415
+
416
+
417
+ def fetch_spreadsheet (speadsheet_id : str ):
418
+ ...
419
+
420
+
408
421
bot .run (getenv ("BOT_TOKEN" ))
0 commit comments