Merge branch 'dev' of https://github.com/Kwoth/NadekoBot into dev
This commit is contained in:
commit
6ab37df781
@ -5,7 +5,6 @@ ________________________________________________________________________________
|
|||||||
#### Setting Up NadekoBot v0.98
|
#### Setting Up NadekoBot v0.98
|
||||||
###### Prerequisites:
|
###### Prerequisites:
|
||||||
1) NET Framework 4.5.2 (or 4.6)
|
1) NET Framework 4.5.2 (or 4.6)
|
||||||
- **Here is a video tutorial, thanks to @LawlyPopz for making it** :+1: http://pushzz.xyz/i/b7b63.mp4
|
|
||||||
- Start with making a folder, lets name it `Nadeko`
|
- Start with making a folder, lets name it `Nadeko`
|
||||||
- Make sure you have **7zip** installed, if not then head to http://www.7-zip.org/download.html and download/install it.
|
- Make sure you have **7zip** installed, if not then head to http://www.7-zip.org/download.html and download/install it.
|
||||||
- Now head to https://github.com/Kwoth/NadekoUpdater/releases/tag/v1.0 and download `WINDOWS.-.nadeupdater.7z`
|
- Now head to https://github.com/Kwoth/NadekoUpdater/releases/tag/v1.0 and download `WINDOWS.-.nadeupdater.7z`
|
||||||
@ -34,11 +33,14 @@ ________________________________________________________________________________
|
|||||||
|
|
||||||
#### Setting Up NadekoBot For Music
|
#### Setting Up NadekoBot For Music
|
||||||
###### Prerequisites:
|
###### Prerequisites:
|
||||||
1) FFMPEG, Static Build Version (See below) Google Account
|
1) Google Account
|
||||||
2) Soundcloud Account (if you want soundcloud support)
|
2) Soundcloud Account (if you want soundcloud support)
|
||||||
- Download FFMPEG through the link (https://ffmpeg.zeranoe.com/builds/).
|
- Create a folder named `ffmpeg` in your main Windows directory. We will use **C:\ffmpeg** (for our guide)
|
||||||
- Go to My Computer, right click and select Properties. On the left tab, select Advanced System Settings. Under the Advanced tab, select Environmental Variables near the bottom. One of the variables should be called "Path". Add a semi-colon (;) to the end followed by your FFMPEG's **bin** install location (**for example C:\\ffmpeg\\bin**). Save and close.
|
- Download FFMPEG through the link https://ffmpeg.zeranoe.com/builds/ (download static build)
|
||||||
- Go to console.developers.google.com and log in.
|
- Extract it using `7zip` and place the folder `ffmpeg-xxxxx-git-xxxxx-xxxx-static` inside **C:\ffmpeg**
|
||||||
|
- Before proceeding, check out this gif to set up `ffmpeg` PATH correctly http://i.imgur.com/aR5l1Hn.gif *(thanks to PooPeePants#7135)*
|
||||||
|
- Go to My Computer, right click and select Properties. On the left tab, select Advanced System Settings. Under the Advanced tab, select Environmental Variables near the bottom. One of the variables should be called "Path". Add a semi-colon (;) to the end followed by your FFMPEG's **bin** install location (**for example C:\ffmpeg\ffmpeg-xxxxx-git-xxxxx-xxxx-static\bin**). Save and close.
|
||||||
|
- Go to https://console.developers.google.com and log in.
|
||||||
- Create a new project (name does not matter). Once the project is created, go into "Enable and manage APIs."
|
- Create a new project (name does not matter). Once the project is created, go into "Enable and manage APIs."
|
||||||
- Under the "Other Popular APIs" section, enable "URL Shortener API". Under the "YouTube APIs" section, enable "YouTube Data API". Also enable Custom Search Api.
|
- Under the "Other Popular APIs" section, enable "URL Shortener API". Under the "YouTube APIs" section, enable "YouTube Data API". Also enable Custom Search Api.
|
||||||
- On the left tab, access Credentials. There will be a line saying "If you wish to skip this step and create an API key, client ID or service account." Click on API Key, and then Server Key in the new window that appears. Enter in a name for the server key. A new window will appear with your Google API key. Copy the key.
|
- On the left tab, access Credentials. There will be a line saying "If you wish to skip this step and create an API key, client ID or service account." Click on API Key, and then Server Key in the new window that appears. Enter in a name for the server key. A new window will appear with your Google API key. Copy the key.
|
||||||
|
@ -30,12 +30,14 @@ namespace NadekoBot.Modules.Administration
|
|||||||
commands.Add(new InfoCommands(this));
|
commands.Add(new InfoCommands(this));
|
||||||
commands.Add(new CustomReactionsCommands(this));
|
commands.Add(new CustomReactionsCommands(this));
|
||||||
commands.Add(new AutoAssignRole(this));
|
commands.Add(new AutoAssignRole(this));
|
||||||
|
commands.Add(new SelfCommands(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string Prefix { get; } = NadekoBot.Config.CommandPrefixes.Administration;
|
public override string Prefix { get; } = NadekoBot.Config.CommandPrefixes.Administration;
|
||||||
|
|
||||||
public override void Install(ModuleManager manager)
|
public override void Install(ModuleManager manager)
|
||||||
{
|
{
|
||||||
|
|
||||||
manager.CreateCommands("", cgb =>
|
manager.CreateCommands("", cgb =>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -32,8 +32,8 @@ namespace NadekoBot.Modules.Administration.Commands
|
|||||||
|
|
||||||
internal override void Init(CommandGroupBuilder cgb)
|
internal override void Init(CommandGroupBuilder cgb)
|
||||||
{
|
{
|
||||||
cgb.CreateCommand(Module.Prefix + "aar")
|
cgb.CreateCommand(Module.Prefix + "autoassignrole")
|
||||||
.Alias(Module.Prefix + "autoassignrole")
|
.Alias(Module.Prefix + "aar")
|
||||||
.Description($"Automaticaly assigns a specified role to every user who joins the server. Type `.aar` to disable, `.aar Role Name` to enable")
|
.Description($"Automaticaly assigns a specified role to every user who joins the server. Type `.aar` to disable, `.aar Role Name` to enable")
|
||||||
.Parameter("role", ParameterType.Unparsed)
|
.Parameter("role", ParameterType.Unparsed)
|
||||||
.AddCheck(new SimpleCheckers.ManageRoles())
|
.AddCheck(new SimpleCheckers.ManageRoles())
|
||||||
@ -42,6 +42,7 @@ namespace NadekoBot.Modules.Administration.Commands
|
|||||||
if (!e.Server.CurrentUser.ServerPermissions.ManageRoles)
|
if (!e.Server.CurrentUser.ServerPermissions.ManageRoles)
|
||||||
{
|
{
|
||||||
await e.Channel.SendMessage("I do not have the permission to manage roles.");
|
await e.Channel.SendMessage("I do not have the permission to manage roles.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
var r = e.GetArg("role")?.Trim();
|
var r = e.GetArg("role")?.Trim();
|
||||||
|
|
||||||
|
46
NadekoBot/Modules/Administration/Commands/SelfCommands.cs
Normal file
46
NadekoBot/Modules/Administration/Commands/SelfCommands.cs
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
using NadekoBot.Classes;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Discord.Commands;
|
||||||
|
using NadekoBot.Modules.Permissions.Classes;
|
||||||
|
|
||||||
|
namespace NadekoBot.Modules.Administration.Commands
|
||||||
|
{
|
||||||
|
class SelfCommands : DiscordCommand
|
||||||
|
{
|
||||||
|
public SelfCommands(DiscordModule module) : base(module)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal override void Init(CommandGroupBuilder cgb)
|
||||||
|
{
|
||||||
|
cgb.CreateCommand(Module.Prefix + "leave")
|
||||||
|
.Description("Makes Nadeko leave the server. Either name or id required.\n**Usage**:.leave NSFW")
|
||||||
|
.Parameter("arg", ParameterType.Required)
|
||||||
|
.AddCheck(SimpleCheckers.OwnerOnly())
|
||||||
|
.Do(async e =>
|
||||||
|
{
|
||||||
|
var arg = e.GetArg("arg")?.Trim();
|
||||||
|
var server = NadekoBot.Client.Servers.FirstOrDefault(s => s.Id.ToString() == arg) ??
|
||||||
|
NadekoBot.Client.FindServers(arg.Trim()).FirstOrDefault();
|
||||||
|
if (server == null)
|
||||||
|
{
|
||||||
|
await e.Channel.SendMessage("Cannot find that server").ConfigureAwait(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!server.IsOwner)
|
||||||
|
{
|
||||||
|
await server.Leave();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await server.Delete();
|
||||||
|
}
|
||||||
|
await NadekoBot.SendMessageToOwner("Left server " + server.Name);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -94,7 +94,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
});
|
});
|
||||||
|
|
||||||
cgb.CreateCommand(Prefix + "award")
|
cgb.CreateCommand(Prefix + "award")
|
||||||
.Description("Gives someone a certain amount of flowers. **Owner only!**")
|
.Description("Gives someone a certain amount of flowers. **Owner only!**\n**Usage**: `$award 100 @person`")
|
||||||
.AddCheck(SimpleCheckers.OwnerOnly())
|
.AddCheck(SimpleCheckers.OwnerOnly())
|
||||||
.Parameter("amount", ParameterType.Required)
|
.Parameter("amount", ParameterType.Required)
|
||||||
.Parameter("receiver", ParameterType.Unparsed)
|
.Parameter("receiver", ParameterType.Unparsed)
|
||||||
|
@ -252,7 +252,7 @@ namespace NadekoBot
|
|||||||
|
|
||||||
public static bool IsOwner(ulong id) => Creds.OwnerIds.Contains(id);
|
public static bool IsOwner(ulong id) => Creds.OwnerIds.Contains(id);
|
||||||
|
|
||||||
public async Task SendMessageToOwner(string message)
|
public static async Task SendMessageToOwner(string message)
|
||||||
{
|
{
|
||||||
if (Config.ForwardMessages && OwnerPrivateChannel != null)
|
if (Config.ForwardMessages && OwnerPrivateChannel != null)
|
||||||
await OwnerPrivateChannel.SendMessage(message).ConfigureAwait(false);
|
await OwnerPrivateChannel.SendMessage(message).ConfigureAwait(false);
|
||||||
|
@ -136,6 +136,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Modules\Administration\Commands\AutoAssignRole.cs" />
|
<Compile Include="Modules\Administration\Commands\AutoAssignRole.cs" />
|
||||||
<Compile Include="Modules\Administration\Commands\CustomReactionsCommands.cs" />
|
<Compile Include="Modules\Administration\Commands\CustomReactionsCommands.cs" />
|
||||||
|
<Compile Include="Modules\Administration\Commands\SelfCommands.cs" />
|
||||||
<Compile Include="Modules\ClashOfClans\ClashOfClans.cs" />
|
<Compile Include="Modules\ClashOfClans\ClashOfClans.cs" />
|
||||||
<Compile Include="Classes\DBHandler.cs" />
|
<Compile Include="Classes\DBHandler.cs" />
|
||||||
<Compile Include="Classes\FlowersHandler.cs" />
|
<Compile Include="Classes\FlowersHandler.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user