Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
7a73869a9f | |||
b1987be30c | |||
cdd5928028 | |||
55c4691933 | |||
cf2532af9a | |||
89a6adb389 | |||
b66ba51e0d | |||
f20ccd01f4 | |||
8842a86b30 | |||
0234df0844 | |||
68a92426c2 | |||
f5eaa4f335 | |||
7923c32323 | |||
cf5756e0a8 | |||
51f9ae9e3b | |||
eef5ad0c36 | |||
c3755055a1 | |||
494d8405b8 |
@ -56,13 +56,13 @@ Follow this Detailed [Guide](http://discord.kongslien.net/guide.html).
|
|||||||
|
|
||||||
###Question 12: I'm building NadekoBot from source, but I get hundreds of (namespace) errors without changing anything!?
|
###Question 12: I'm building NadekoBot from source, but I get hundreds of (namespace) errors without changing anything!?
|
||||||
-----
|
-----
|
||||||
**Answer:** Using Visual Studio, you can solve these errors by going to `Tools` -> `NuGet Package Manager` -> `Manage NuGet Packages for Solution`. Go to the Installed tab, select the Packages that were missing (usually `Newtonsoft.json` and `RestSharp`) and install them for all projects
|
**Answer:** Using Visual Studio, you can solve these errors by going to `Tools` -> `NuGet Package Manager` -> `Manage NuGet Packages for Solution`. Go to the Installed tab, select the Packages that were missing (usually `Newtonsoft.json` and `RestSharp`) and install them for all projects.
|
||||||
|
|
||||||
###Question 13: My bot has all permissions but it's still saying, "Failed to add roles. Bot has insufficient permissions". How do I fix this?
|
###Question 13: My bot has all permissions but it's still saying, "Failed to add roles. Bot has insufficient permissions". How do I fix this?
|
||||||
----------
|
----------
|
||||||
**Answer:** Discord has added few new features and the roles now follows the role hierarchy which means you need to place your bot's role above every-other role your server has to fix the role hierarchy issue. [Here's](https://support.discordapp.com/hc/en-us/articles/214836687-Role-Management-101) a link to Discords role management 101.
|
**Answer:** Discord has added a few new features and the roles now follow the role hierarchy, which means you need to place your bot's role above every other role on your server to fix the issue. [Here's](https://support.discordapp.com/hc/en-us/articles/214836687-Role-Management-101) a link to Discord's role management 101.
|
||||||
|
|
||||||
**Please Note:** *The bot can only set/add all roles below its own highest role. It can not assign it's "highest role" to anyone else.*
|
**Please Note:** *The bot can only set/add all roles below its own highest role. It cannot assign its "highest role" to anyone else.*
|
||||||
|
|
||||||
###Question 14: I've broken permissions and am stuck, can I reset permissions?
|
###Question 14: I've broken permissions and am stuck, can I reset permissions?
|
||||||
----------
|
----------
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
Permissions Overview
|
Permissions Overview
|
||||||
===================
|
===================
|
||||||
Have you ever felt confused or even overwhelmed when trying to set Nadeko's permissions? In this guide we will be explaining how to use the
|
Have you ever felt confused or even overwhelmed when trying to set Nadeko's permissions? In this guide we will be explaining how to use the
|
||||||
permission commands correctly and even cover a few common questions! Every command we discuss here can be found in the [Commands List](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#permissions).
|
permission commands correctly and even cover a few common questions! Every command we discuss here can be found in the [Commands List](http://nadekobot.readthedocs.io/en/latest/Commands%20List/#permissions).
|
||||||
|
|
||||||
**To see the old guide for versions 0.9 and below, see [here](http://nadekobot.readthedocs.io/en/latest/Permissions%20System/)**
|
**To see the guide, [click here](http://nadekobot.readthedocs.io/en/latest/Permissions%20System/)**
|
||||||
|
|
||||||
Why do we use the Permissions Commands?
|
Why do we use the Permissions Commands?
|
||||||
------------------------------
|
------------------------------
|
||||||
@ -15,11 +15,14 @@ With the permissions system it possible to restrict who can skip the current son
|
|||||||
|
|
||||||
First Time Setup
|
First Time Setup
|
||||||
------------------
|
------------------
|
||||||
To change permissions you **must** meet the following requirement:
|
To change permissions you **must** meet the following requirements:
|
||||||
|
|
||||||
**Have the role specified by `.permrole` (By default, this is Nadeko)**
|
**Be the owner of the server**
|
||||||
|
|
||||||
|
**If you are NOT the server owner, get the role specified by `.permrole` (By default, this is Nadeko)**
|
||||||
|
|
||||||
If you have an existing role called `Nadeko` but can't assign it to yourself, create a new role called `Nadeko` and assign that to yourself.
|
If you have an existing role called `Nadeko` but can't assign it to yourself, create a new role called `Nadeko` and assign that to yourself.
|
||||||
|

|
||||||
|
|
||||||
If you would like to set a different role, such as `Admins`, to be the role required to edit permissions, do `.permrole Admins` (you must have the current permission role to be able to do this).
|
If you would like to set a different role, such as `Admins`, to be the role required to edit permissions, do `.permrole Admins` (you must have the current permission role to be able to do this).
|
||||||
|
|
||||||
@ -35,7 +38,7 @@ To view this permissions chain, do `.listperms`, with the top of the chain being
|
|||||||
If you want to remove a permission from the chain of permissions, do `.removeperm X` to remove rule number X and similarly, do `.moveperm X Y` to move rule number X to number Y (moving, not swapping!).
|
If you want to remove a permission from the chain of permissions, do `.removeperm X` to remove rule number X and similarly, do `.moveperm X Y` to move rule number X to number Y (moving, not swapping!).
|
||||||
|
|
||||||
As an example, if you wanted to enable NSFW for a certain role, say "Lewd", you could do `.rolemdl NSFW enable Lewd`.
|
As an example, if you wanted to enable NSFW for a certain role, say "Lewd", you could do `.rolemdl NSFW enable Lewd`.
|
||||||
This adds the rule to the top of the permissions chain so even if the default `.sm NSFW disabled` rule exists, the "Lewd" role will be able to use the NSFW module.
|
This adds the rule to the top of the permissions chain so even if the default `.sm NSFW disable` rule exists, the "Lewd" role will be able to use the NSFW module.
|
||||||
|
|
||||||
If you want the bot to notify users why they can't use a command or module, use `.verbose true` and Nadeko will tell you what rule is preventing the command.
|
If you want the bot to notify users why they can't use a command or module, use `.verbose true` and Nadeko will tell you what rule is preventing the command.
|
||||||
|
|
||||||
|
@ -6,17 +6,17 @@ Prerequisites
|
|||||||
*Clone the repo*
|
*Clone the repo*
|
||||||
`git clone -b 1.4 https://github.com/Kwoth/NadekoBot`
|
`git clone -b 1.4 https://github.com/Kwoth/NadekoBot`
|
||||||
`cd NadekoBot/src/NadekoBot`
|
`cd NadekoBot/src/NadekoBot`
|
||||||
Edit `credentials.json.` Read the JSON Exaplanations guide on the left if you don't know how to set it up
|
Edit `credentials.json.` Read the [JSON Explanations](http://nadekobot.readthedocs.io/en/latest/JSON%20Explanations/) guide if you don't know how to set it up.
|
||||||
|
|
||||||
*run*
|
*run*
|
||||||
`dotnet restore`
|
`dotnet restore`
|
||||||
`dotnet run -c Release`
|
`dotnet run -c Release`
|
||||||
|
|
||||||
*when you decide to updatein the future (might not work if you've made custom edits to the source, make sure you know how git works)*
|
*when you decide to update in the future (might not work if you've made custom edits to the source, make sure you know how git works)*
|
||||||
`git pull`
|
`git pull`
|
||||||
`dotnet restore`
|
`dotnet restore`
|
||||||
`dotnet run -c Release`
|
`dotnet run -c Release`
|
||||||
|
|
||||||
[.netcore]: https://www.microsoft.com/net/download/core#/sdk
|
[.netcore]: https://www.microsoft.com/net/download/core#/sdk
|
||||||
[ffmpeg]: http://ffmpeg.zeranoe.com/builds/
|
[ffmpeg]: http://ffmpeg.zeranoe.com/builds/
|
||||||
[git]: https://git-scm.com/downloads
|
[git]: https://git-scm.com/downloads
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
#### If you have NadekoBot 1.x on Windows
|
#### If you have NadekoBot 1.x on Windows
|
||||||
|
|
||||||
- Go to `NadekoBot\src\NadekoBot` and backup your `credentials.json` file; then go to `NadekoBot\src\NadekoBot\bin\Release\netcoreapp1.0` and backup your `data` folder.
|
|
||||||
- Follow the [Windows Guide](http://nadekobot.readthedocs.io/en/latest/guides/Windows%20Guide/) and install the latest version of **NadekoBot**.
|
- Follow the [Windows Guide](http://nadekobot.readthedocs.io/en/latest/guides/Windows%20Guide/) and install the latest version of **NadekoBot**.
|
||||||
- Paste your `credentials.json` file into the `C:\Program Files\NadekoBot\system` folder.
|
- Navigate to your **old** `Nadeko` folder and copy your `credentials.json` file and the `data` folder.
|
||||||
- Paste your `data` folder into `C:\Program Files\NadekoBot\system` folder.
|
- Paste credentials into the **NadekoBot 1.4x+** `C:\Program Files\NadekoBot\system` folder.
|
||||||
|
- Paste your **old** `Nadeko` data folder into **NadekoBot 1.4x+** `C:\Program Files\NadekoBot\system` folder.
|
||||||
- If it asks you to overwrite files, it is fine to do so.
|
- If it asks you to overwrite files, it is fine to do so.
|
||||||
- Next launch your **new** Nadeko as the guide describes, if it is not already running.
|
- Next launch your **new** Nadeko as the guide describes, if it is not already running.
|
||||||
|
|
||||||
|
|
||||||
#### If you are running Dockerised Nadeko
|
#### If you are running Dockerised Nadeko
|
||||||
|
|
||||||
- Shutdown your existing container **docker stop nadeko**.
|
- Shutdown your existing container `docker stop nadeko`.
|
||||||
- Move you credentials and other files to another folder.
|
- Move you credentials and other files to another folder.
|
||||||
- Delete your container **docker rm nadeko**.
|
- Delete your container `docker rm nadeko`.
|
||||||
- Create a new container **docker create --name=nadeko -v /nadeko/:/root/nadeko uirel/nadeko:1.4**.
|
- Create a new container `docker create --name=nadeko -v /nadeko/:/root/nadeko uirel/nadeko:1.4`.
|
||||||
- Start the container **docker start nadeko** wait for it to complain about lacking credentials.
|
- Start the container with `docker start nadeko`, and wait for it to complain about lacking credentials.
|
||||||
- Stop the container **docker stop nadeko** open the nadeko folder and replace the credentials, database and other files with your copies.
|
- Stop the container, `docker stop nadeko`, open the `Nadeko` folder and replace the credentials, database and other files with your copies.
|
||||||
- Restart the container **docker start nadeko**.
|
- Restart the container `docker start nadeko`.
|
||||||
|
|
||||||
#### If you have NadekoBot 1.x on Linux or macOS
|
#### If you have NadekoBot 1.x on Linux or macOS
|
||||||
|
|
||||||
- Backup the `NadekoBot.db` from `NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.0/data`
|
- Backup the `NadekoBot.db` from `NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.0/data`.
|
||||||
- Backup the `credentials.json` from `NadekoBot/src/NadekoBot/`
|
- Backup the `credentials.json` from `NadekoBot/src/NadekoBot/`.
|
||||||
- **For MacOS Users Only:** download and install the latest version of [.NET Core SDK](https://www.microsoft.com/net/core#macos)
|
- **For MacOS Users Only:** download and install the latest version of [.NET Core SDK](https://www.microsoft.com/net/core#macos).
|
||||||
- Next, use the command `cd ~ && wget -N https://github.com/Kwoth/NadekoBot-BashScript/raw/1.4/linuxAIO.sh && bash linuxAIO.sh`
|
- Next, use the command `cd ~ && wget -N https://github.com/Kwoth/NadekoBot-BashScript/raw/1.4/linuxAIO.sh && bash linuxAIO.sh`
|
||||||
- **For Ubuntu, Debian and CentOS Users Only:** use the option `4. Auto-Install Prerequisites` to install the latest version of .NET Core SDK.
|
- **For Ubuntu, Debian and CentOS Users Only:** use the option `4. Auto-Install Prerequisites` to install the latest version of .NET Core SDK.
|
||||||
- Use option `1. Download NadekoBot` to update your NadekoBot to 1.4.x.
|
- Use option `1. Download NadekoBot` to update your NadekoBot to 1.4+ version.
|
||||||
- Next, just [run your NadekoBot.](http://nadekobot.readthedocs.io/en/latest/guides/Linux%20Guide/#running-nadekobot)
|
- Next, just [run your NadekoBot.](http://nadekobot.readthedocs.io/en/latest/guides/Linux%20Guide/#running-nadekobot)
|
||||||
- *NOTE: 1.4.x uses `NadekoBot.db` file from `NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data` folder.*
|
- *NOTE: 1.4+ version uses `NadekoBot.db` file from `NadekoBot/src/NadekoBot/bin/Release/netcoreapp1.1/data` folder.*
|
||||||
|
@ -43,16 +43,20 @@ namespace NadekoBot.Modules.Searches
|
|||||||
string response;
|
string response;
|
||||||
response = await _service.Http.GetStringAsync($"http://api.openweathermap.org/data/2.5/weather?q={query}&appid=42cd627dd60debf25a5739e50a217d74&units=metric").ConfigureAwait(false);
|
response = await _service.Http.GetStringAsync($"http://api.openweathermap.org/data/2.5/weather?q={query}&appid=42cd627dd60debf25a5739e50a217d74&units=metric").ConfigureAwait(false);
|
||||||
|
|
||||||
|
string responsef;
|
||||||
|
responsef = await _service.Http.GetStringAsync($"http://api.openweathermap.org/data/2.5/weather?q={query}&appid=42cd627dd60debf25a5739e50a217d74&units=imperial").ConfigureAwait(false);
|
||||||
|
|
||||||
var data = JsonConvert.DeserializeObject<WeatherData>(response);
|
var data = JsonConvert.DeserializeObject<WeatherData>(response);
|
||||||
|
var dataf = JsonConvert.DeserializeObject<WeatherData>(responsef);
|
||||||
|
|
||||||
var embed = new EmbedBuilder()
|
var embed = new EmbedBuilder()
|
||||||
.AddField(fb => fb.WithName("🌍 " + Format.Bold(GetText("location"))).WithValue($"[{data.Name + ", " + data.Sys.Country}](https://openweathermap.org/city/{data.Id})").WithIsInline(true))
|
.AddField(fb => fb.WithName("🌍 " + Format.Bold(GetText("location"))).WithValue($"[{data.Name + ", " + data.Sys.Country}](https://openweathermap.org/city/{data.Id})").WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName("📏 " + Format.Bold(GetText("latlong"))).WithValue($"{data.Coord.Lat}, {data.Coord.Lon}").WithIsInline(true))
|
.AddField(fb => fb.WithName("📏 " + Format.Bold(GetText("latlong"))).WithValue($"{data.Coord.Lat}, {data.Coord.Lon}").WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName("☁ " + Format.Bold(GetText("condition"))).WithValue(string.Join(", ", data.Weather.Select(w => w.Main))).WithIsInline(true))
|
.AddField(fb => fb.WithName("☁ " + Format.Bold(GetText("condition"))).WithValue(string.Join(", ", data.Weather.Select(w => w.Main))).WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName("😓 " + Format.Bold(GetText("humidity"))).WithValue($"{data.Main.Humidity}%").WithIsInline(true))
|
.AddField(fb => fb.WithName("😓 " + Format.Bold(GetText("humidity"))).WithValue($"{data.Main.Humidity}%").WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName("💨 " + Format.Bold(GetText("wind_speed"))).WithValue(data.Wind.Speed + " m/s").WithIsInline(true))
|
.AddField(fb => fb.WithName("💨 " + Format.Bold(GetText("wind_speed"))).WithValue(data.Wind.Speed + " m/s" + " / " + dataf.Wind.Speed + " mph").WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName("🌡 " + Format.Bold(GetText("temperature"))).WithValue(data.Main.Temp + "°C").WithIsInline(true))
|
.AddField(fb => fb.WithName("🌡 " + Format.Bold(GetText("temperature"))).WithValue(data.Main.Temp + "°C" + " / " + dataf.Main.Temp + "°F").WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName("🔆 " + Format.Bold(GetText("min_max"))).WithValue($"{data.Main.TempMin}°C - {data.Main.TempMax}°C").WithIsInline(true))
|
.AddField(fb => fb.WithName("🔆 " + Format.Bold(GetText("min_max"))).WithValue($"{data.Main.TempMin}°C - {data.Main.TempMax}°C" + "\n" + $"{dataf.Main.TempMin}°F - {dataf.Main.TempMax}°F").WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName("🌄 " + Format.Bold(GetText("sunrise"))).WithValue($"{data.Sys.Sunrise.ToUnixTimestamp():HH:mm} UTC").WithIsInline(true))
|
.AddField(fb => fb.WithName("🌄 " + Format.Bold(GetText("sunrise"))).WithValue($"{data.Sys.Sunrise.ToUnixTimestamp():HH:mm} UTC").WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName("🌇 " + Format.Bold(GetText("sunset"))).WithValue($"{data.Sys.Sunset.ToUnixTimestamp():HH:mm} UTC").WithIsInline(true))
|
.AddField(fb => fb.WithName("🌇 " + Format.Bold(GetText("sunset"))).WithValue($"{data.Sys.Sunset.ToUnixTimestamp():HH:mm} UTC").WithIsInline(true))
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
|
Reference in New Issue
Block a user