Changed start for Heroku
This commit is contained in:
commit
029d2bdae9
1 changed files with 9 additions and 7 deletions
|
|
@ -23,17 +23,19 @@ namespace Bot_Discord_CSharp
|
||||||
|
|
||||||
public async Task RunAsync()
|
public async Task RunAsync()
|
||||||
{
|
{
|
||||||
var json = string.Empty;
|
//var json = string.Empty;
|
||||||
|
|
||||||
using (var fs = File.OpenRead(@"E:\Proyectos Visual Studio\Bot_Discord_CSharp\Bot_Discord_CSharp\config.json"))
|
//using (var fs = File.OpenRead(@"E:\Proyectos Visual Studio\Bot_Discord_CSharp\Bot_Discord_CSharp\config.json"))
|
||||||
using (var sr = new StreamReader(fs, new UTF8Encoding(false)))
|
//using (var sr = new StreamReader(fs, new UTF8Encoding(false)))
|
||||||
json = await sr.ReadToEndAsync().ConfigureAwait(false);
|
// json = await sr.ReadToEndAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
var configJson = JsonConvert.DeserializeObject<ConfigDto>(json);
|
//var configJson = JsonConvert.DeserializeObject<ConfigDto>(json);
|
||||||
|
var Token = Environment.GetEnvironmentVariable("Token");
|
||||||
|
var prefix = Environment.GetEnvironmentVariable("Prefix");
|
||||||
|
|
||||||
var config = new DiscordConfiguration
|
var config = new DiscordConfiguration
|
||||||
{
|
{
|
||||||
Token = configJson.Token,
|
Token = Token,
|
||||||
TokenType = TokenType.Bot,
|
TokenType = TokenType.Bot,
|
||||||
AutoReconnect = true,
|
AutoReconnect = true,
|
||||||
MinimumLogLevel = LogLevel.Debug
|
MinimumLogLevel = LogLevel.Debug
|
||||||
|
|
@ -50,7 +52,7 @@ namespace Bot_Discord_CSharp
|
||||||
|
|
||||||
var commandsConfig = new CommandsNextConfiguration
|
var commandsConfig = new CommandsNextConfiguration
|
||||||
{
|
{
|
||||||
StringPrefixes = new string[] { configJson.Prefix },
|
StringPrefixes = new string[] { prefix },
|
||||||
EnableDms = false,
|
EnableDms = false,
|
||||||
EnableMentionPrefix = true,
|
EnableMentionPrefix = true,
|
||||||
DmHelp = false
|
DmHelp = false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue