Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [Stock Market] Add New Cog #554

Open
wants to merge 42 commits into
base: V3/testing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
84ddbd0
Stockmarket Cog
zach1502 Mar 12, 2022
ab356cd
Add files via upload
zach1502 Mar 24, 2022
5a1b2fd
Delete __init__.py
zach1502 Mar 24, 2022
7963d97
Delete constants.py
zach1502 Mar 24, 2022
99f14d3
Delete market.py
zach1502 Mar 24, 2022
558594b
Add files via upload
zach1502 Mar 24, 2022
d5b89da
Merge branch 'SFUAnime:V3/testing' into V3/testing
zach1502 May 6, 2022
d3a714f
Add files via upload
zach1502 May 7, 2022
10aa0e6
Add files via upload
zach1502 May 8, 2022
684e499
Add files via upload
zach1502 May 8, 2022
3fdee4e
Delete market.py
zach1502 May 8, 2022
059b0bb
Delete constants.py
zach1502 May 8, 2022
6bc2a81
Delete __init__.py
zach1502 May 8, 2022
7322630
undid Casino.py changes
zach1502 May 8, 2022
68a860c
Made code comply better with PEP8
zach1502 May 10, 2022
d53b19f
Merge pull request #1 from zach1502/zach1502-patch-1
zach1502 May 10, 2022
295ddbf
Merge branch 'SFUAnime:V3/testing' into V3/testing
zach1502 Jun 13, 2022
8199b96
[AfterHours] Added Type Hints
zach1502 Jun 14, 2022
4c1a2da
Merge pull request #2 from zach1502/type_hints
zach1502 Jun 14, 2022
3112f3b
Revert "Added Type hints"
zach1502 Jun 14, 2022
627c1d0
Merge pull request #3 from zach1502/revert-2-type_hints
zach1502 Jun 14, 2022
0d9f0c0
[AfterHours] Added Type Hints
zach1502 Jun 15, 2022
05b7f6c
Merge pull request #4 from zach1502/type_hints
zach1502 Jun 15, 2022
51a449f
Merge branch 'SFUAnime:V3/testing' into V3/testing
zach1502 Jun 25, 2022
abc1235
Cleaned up code and added type hints
zach1502 Jun 25, 2022
5804777
reverting irrelevant changes
zach1502 Jun 25, 2022
eac7c7c
reverting irrelevant changes
zach1502 Jun 25, 2022
d75560b
undoing irrelevant changes
zach1502 Jun 25, 2022
c66936f
conform to style
zach1502 Jun 25, 2022
f721397
Merge branch 'SFUAnime:V3/testing' into V3/testing
zach1502 Jul 26, 2022
3fd856d
Merge branch 'SFUAnime:V3/testing' into V3/testing
zach1502 Sep 8, 2022
c6a9b14
Implemented Suggested Changes
zach1502 Sep 9, 2022
bf07d12
Made File Paths Platform Agnostic
zach1502 Sep 9, 2022
29c5ea0
Fixed Formatting
zach1502 Sep 9, 2022
c8050dc
Merge branch 'SFUAnime:V3/testing' into V3/testing
zach1502 Sep 11, 2022
6a611df
Delete market.py
zach1502 Sep 11, 2022
af1f724
Delete constants.py
zach1502 Sep 11, 2022
9babac2
Delete info.json
zach1502 Sep 11, 2022
04ec193
Delete utils.py
zach1502 Sep 11, 2022
d50cd70
Delete __init__.py
zach1502 Sep 11, 2022
c63abef
Add files via upload
zach1502 Sep 11, 2022
04d1fd5
Merge pull request #5 from zach1502/removing-accidentally-placed-file…
zach1502 Sep 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cogs/stockmarket/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .market import Market


def setup(bot):
bot.add_cog(Market(bot))
52 changes: 52 additions & 0 deletions cogs/stockmarket/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""Separate file for constants. Cause this takes up too much space."""

MAX_MSG_LENGTH = 1021
PRICE_MULTIPLIER = 100
BROKER_NAME = "Ren's Brokerage"
DATA_FILE = "cogs\\stockmarket\\portfolios.json"
EMBED_LOCATION = "cogs\\stockmarket\\chart.jpg"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please make these paths platform-agnostic? This would work on Windows but not Linux.

TRANSACTION_CANCELLED_STR = "Transaction cancelled!"
INVALID_TICKER_STR = "Invalid ticker symbol!"
INVALID_AMOUNT_STR = "Invalid amount!"
POOR_STR = "You do not have enough money to buy this stock!"
ACCOUNT_NOT_FOUND_STR = """No account found! Please create an account using `renmarket createacc`.""" # .format(get prefix somehow)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: No need for """.

QUIPS = [
"Ready to Donate your money to Wall Street I see?",
"AAAAAAAAAAND IT'S GONE!",
"Diamond Hands. :raised_hands: :gem:",
"Look, I swear I have a Securities License.",
"I'm maybe not a real broker, but I can help you with that!",
"Wow, did you learn that from r/wallstreetbets?",
"Stocks are the only thing I would willingly buy high and sell low",
"Pssst, I have insider information on this stock!",
"Nothing brings me more joy than receiving dividends!",
"I found out that I can manipulate stock market. Whatever I bought, it went red.",
"The best way to earn a million dollars is to invest 10 million",
"Let's talk about my retirement plan",
"100% Not a pyramid scheme!",
"Technical analysis is the Astrology of the stock market",
'Look! the "Evergreen Forest" Formation is forming in the charts!',
"BUY BUY BUY!",
"SELL SELL SELL!",
"Buying and holding for the long run is the best strategy!",
"Oh! Tell me more about your NFT collection!",
"Something about THIS stocks feels good!",
"Started from the bottom now we're here!",
"Learn to Invest!",
"Short my stock, I shorten your life. :knife: :knife: :knife:",
"Value or Growth stocks? :thinking:",
"I still don't how the market works, and at this point I'm afraid to ask.",
"I am a financial genious!",
"Since I own this stock, you should buy it!",
"The more you invest, the more I will earn!",
"By the time you're old enough to retire, you'll have more money than you think!",
"You're poorer than you think. ScotiaBank.",
"APES TOGETHER STRONG",
"Welcome back summoner!",
"You can't find great value even if you were in a Walmart.",
"Donate money to your rich local broker today",
"Do you know why the European stock markets are sliding down?, Greece.",
"How to be rich. Step 1: Take out student loans, Step 2: Invest in stocks, Step 3: Profit!",
"Anything I say here is not financial advice, I'm ren, not your adviser.",
"$GME go BRRRRRRRRRRRRRRRRRRRRRR",
]
Loading