Add command to add steam ids to users

This commit is contained in:
Dustin Pianalto 2019-12-16 22:32:25 -09:00
parent 9a37bb53a9
commit cf18488283
2 changed files with 15 additions and 1 deletions

View File

@ -408,6 +408,20 @@ class Rcon(commands.Cog):
else: else:
await ctx.send('I need a list of members to whitelist.') await ctx.send('I need a list of members to whitelist.')
@commands.command(name="add_steamid", aliases=['steamid'])
@checks.is_moderator()
async def _add_steam_id_to_user(self, ctx, member: discord.Member, steam_id: int):
if isinstance(member, discord.Member):
resp = await self.bot.aio_session.patch(f'{self.bot.api_base}/users/{member.id}/',
headers=self.bot.auth_header,
json={'steam_id': steam_id})
if resp.status == 200:
await ctx.message.add_reaction(self.bot.success_emoji)
return
await ctx.send('I couldn\'t update that user for some reason.')
return
await ctx.send('Are you sure that is a valid user?')
# #
# @commands.command(name='new_patron') # @commands.command(name='new_patron')
# @commands.guild_only() # @commands.guild_only()

View File

@ -39,7 +39,7 @@ class Geeksbot(commands.Bot):
self.git_url = 'https://github.com/dustinpianalto/geeksbot_v2' self.git_url = 'https://github.com/dustinpianalto/geeksbot_v2'
self.load_default_extensions() self.load_default_extensions()
self.owner_id = 351794468870946827 self.owner_id = 351794468870946827
self.success_emoji = '\N{WHITE CHECK MARK}'
self.book_emojis = { self.book_emojis = {
'unlock': '🔓', 'unlock': '🔓',
'start': '', 'start': '',