Merge branch '1.4' into shard-process
This commit is contained in:
commit
449586c0e3
@ -16,7 +16,6 @@ namespace NadekoBot.Services
|
|||||||
string CarbonKey { get; }
|
string CarbonKey { get; }
|
||||||
|
|
||||||
DBConfig Db { get; }
|
DBConfig Db { get; }
|
||||||
string SoundCloudClientId { get; }
|
|
||||||
string OsuApiKey { get; }
|
string OsuApiKey { get; }
|
||||||
|
|
||||||
bool IsOwner(IUser u);
|
bool IsOwner(IUser u);
|
||||||
|
@ -25,17 +25,6 @@ namespace NadekoBot.Services.Impl
|
|||||||
|
|
||||||
public string LoLApiKey { get; }
|
public string LoLApiKey { get; }
|
||||||
public string OsuApiKey { get; }
|
public string OsuApiKey { get; }
|
||||||
private string _soundcloudClientId;
|
|
||||||
public string SoundCloudClientId {
|
|
||||||
get {
|
|
||||||
return string.IsNullOrWhiteSpace(_soundcloudClientId)
|
|
||||||
? "d0bd7768e3a1a2d15430f0dccb871117"
|
|
||||||
: _soundcloudClientId;
|
|
||||||
}
|
|
||||||
private set {
|
|
||||||
_soundcloudClientId = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public DBConfig Db { get; }
|
public DBConfig Db { get; }
|
||||||
public int TotalShards { get; }
|
public int TotalShards { get; }
|
||||||
@ -81,8 +70,8 @@ namespace NadekoBot.Services.Impl
|
|||||||
ulong.TryParse(data[nameof(ClientId)], out clId);
|
ulong.TryParse(data[nameof(ClientId)], out clId);
|
||||||
ClientId = clId;
|
ClientId = clId;
|
||||||
|
|
||||||
var scId = data[nameof(SoundCloudClientId)];
|
//var scId = data[nameof(SoundCloudClientId)];
|
||||||
SoundCloudClientId = scId;
|
//SoundCloudClientId = scId;
|
||||||
//SoundCloudClientId = string.IsNullOrWhiteSpace(scId)
|
//SoundCloudClientId = string.IsNullOrWhiteSpace(scId)
|
||||||
// ?
|
// ?
|
||||||
// : scId;
|
// : scId;
|
||||||
|
@ -19,8 +19,6 @@ namespace NadekoBot.Services.Music
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(url))
|
if (string.IsNullOrWhiteSpace(url))
|
||||||
throw new ArgumentNullException(nameof(url));
|
throw new ArgumentNullException(nameof(url));
|
||||||
if (string.IsNullOrWhiteSpace(_creds.SoundCloudClientId))
|
|
||||||
throw new ArgumentNullException(nameof(_creds.SoundCloudClientId));
|
|
||||||
|
|
||||||
string response = "";
|
string response = "";
|
||||||
|
|
||||||
@ -44,8 +42,6 @@ namespace NadekoBot.Services.Music
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(query))
|
if (string.IsNullOrWhiteSpace(query))
|
||||||
throw new ArgumentNullException(nameof(query));
|
throw new ArgumentNullException(nameof(query));
|
||||||
if (string.IsNullOrWhiteSpace(_creds.SoundCloudClientId))
|
|
||||||
throw new ArgumentNullException(nameof(_creds.SoundCloudClientId));
|
|
||||||
|
|
||||||
var response = "";
|
var response = "";
|
||||||
using (var http = new HttpClient())
|
using (var http = new HttpClient())
|
||||||
|
@ -67,7 +67,7 @@ namespace NadekoBot.Services.Permissions
|
|||||||
public async Task<bool> TryBlockEarly(IGuild guild, IUserMessage msg)
|
public async Task<bool> TryBlockEarly(IGuild guild, IUserMessage msg)
|
||||||
=> !(msg.Author is IGuildUser gu) //it's never filtered outside of guilds, and never block administrators
|
=> !(msg.Author is IGuildUser gu) //it's never filtered outside of guilds, and never block administrators
|
||||||
? false
|
? false
|
||||||
: gu.GuildPermissions.Administrator && (await FilterInvites(guild, msg) || await FilterWords(guild, msg));
|
: !gu.GuildPermissions.Administrator && (await FilterInvites(guild, msg) || await FilterWords(guild, msg));
|
||||||
|
|
||||||
public async Task<bool> FilterWords(IGuild guild, IUserMessage usrMsg)
|
public async Task<bool> FilterWords(IGuild guild, IUserMessage usrMsg)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user