You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bot/utils/api.py
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,15 @@ def fetch_latest_prices():
8
8
response=requests.get(url, headers=HEADERS) # OSRS wiki demands custom user-agent headers, defined in config.yaml. python requests are blocked by default
Copy file name to clipboardExpand all lines: readme.md
+27-21Lines changed: 27 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,26 @@
1
1
# OSRS Utilities
2
2
3
-
This is a Discord bot that fetches the latest prices from the Old School Runescape Grand Exchange and calculates the potential profit from herb farming runs. The reason for a different utility than the osrs wiki farm herb calculator is due to the method that it fetches GE prices for items, which does not accurately represent the current price.

8
6
9
-
Calculate the potential profit from herb farming runs.
7
+
This Discord bot fetches the latest prices from the Old School Runescape Grand Exchange and calculates potential profits from herb farming runs and cooking fish. Unlike the OSRS Wiki herb calculator, this bot uses a different method to fetch Grand Exchange prices for items, providing more accurate current prices.
The bot commands are configured in a way that the parameters for the command will be prompted and autofilled by the bot.
15
12
16
-
Calculate the potential profit from cooking fish.
13
+
```/herb_profit```
17
14
18
-
Usage:
19
15
```/fish_profit```
20
16
21
-
## Roadmap / TODO 📋✨
17
+
## Roadmap 📋✨
22
18
23
-
Please feel free to submit ideas (as issues) or pull requests for requested/nice to have features
19
+
Feel free to submit ideas (as issues) or pull requests for requested or nice-to-have features. See the projects board for accurate feature/issue tracking.
24
20
25
21
### New User Options for Commands 🛠️
26
22
27
-
-[] Allow users to set if they want the latest price or 1h average
23
+
-[x] Allow users to set if they want the latest price or 1h average
28
24
29
25
### New Commands 🎣🔥
30
26
@@ -41,6 +37,8 @@ Please feel free to submit ideas (as issues) or pull requests for requested/nice
41
37
42
38
```bash
43
39
osrs_utilities/
40
+
├── assets/
41
+
│ ├── images/
44
42
├── bot/
45
43
│ ├── __init__.py
46
44
│ ├── bot.py
@@ -101,20 +99,27 @@ osrs_utilities/
101
99
102
100
3. **Set up environment variables:**
103
101
104
-
Create a `.env` file in the root directory and add your Discord bot token:
102
+
Create a ```.env``` file in the root directory and add your Discord bot token:
105
103
106
104
```env
107
105
DISCORD_BOT_TOKEN=your_discord_bot_token
108
106
```
109
107
110
108
4. **Configure settings:**
111
109
112
-
Update `config.yaml` with any additional settings you need.
110
+
Update ```config.yaml``` with any additional settings you need.
111
+
112
+
```yaml
113
+
bot_prefix:
114
+
intents:
115
+
headers:
116
+
debug:
117
+
```
113
118
114
119
5. **Run the bot:**
115
120
116
121
```bash
117
-
python run.py
122
+
python .\run.py
118
123
```
119
124
120
125
## Installation (Docker)
@@ -143,7 +148,7 @@ osrs_utilities/
143
148
## Usage
144
149
145
150
- Add your bot to your Discord server using the OAuth2 URL generated in the Discord Developer Portal.
146
-
- Use the `/herb_profit`commandin your Discord server to see the profit data.
151
+
- refer to the commandsection or bot.py for all commands
147
152
148
153
## Debugging
149
154
@@ -159,10 +164,10 @@ When debugging is enabled, additional information will be printed to the console
159
164
160
165
To add new commands and features, follow these steps:
161
166
162
-
1. **Create a new command file (optional):**
167
+
1. **Create a new command file:**
163
168
164
169
- If you have multiple commands related to a feature, you might want to group them in a separate file.
165
-
- For example, create a file bot/new_feature_commands.py.
170
+
- create the new command file in /commands/ folder
166
171
167
172
2. **Define the commandin the command file:**
168
173
@@ -171,9 +176,10 @@ To add new commands and features, follow these steps:
171
176
172
177
3. **Add utility functions (if needed):**
173
178
174
-
- If the command requires helper functions, add them to bot/utils.py.
179
+
- re-use any of the helper utilities found in the /utils/ folder
180
+
- if a new utility is identified, create one here to be re-used later in new commands
175
181
176
-
4. **Load the new commandin run.py:**
182
+
4. **Load the new commandin run.py and/or bot.py:**
177
183
178
184
- Ensure the new command file is imported and the setup functionis called.
0 commit comments