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
{{ message }}
This repository was archived by the owner on May 25, 2022. It is now read-only.
Asks for configuration data if it wasn't found or the located data was corrupt.
Another step towards v0.1.3! In addition to the aforementioned feature, a few changes have been made. Most notably, the googleConfig.json file now refers to the spreadsheet as *SheetsID* rather than *SpreadsheetID*. Progress towards 0.1.3 is smoothly continuing, however, I'm not completely sure if I will be able to complete it for tomorrow. If not on Sunday, then the update will almost certainly be released the next day.
*Summary*
This commit resolves two issues, #7 and #6 .
Console.WriteLine("Google Sheets data not found or corrupt.");
82
116
}
83
117
else
84
118
{
@@ -112,13 +146,13 @@ public struct BotConfig
112
146
{
113
147
publicstringToken;// Get this from discordapp.com/developers (this is also where you can add the bot to a server)
114
148
publicstringPrefix;// The character required to send a command
115
-
publicintUpdateDelay;// Delay between checking for updates (in seconds)
149
+
publicintUpdateDelay;// Delay between checking for updates (in minutes)
116
150
}
117
151
118
152
publicstructGoogleConfig// Get the API Key from console.developers.google.com and make a sheets api and key. Get the sheets id from the google sheet (make one from a google form)
119
153
{
120
154
publicstringAPIKey;
121
-
publicstringSpreadsheetID;
155
+
publicstringSheetsID;
122
156
publicstringRange;// Range on the form ie. B2:L which gets all information from B2 to L (goes all the way down too)
123
157
publicintRolesStartAfter;// # of spots after the initial index in the range where the roles begin
124
158
publicintRolesEndBefore;// # of spots before the final index in the range where the last role lies
Console.WriteLine("Google configuration data wasn't found or is corrupt.\n\nPress enter to keep the default value.");
71
+
inti=0;
72
+
73
+
stringapiKey="";
74
+
75
+
while(string.IsNullOrWhiteSpace(apiKey))
76
+
{
77
+
if(i!=0)Console.WriteLine("Press enter to keep the default value. You can also configure the APIKey manually by editing the googleConfig.json file.\nAdditional information on how to find the API Key can be found on this repository's Readme");
78
+
79
+
Console.Write("API Key: ");
80
+
apiKey=Console.ReadLine();
81
+
i=1;
82
+
83
+
if(apiKey=="")break;
84
+
}
85
+
86
+
stringspreadsheetId="";
87
+
while(string.IsNullOrWhiteSpace(spreadsheetId))
88
+
{
89
+
if(i!=1)Console.WriteLine("Press enter to keep the default value. You can also manually configure the SheetsID in googleConfig.json.\nAdditional information can be found on the Github repository.");
90
+
91
+
Console.Write("Spreadsheet ID: ");
92
+
spreadsheetId=Console.ReadLine();
93
+
i=2;
94
+
95
+
if(spreadsheetId=="")break;
96
+
}
97
+
98
+
stringrange="";
99
+
while(string.IsNullOrWhiteSpace(range))
100
+
{
101
+
if(i!=2)Console.WriteLine("Press enter to keep the default value. You can also manually configure the Range in googleConfig.json.\nAdditional information can be found on the Github repository.");
102
+
103
+
Console.Write("Range: ");
104
+
range=Console.ReadLine();
105
+
i=3;
106
+
107
+
if(range=="")break;
108
+
}
109
+
110
+
introlesStartAfter=-5;
111
+
while(rolesStartAfter==-5)
112
+
{
113
+
if(i!=3)Console.WriteLine("Press enter to keep the default value. You can also manually configure RolesStartAfter in googleConfig.json.\nAdditional information can be found on the Github repository.");
114
+
115
+
Console.Write("Roles Start After: ");
116
+
stringvalue=Console.ReadLine();
117
+
i=4;
118
+
119
+
if(value=="")break;
120
+
121
+
int.TryParse(value,outinttemp);
122
+
if(temp>=0)rolesStartAfter=temp;
123
+
}
124
+
125
+
introlesEndBefore=-5;
126
+
while(rolesEndBefore==-5)
127
+
{
128
+
if(i!=4)Console.WriteLine("Press enter to keep the default value. You can also manually configure RolesEndBefore in googleConfig.json.\nAdditional information can be found on the Github repository.");
129
+
130
+
Console.Write("Roles End Before: ");
131
+
stringvalue=Console.ReadLine();
132
+
i=5;
133
+
134
+
if(value=="")break;
135
+
136
+
int.TryParse(value,outinttemp);
137
+
if(temp>=0)
138
+
{
139
+
rolesEndBefore=temp;
140
+
}
141
+
}
142
+
143
+
intdiscordID=-5;
144
+
while(discordID==-5)
145
+
{
146
+
if(i!=5)Console.WriteLine("Press enter to keep the default value. You can also manually configure DiscordIDField in googleConfig.json.\nAdditional information can be found on the Github repository.");
147
+
148
+
Console.Write("Discord ID Field: ");
149
+
stringvalue=Console.ReadLine();
150
+
i=6;
151
+
152
+
if(value=="")break;
153
+
154
+
int.TryParse(value,outinttemp);
155
+
if(temp>=-1)
156
+
{
157
+
discordID=temp;
158
+
}
159
+
}
160
+
161
+
intnickname=-5;
162
+
while(nickname==-5)
163
+
{
164
+
if(i!=6)Console.WriteLine("Press enter to keep the default value. You can also manually configure NicknameField in googleConfig.json.\nAdditional information can be found on the Github repository.");
Console.WriteLine("Bot configuration data was not found or is corrupt.\n\nPress enter to keep the default value.");
188
+
stringtoken="";
189
+
inti=0;
190
+
while(string.IsNullOrWhiteSpace(token))
191
+
{
192
+
if(i!=0)
193
+
Console.WriteLine("Please enter a bot token or configure it manually in the config.json file. Please refer to the readme for instructions on how to find the token.");
194
+
195
+
i=1;
196
+
Console.Write("Bot Token: ");
197
+
token=Console.ReadLine();
198
+
if(token=="")break;
199
+
}
200
+
201
+
stringprefix="";
202
+
while(string.IsNullOrWhiteSpace(prefix))
203
+
{
204
+
if(i!=1)
205
+
Console.WriteLine(
206
+
"Please enter a single character to serve as the command prefix. Otherwise, enter one manually in config.json.");
207
+
208
+
i=2;
209
+
Console.Write("Bot Prefix: ");
210
+
prefix=Console.ReadLine();
211
+
212
+
if(prefix.Length==0)
213
+
{
214
+
prefix=Config.Bot.Prefix;
215
+
break;
216
+
}
217
+
elseif(prefix.Length!=1)prefix="";
218
+
}
219
+
220
+
intdelay=0;
221
+
while(delay<=0)
222
+
{
223
+
if(i!=2)
224
+
Console.WriteLine(
225
+
"The delay between checking for updates from the attached Google Sheet, specified in minutes, must be greater than 0. This value can be changed manually in config.json.");
0 commit comments