repl.it
@HarperframeInc/

MarketDroid 0.0.3

Python

No description

fork
loading
Files
  • main.py
  • keep_alive.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Welcome to MarketDroid 0.0.3
#
#
#     {Info Text goes here}
#
#

# Remember to place json_store_client key and DISCORD_BOT_SECRET in .env to keep privacy

# Thanks Lukadd for helping!

import discord
import os
import gspread
from oauth2.service_account import ServiceAccountCredentials
from keep_alive import keep_alive
from discord.ext import commands

# Easy Tutorial for GSpread -> https://www.youtube.com/watch?v=vISRn5qFrkM <-


### Begin GSpread

scope = ['https://spreadsheets.google.com/feeds']
creds = None #Creds must come from JSON File, not available
client = gspread.authorize(creds)

sheet = client.open('market-company-storage').sheet1





### End GSpread

class MB(commands.Bot): #main class
  def __init__(self): #no help command, prefix=$
    super().__init__(command_prefix="$", help_command=None, reconnect=True)

  async def on_ready(self):
    print("Hello World!")
    print(f"Logged in as: {self.user.name} - {self.user.id}")
    print(f"Library Version: {discord.__version__}")

  @commands.command()
  async def help(self, ctx):
    embed = discord.Embed(
      title = "Market Bot Help",
      desc="""
      Welcome to the Market Bot help section!
      Prefix is {commands.command_prefix}

      Help - Takes you here.
      Bal|Balance - Balance
      Loan - Loan money from Bank

      Market Police
      Add|Addmoney - Adds Money to Account
      Rem|Remmoney - Removes Money from account
      Closebank (MM) - Closes Loans
      
      The Market Bot is made by oooffff
      
      """,
      color=discord.Color.green()
      
    )
    ctx.send(embed=embed)


  @commands.command()
  async def debug(ctx):
    await ctx.send("Debugged")

keep_alive()
token = os.environ.get("DISCORD_BOT_SECRET")
MB().run(token)
?