@@ -33,11 +33,11 @@ public override async Task<bool> Start()
33
33
bot . MessageReceived += MessageReceived ;
34
34
35
35
// Log in and start bot
36
- await bot . LoginAsync ( TokenType . Bot , config . Keys . DiscordToken ) ;
37
- await bot . StartAsync ( ) ;
36
+ await bot . LoginAsync ( TokenType . Bot , config . Keys . DiscordToken ) . ConfigureAwait ( false ) ;
37
+ await bot . StartAsync ( ) . ConfigureAwait ( false ) ;
38
38
39
39
// Wait forever
40
- await Task . Delay ( - 1 ) ;
40
+ await Task . Delay ( - 1 ) . ConfigureAwait ( false ) ;
41
41
return true ;
42
42
}
43
43
@@ -52,11 +52,11 @@ public async void OnTimerTick(object configObject)
52
52
var writeConfig = false ;
53
53
for ( var thisRss = 0 ; thisRss < config . Rss . Length ; thisRss ++ )
54
54
{
55
- if ( config . Rss [ thisRss ] . Protocol . ToUpperInvariant ( ) == "DISCORD" )
55
+ if ( string . Equals ( config . Rss [ thisRss ] . Protocol , "DISCORD" , StringComparison . InvariantCultureIgnoreCase ) )
56
56
{
57
57
var newMostRecent = config . Rss [ thisRss ] . MostRecent ;
58
58
var numFound = 0 ;
59
- if ( config . Rss [ thisRss ] . Format . ToUpperInvariant ( ) == "RSS" )
59
+ if ( string . Equals ( config . Rss [ thisRss ] . Format , "RSS" , StringComparison . InvariantCultureIgnoreCase ) )
60
60
{
61
61
// Parse RSS Format
62
62
try
@@ -90,13 +90,13 @@ public async void OnTimerTick(object configObject)
90
90
}
91
91
catch
92
92
{
93
- try
93
+ try
94
94
{
95
95
// Try RFC822 with 2 and 4 digit year
96
96
var formats = new string [ ] { "ddd, dd MMM yyyy HH:mm:ss zzzzz" , "ddd, dd MMM yy HH:mm:ss zzzzz" , "ddd, dd MMM yyyy HH:mm:ss zzzz" , "ddd, dd MMM yy HH:mm:ss zzzz" } ;
97
97
rssItem . PubDate = DateTime . ParseExact ( dateString , formats , CultureInfo . InvariantCulture , DateTimeStyles . AdjustToUniversal ) ;
98
98
}
99
- catch
99
+ catch
100
100
{
101
101
// Everything failed. Give up.
102
102
rssItem . PubDate = config . Rss [ thisRss ] . MostRecent ;
@@ -170,7 +170,7 @@ public async void OnTimerTick(object configObject)
170
170
// Save Config
171
171
if ( writeConfig )
172
172
{
173
- await System . IO . File . WriteAllTextAsync ( "config.json" , JsonConvert . SerializeObject ( config , Formatting . Indented ) ) ;
173
+ await System . IO . File . WriteAllTextAsync ( "config.json" , JsonConvert . SerializeObject ( config , Formatting . Indented ) ) . ConfigureAwait ( false ) ;
174
174
}
175
175
}
176
176
0 commit comments