This commit is contained in:
Kwoth 2016-11-25 13:14:52 +01:00
commit bf72a6c35d
7 changed files with 189 additions and 120 deletions

View File

@ -6,6 +6,8 @@ If you want Nadeko to play music for you 24/7 without having to hosting it on yo
####Setting up NadekoBot ####Setting up NadekoBot
Assuming you have followed the link above to setup an account and Droplet with 64bit OS in Digital Ocean and got the `IP address and root password (in email)` to login, its time to get started. Assuming you have followed the link above to setup an account and Droplet with 64bit OS in Digital Ocean and got the `IP address and root password (in email)` to login, its time to get started.
**Go through this whole guide before setting up Nadeko**
#### Prerequisites #### Prerequisites
- Download [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) - Download [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
- Download [CyberDuck](https://cyberduck.io) or [WinSCP](https://winscp.net/eng/download.php) - Download [CyberDuck](https://cyberduck.io) or [WinSCP](https://winscp.net/eng/download.php)
@ -24,41 +26,39 @@ If you entered your Droplets IP address correctly, it should show **login as:**
####Installing Git ####Installing Git
![img1](https://cdn.discordapp.com/attachments/251504306010849280/251504416019054592/git.gif)
`sudo apt-get install git -y` `sudo apt-get install git -y`
**NOTE:** If the command is not being initiated, hit **Enter** **NOTE:** If the command is not being initiated, hit **Enter**
####Installing .NET Core SDK ####Installing .NET Core SDK
![img2](https://cdn.discordapp.com/attachments/251504306010849280/251504746987388938/dotnet.gif)
Go to [this link](https://www.microsoft.com/net/core#ubuntu) provided by microsoft for instructions on how to get the most up to date version of the dotnet core sdk! Go to [this link](https://www.microsoft.com/net/core#ubuntu) provided by microsoft for instructions on how to get the most up to date version of the dotnet core sdk!
Make sure that you're on the correct page for your distribution of linux as the guides are different for the various distributions Make sure that you're on the correct page for your distribution of linux as the guides are different for the various distributions
We'll go over the steps here for Ubuntu 16.04 anyway (these will **only** work on Ubuntu 16.04), accurate as of 16/10/2016 We'll go over the steps here for Ubuntu 16.04 anyway (these will **only** work on Ubuntu 16.04), accurate as of 25/11/2016
``` ```
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list' sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
sudo apt-get update && sudo apt-get install dotnet-dev-1.0.0-preview2-003131 -y sudo apt-get update && sudo apt-get install dotnet-dev-1.0.0-preview2.1-003177 -y
``` ```
**NOTE:** **NOTE:** .NET CORE SDK only supports 64-bit Linux Operating Systems (Raspberry Pis are not supported because of this)
.NET CORE SDK only supports 64-bit Linux Operating Systems (Raspberry Pis are not supported because of this)
If you are running Ubuntu 16.10, follow these instructions before installing .NET Core:
- Go to [Download Page for libicu55_55.1-7_amd64.deb](http://packages.ubuntu.com/en/xenial/amd64/libicu55/download)
- Copy the link with a download option closest to you
- `wget <copied link>` (make sure it is downloaded) *e.g.* `wget http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb`
- Install with: `dpkg i libicu55_55.1-7_amd64.deb`
- Now go back and install the .NET Core
####Installing Opus Voice Codec and libsodium ####Installing Opus Voice Codec and libsodium
![img3](https://cdn.discordapp.com/attachments/251504306010849280/251505294654308353/libopus.gif)
`sudo apt-get install libopus0 opus-tools libopus-dev libsodium-dev -y` `sudo apt-get install libopus0 opus-tools libopus-dev libsodium-dev -y`
####Installing FFMPEG ####Installing FFMPEG
![img4](https://cdn.discordapp.com/attachments/251504306010849280/251505443111829505/ffmpeg.gif)
`apt-get install ffmpeg -y` `apt-get install ffmpeg -y`
**NOTE:** If you are running **UBUNTU 14.04**, you must run these first: **NOTE:** If you are running **UBUNTU 14.04**, you must run these first:
@ -86,13 +86,17 @@ sudo apt-get update && sudo apt-get install ffmpeg -y
####Installing TMUX ####Installing TMUX
![img5](https://cdn.discordapp.com/attachments/251504306010849280/251505519758409728/tmux.gif)
`sudo apt-get install tmux -y` `sudo apt-get install tmux -y`
####Getting NadekoBot ####Getting NadekoBot
![img6](https://cdn.discordapp.com/attachments/251504306010849280/251505587089571850/getting_nadeko.gif)
`cd ~ && curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh` `cd ~ && curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh`
####Setting up and Inviting bot ####Creating and Inviting bot
- Read here how to [create a DiscordBot application](http://nadekobot.readthedocs.io/en/1.0/guides/Windows%20Guide/#creating-discordbot-application) - Read here how to [create a DiscordBot application](http://nadekobot.readthedocs.io/en/1.0/guides/Windows%20Guide/#creating-discordbot-application)
- [Visual Invite Guide](http://discord.kongslien.net/guide.html) *NOTE: Client ID is your Bot ID* - [Visual Invite Guide](http://discord.kongslien.net/guide.html) *NOTE: Client ID is your Bot ID*
@ -102,7 +106,24 @@ sudo apt-get update && sudo apt-get install ffmpeg -y
- Go to the newly created link and pick the server we created, and click `Authorize`. - Go to the newly created link and pick the server we created, and click `Authorize`.
- The bot should have been added to your server. - The bot should have been added to your server.
####Setting up NadekoBot ####Guide for Advance Users
**Skip this step if you are a Regular User or New to Linux.**
[![img7][img7]](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#getting-nadekobot)
- Right after [Getting NadekoBot](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#getting-nadekobot)
- `cd NadekoBot/src/NadekoBot/` (go to this folder)
- `pico credentials.json` (open credentials.json to edit)
- Insert your bot's **Client ID, Bot ID** (should be same as your Client ID) **and Token** if you got it following [Creating and Inviting bot](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#creating-and-inviting-bot).
- Insert your own ID in Owners ID follow: [Setting up credentials.json](http://nadekobot.readthedocs.io/en/1.0/guides/Windows%20Guide/#setting-up-credentialsjson-file)
- And Google API from [Setting up NadekoBot for Music](http://nadekobot.readthedocs.io/en/1.0/guides/Windows%20Guide/#setting-up-nadekobot-for-music)
- Once done, press `CTRL+X`
- It will ask for "Save Modified Buffer?", press `Y` for yes
- It will then ask "File Name to Write" (rename), just hit `Enter` and Done.
- You can now move to [Running NadekoBot](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#running-nadekobot)
####Setting up SFTP
- Open **CyberDuck** - Open **CyberDuck**
- Click on **Open Connection** (top-left corner), a new window should appear. - Click on **Open Connection** (top-left corner), a new window should appear.
@ -131,30 +152,65 @@ Once done, go back to **PuTTY**
####Running NadekoBot ####Running NadekoBot
![img8](https://cdn.discordapp.com/attachments/251504306010849280/251506149973557259/running_nadeko.gif)
**Create a new Session:**
- `tmux new -s nadeko` - `tmux new -s nadeko`
That command will create a new session named **nadeko** *(you can replace “nadeko” with anything you prefer and remember its your session name)* so you can run the bot in background without having to keep running the PuTTY. That command will create a new session named **nadeko** *(you can replace “nadeko” with anything you prefer and remember its your session name)* so you can run the bot in background without having to keep running the PuTTY.
- `cd NadekoBot/src/NadekoBot/` - `cd NadekoBot/src/NadekoBot/`
**Without Auto Restart:**
- `dotnet run --configuration Release` - `dotnet run --configuration Release`
**With Auto Restart:**
- `while :; do dotnet run -c Release; sleep 5s; done`
**NOTE:** With Auto Restart, bot will auto run if you use `.die` [command](http://nadekobot.readthedocs.io/en/1.0/Commands%20List/#administration) so you do not have to manual restart if you ever want to.
See how that happens below:
![img9](https://cdn.discordapp.com/attachments/251504306010849280/251506312893038592/die_explaination.gif)
**Now check your Discord, the bot should be online** **Now check your Discord, the bot should be online**
Now time to **move the bot to background** and to do that, press **CTRL+B+D** (this will detach the nadeko session using TMUX), and you can finally close PuTTY now. Now time to **move the bot to background** and to do that, press **CTRL+B+D** (this will detach the nadeko session using TMUX), and you can finally close PuTTY now.
####Some more Info (just in case) ####Some more Info (just in case)
**Info about tmux:**
- If you want to **see the sessions** after logging back again, type `tmux ls`, and that will give you the list of sessions running. - If you want to **see the sessions** after logging back again, type `tmux ls`, and that will give you the list of sessions running.
- If you want to **switch to/ see that session**, type `tmux a -t nadeko` (**nadeko** is the name of the session we created before so, replace **“nadeko”** with the session name you created.) - If you want to **switch to/ see that session**, type `tmux a -t nadeko` (**nadeko** is the name of the session we created before so, replace **“nadeko”** with the session name you created.)
- If you want to **kill** NadekoBot **session**, type `tmux kill-session -t nadeko` - If you want to **kill** NadekoBot **session**, type `tmux kill-session -t nadeko`
####Restarting Nadeko with the Server **If you are running Ubuntu 16.10, and having trouble installing .NET Core:**
- Go to [Download Page for libicu55_55.1-7_amd64.deb](http://packages.ubuntu.com/en/xenial/amd64/libicu55/download)
- Copy the link with a download option closest to you
- `wget <copied link>` *e.g.* `wget http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu55_55.1-7_amd64.deb` (make sure it is downloaded)
- Install with: `dpkg i libicu55_55.1-7_amd64.deb`
- Now go back and install the .NET Core
####Restarting Nadeko
**Restarting Nadeko with the Server:**
Open **PuTTY** and login as you have before, type `reboot` and hit Enter. Open **PuTTY** and login as you have before, type `reboot` and hit Enter.
**Restarting Manually:**
- Kill your previous session, check with `tmux ls`
- `tmux kill-session -t nadeko` (don't forget to replace "nadeko" to what ever you named your bot's session)
- Follow: [Running NadekoBot](http://nadekobot.readthedocs.io/en/1.0/guides/Linux%20Guide/#running-nadekobot)
####Updating Nadeko ####Updating Nadeko
- Make sure the bot is **not** running
- Connect to the terminal - Connect to the terminal
- Make sure the bot is **not** running.
- `cd ~ && curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh` (The same command used to install earlier) - `cd ~ && curl -L https://github.com/Kwoth/NadekoBot-BashScript/raw/master/nadeko_installer.sh | sh` (The same command used to install earlier)
- Run the bot again as normal. - Run the bot again as normal.
@ -173,3 +229,4 @@ cd ~/NadekoBot/discord.net/src/Discord.Net && dotnet restore && cd ../Discord.Ne
cd ~/NadekoBot/discord.net && dotnet restore -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json && dotnet restore cd ~/NadekoBot/discord.net && dotnet restore -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json && dotnet restore
cd ~/NadekoBot/src/NadekoBot/ && dotnet restore && dotnet build --configuration Release cd ~/NadekoBot/src/NadekoBot/ && dotnet restore && dotnet build --configuration Release
``` ```
[img7]: https://cdn.discordapp.com/attachments/251504306010849280/251505766370902016/setting_up_credentials.gif

View File

@ -294,7 +294,7 @@ namespace NadekoBot.Modules.Administration
try try
{ {
await (await user.CreateDMChannelAsync()).SendMessageAsync($"⛔️ **You have been BANNED from `{channel.Guild.Name}` server.**\n" + await (await user.CreateDMChannelAsync()).SendMessageAsync($"⛔️ **You have been BANNED from `{channel.Guild.Name}` server.**\n" +
$"Reason: {msg}").ConfigureAwait(false); $"⚖ *Reason:* {msg}").ConfigureAwait(false);
await Task.Delay(2000).ConfigureAwait(false); await Task.Delay(2000).ConfigureAwait(false);
} }
catch { } catch { }
@ -302,7 +302,7 @@ namespace NadekoBot.Modules.Administration
{ {
await channel.Guild.AddBanAsync(user, 7).ConfigureAwait(false); await channel.Guild.AddBanAsync(user, 7).ConfigureAwait(false);
await channel.SendMessageAsync("⛔️ **Banned** user **" + user.Username + "** ID: " + user.Id).ConfigureAwait(false); await channel.SendMessageAsync("⛔️ **Banned** user **" + user.Username + "** ID: `" + user.Id + "`").ConfigureAwait(false);
} }
catch catch
{ {
@ -329,7 +329,7 @@ namespace NadekoBot.Modules.Administration
try try
{ {
await user.SendMessageAsync($"☣ **You have been SOFT-BANNED from `{channel.Guild.Name}` server.**\n" + await user.SendMessageAsync($"☣ **You have been SOFT-BANNED from `{channel.Guild.Name}` server.**\n" +
$"Reason: {msg}").ConfigureAwait(false); $"⚖ *Reason:* {msg}").ConfigureAwait(false);
await Task.Delay(2000).ConfigureAwait(false); await Task.Delay(2000).ConfigureAwait(false);
} }
catch { } catch { }
@ -339,7 +339,7 @@ namespace NadekoBot.Modules.Administration
try { await channel.Guild.RemoveBanAsync(user).ConfigureAwait(false); } try { await channel.Guild.RemoveBanAsync(user).ConfigureAwait(false); }
catch { await channel.Guild.RemoveBanAsync(user).ConfigureAwait(false); } catch { await channel.Guild.RemoveBanAsync(user).ConfigureAwait(false); }
await channel.SendMessageAsync("☣ **Soft-Banned** user **" + user.Username + "** ID: " + user.Id).ConfigureAwait(false); await channel.SendMessageAsync("☣ **Soft-Banned** user **" + user.Username + "** ID: `" + user.Id + "`").ConfigureAwait(false);
} }
catch catch
{ {
@ -370,7 +370,7 @@ namespace NadekoBot.Modules.Administration
try try
{ {
await user.SendMessageAsync($"‼️**You have been KICKED from `{channel.Guild.Name}` server.**\n" + await user.SendMessageAsync($"‼️**You have been KICKED from `{channel.Guild.Name}` server.**\n" +
$"Reason: {msg}").ConfigureAwait(false); $"⚖ *Reason:* {msg}").ConfigureAwait(false);
await Task.Delay(2000).ConfigureAwait(false); await Task.Delay(2000).ConfigureAwait(false);
} }
catch { } catch { }
@ -378,7 +378,7 @@ namespace NadekoBot.Modules.Administration
try try
{ {
await user.KickAsync().ConfigureAwait(false); await user.KickAsync().ConfigureAwait(false);
await channel.SendMessageAsync("‼️**Kicked** user **" + user.Username + "** ID: " + user.Id).ConfigureAwait(false); await channel.SendMessageAsync("‼️**Kicked** user **" + user.Username + "** ID: `" + user.Id + "`").ConfigureAwait(false);
} }
catch catch
{ {
@ -587,7 +587,7 @@ namespace NadekoBot.Modules.Administration
{ {
var channel = (ITextChannel)umsg.Channel; var channel = (ITextChannel)umsg.Channel;
var ch = await channel.Guild.CreateVoiceChannelAsync(channelName).ConfigureAwait(false); var ch = await channel.Guild.CreateVoiceChannelAsync(channelName).ConfigureAwait(false);
await channel.SendMessageAsync($"✅ Created voice channel **{ch.Name}**, ID: {ch.Id}.").ConfigureAwait(false); await channel.SendMessageAsync($"✅ Created voice channel **{ch.Name}**. ID: `{ch.Id}`").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -596,7 +596,7 @@ namespace NadekoBot.Modules.Administration
public async Task DelTxtChanl(IUserMessage umsg, [Remainder] ITextChannel toDelete) public async Task DelTxtChanl(IUserMessage umsg, [Remainder] ITextChannel toDelete)
{ {
await toDelete.DeleteAsync().ConfigureAwait(false); await toDelete.DeleteAsync().ConfigureAwait(false);
await umsg.Channel.SendMessageAsync($"🗑 Removed text channel **{toDelete.Name}**, ID: {toDelete.Id}.").ConfigureAwait(false); await umsg.Channel.SendMessageAsync($"🗑 Removed text channel **{toDelete.Name}**. ID: `{toDelete.Id}`").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -606,7 +606,7 @@ namespace NadekoBot.Modules.Administration
{ {
var channel = (ITextChannel)umsg.Channel; var channel = (ITextChannel)umsg.Channel;
var txtCh = await channel.Guild.CreateTextChannelAsync(channelName).ConfigureAwait(false); var txtCh = await channel.Guild.CreateTextChannelAsync(channelName).ConfigureAwait(false);
await channel.SendMessageAsync($"✅ Added text channel **{txtCh.Name}**, ID: {txtCh.Id}.").ConfigureAwait(false); await channel.SendMessageAsync($"✅ Added text channel **{txtCh.Name}**. ID: `{txtCh.Id}`").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -805,7 +805,7 @@ namespace NadekoBot.Modules.Administration
g.GetDefaultChannelAsync() g.GetDefaultChannelAsync()
)).ConfigureAwait(false); )).ConfigureAwait(false);
await Task.WhenAll(channels.Select(c => c.SendMessageAsync($"🆕 **Message from {umsg.Author} (Bot Owner):** " + message))) await Task.WhenAll(channels.Select(c => c.SendMessageAsync($"🆕 **Message from {umsg.Author} `(Bot Owner)`:** " + message)))
.ConfigureAwait(false); .ConfigureAwait(false);
await channel.SendMessageAsync("🆗").ConfigureAwait(false); await channel.SendMessageAsync("🆗").ConfigureAwait(false);
@ -851,10 +851,10 @@ namespace NadekoBot.Modules.Administration
{ {
var channel = (ITextChannel)umsg.Channel; var channel = (ITextChannel)umsg.Channel;
string send = $"❕{umsg.Author.Mention} has invoked a mention on the following roles❕"; string send = $"❕{umsg.Author.Mention} __`has invoked a mention on the following roles`__❕";
foreach (var role in roles) foreach (var role in roles)
{ {
send += $"\n`{role.Name}`\n"; send += $"\n**{role.Name}**\n";
send += string.Join(", ", (await channel.Guild.GetUsersAsync()).Where(u => u.Roles.Contains(role)).Distinct().Select(u=>u.Mention)); send += string.Join(", ", (await channel.Guild.GetUsersAsync()).Where(u => u.Roles.Contains(role)).Distinct().Select(u=>u.Mention));
} }

View File

@ -96,17 +96,21 @@ namespace NadekoBot.Modules.Administration
var punishment = ""; var punishment = "";
if (action == PunishmentAction.Mute) if (action == PunishmentAction.Mute)
{ {
punishment = "MUTED"; punishment = "🔇 MUTED";
//punishment = "MUTED";
} }
else if (action == PunishmentAction.Kick) else if (action == PunishmentAction.Kick)
{ {
punishment = "KICKED"; punishment = "☣ SOFT-BANNED (KICKED)";
//punishment = "KICKED";
} }
else if (action == PunishmentAction.Ban) else if (action == PunishmentAction.Ban)
{ {
punishment = "BANNED"; punishment = "⛔️ BANNED";
//punishment = "BANNED";
} }
await logChannel.SendMessageAsync(String.Join("\n",users.Select(user=>$"{Format.Bold(user.ToString())} was **{punishment}** due to `{protection}` protection on **{user.Guild.Name}** server."))) await logChannel.SendMessageAsync(String.Join("\n",users.Select(user=>$"‼️ {Format.Bold(user.ToString())} got **{punishment}** due to __**{protection}**__ protection on **{user.Guild.Name}** server.")))
//await logChannel.SendMessageAsync(String.Join("\n",users.Select(user=>$"{Format.Bold(user.ToString())} was **{punishment}** due to `{protection}` protection on **{user.Guild.Name}** server.")))
.ConfigureAwait(false); .ConfigureAwait(false);
} }
@ -128,22 +132,27 @@ namespace NadekoBot.Modules.Administration
{ {
string str = $"🕔`{prettyCurrentTime}`"; string str = $"🕔`{prettyCurrentTime}`";
if (before.Username != after.Username) if (before.Username != after.Username)
str += $"**Name Changed**👤`{before.Username}#{before.Discriminator}`\n\t\t`New:`{after.ToString()}`"; //str += $"**Name Changed**`{before.Username}#{before.Discriminator}`\n\t\t`New:`{after.ToString()}`";
str += $"👤__**{before.Username}#{before.Discriminator}**__ **| Name Changed |** 🆔 `{before.Id}`\n\t\t`New:` **{after.ToString()}**";
else if (before.Nickname != after.Nickname) else if (before.Nickname != after.Nickname)
str += $"**Nickname Changed**👤`{before.Username}#{before.Discriminator}`\n\t\t`Old:` {before.Nickname}#{before.Discriminator}\n\t\t`New:` {after.Nickname}#{after.Discriminator}"; str += $"👤__**{before.Username}#{before.Discriminator}**__ **| Nickname Changed |** 🆔 `{before.Id}`\n\t\t`Old:` **{before.Nickname}#{before.Discriminator}**\n\t\t`New:` **{after.Nickname}#{after.Discriminator}**";
//str += $"**Nickname Changed**`{before.Username}#{before.Discriminator}`\n\t\t`Old:` {before.Nickname}#{before.Discriminator}\n\t\t`New:` {after.Nickname}#{after.Discriminator}";
else if (before.AvatarUrl != after.AvatarUrl) else if (before.AvatarUrl != after.AvatarUrl)
str += $"**Avatar Changed**👤`{before.Username}#{before.Discriminator}`\n\t {await _google.ShortenUrl(before.AvatarUrl)} `=>` {await _google.ShortenUrl(after.AvatarUrl)}"; //str += $"**Avatar Changed**👤`{before.Username}#{before.Discriminator}`\n\t {await _google.ShortenUrl(before.AvatarUrl)} `=>` {await _google.ShortenUrl(after.AvatarUrl)}";
str += $"👤__**{before.Username}#{before.Discriminator}**__ **| Avatar Changed |** 🆔 `{before.Id}`\n\t🖼 {await _google.ShortenUrl(before.AvatarUrl)} `=>` {await _google.ShortenUrl(after.AvatarUrl)}";
else if (!before.Roles.SequenceEqual(after.Roles)) else if (!before.Roles.SequenceEqual(after.Roles))
{ {
if (before.Roles.Count() < after.Roles.Count()) if (before.Roles.Count() < after.Roles.Count())
{ {
var diffRoles = after.Roles.Where(r => !before.Roles.Contains(r)).Select(r => "`" + r.Name + "`"); var diffRoles = after.Roles.Where(r => !before.Roles.Contains(r)).Select(r => "**" + r.Name + "**");
str += $"**User's Roles changed ⚔➕**👤`{before.ToString()}`\n\tNow has {string.Join(", ", diffRoles)} role."; //str += $"**User's Roles changed ⚔➕**👤`{before.ToString()}`\n\tNow has {string.Join(", ", diffRoles)} role.";
str += $"👤__**{before.ToString()}**__ **| User's Role Added |** 🆔 `{before.Id}`\n\t✅ {string.Join(", ", diffRoles)}\n\t\t⚔ **`{string.Join(", ", after.Roles.Select(r => r.Name)).SanitizeMentions()}`** ⚔";
} }
else if (before.Roles.Count() > after.Roles.Count()) else if (before.Roles.Count() > after.Roles.Count())
{ {
var diffRoles = before.Roles.Where(r => !after.Roles.Contains(r)).Select(r => "`" + r.Name + "`"); var diffRoles = before.Roles.Where(r => !after.Roles.Contains(r)).Select(r => "**" + r.Name + "**");
str += $"**User's Roles changed ⚔➖**👤`{before.ToString()}`\n\tNo longer has {string.Join(", ", diffRoles)} role."; //str += $"**User's Roles changed **`{before.ToString()}`\n\tNo longer has {string.Join(", ", diffRoles)} role.";
str += $"👤__**{before.ToString()}**__ **| User's Role Removed |** 🆔 `{before.Id}`\n\t🚮 {string.Join(", ", diffRoles)}\n\t\t⚔ **`{string.Join(", ", after.Roles.Select(r => r.Name)).SanitizeMentions()}`** ⚔";
} }
} }
else else
@ -179,13 +188,15 @@ namespace NadekoBot.Modules.Administration
try try
{ {
if (before.Name != after.Name) if (before.Name != after.Name)
await logChannel.SendMessageAsync($@"`{prettyCurrentTime}` **Channel Name Changed** `#{after.Name}` ({after.Id}) //await logChannel.SendMessageAsync($@"`{prettyCurrentTime}` **Channel Name Changed** `#{after.Name}` ({after.Id})
await logChannel.SendMessageAsync($@"🕓`{prettyCurrentTime}` **| Channel Name Changed |** #⃣ `{after.Name} ({after.Id})`
`Old:` {before.Name} `Old:` {before.Name}
`New:` {after.Name}").ConfigureAwait(false); **`New:`** {after.Name}").ConfigureAwait(false);
else if ((before as ITextChannel).Topic != (after as ITextChannel).Topic) else if ((before as ITextChannel).Topic != (after as ITextChannel).Topic)
await logChannel.SendMessageAsync($@"`{prettyCurrentTime}` **Channel Topic Changed** `#{after.Name}` ({after.Id}) //await logChannel.SendMessageAsync($@"`{prettyCurrentTime}` **Channel Topic Changed** `#{after.Name}` ({after.Id})
await logChannel.SendMessageAsync($@"🕘`{prettyCurrentTime}` **| Channel Topic Changed |** #⃣ `{after.Name} ({after.Id})`
`Old:` {((ITextChannel)before).Topic} `Old:` {((ITextChannel)before).Topic}
`New:` {((ITextChannel)after).Topic}").ConfigureAwait(false); **`New:`** {((ITextChannel)after).Topic}").ConfigureAwait(false);
} }
catch { } catch { }
}); });
@ -212,7 +223,7 @@ namespace NadekoBot.Modules.Administration
var task = Task.Run(async () => var task = Task.Run(async () =>
{ {
try { await logChannel.SendMessageAsync($"❗`{prettyCurrentTime}` `{(ch is IVoiceChannel ? "Voice" : "Text")} Channel Deleted:` **#{ch.Name}** ({ch.Id})").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } try { await logChannel.SendMessageAsync($"🕕`{prettyCurrentTime}`🗑 **| {(ch is IVoiceChannel ? "Voice" : "Text")} Channel Deleted #{ch.Name}** `({ch.Id})`").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); }
}); });
return Task.CompletedTask; return Task.CompletedTask;
@ -236,7 +247,7 @@ namespace NadekoBot.Modules.Administration
var task = Task.Run(async () => var task = Task.Run(async () =>
{ {
try { await logChannel.SendMessageAsync($"`{prettyCurrentTime}`🆕`{(ch is IVoiceChannel ? "Voice" : "Text")} Channel Created:` **#{ch.Name}** ({ch.Id})").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } try { await logChannel.SendMessageAsync($"🕓`{prettyCurrentTime}`🆕 **| {(ch is IVoiceChannel ? "Voice" : "Text")} Channel Created: #{ch.Name}** `({ch.Id})`").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); }
}); });
return Task.CompletedTask; return Task.CompletedTask;
@ -266,15 +277,15 @@ namespace NadekoBot.Modules.Administration
string str = null; string str = null;
if (beforeVch?.Guild == afterVch?.Guild) if (beforeVch?.Guild == afterVch?.Guild)
{ {
str = $"🎼`{prettyCurrentTime}` {usr.Username} moved from **{beforeVch.Name}** to **{afterVch.Name}** voice channel."; str = $"🎙`{prettyCurrentTime}`👤__**{usr.Username}#{usr.Discriminator}**__ moved from **{beforeVch.Name}** to **{afterVch.Name}** voice channel.";
} }
else if (beforeVch == null) else if (beforeVch == null)
{ {
str = $"🎼`{prettyCurrentTime}` {usr.Username} has joined **{afterVch.Name}** voice channel."; str = $"🎙`{prettyCurrentTime}`👤__**{usr.Username}#{usr.Discriminator}**__ has joined **{afterVch.Name}** voice channel.";
} }
else if (afterVch == null) else if (afterVch == null)
{ {
str = $"🎼`{prettyCurrentTime}` {usr.Username} has left **{beforeVch.Name}** voice channel."; str = $"🎙`{prettyCurrentTime}`👤__**{usr.Username}#{usr.Discriminator}**__ has left **{beforeVch.Name}** voice channel.";
} }
if(str != null) if(str != null)
UserPresenceUpdates.AddOrUpdate(logChannel, new List<string>() { str }, (id, list) => { list.Add(str); return list; }); UserPresenceUpdates.AddOrUpdate(logChannel, new List<string>() { str }, (id, list) => { list.Add(str); return list; });
@ -295,9 +306,9 @@ namespace NadekoBot.Modules.Administration
return Task.CompletedTask; return Task.CompletedTask;
string str; string str;
if (before.Status != after.Status) if (before.Status != after.Status)
str = $"`{prettyCurrentTime}`**{usr.Username}** is now **{after.Status}**."; str = $"🔵`{prettyCurrentTime}`👤__**{usr.Username}**__ is now **{after.Status}**.";
else else
str = $"`{prettyCurrentTime}`**{usr.Username}** is now playing **{after.Game}**."; str = $"👾`{prettyCurrentTime}`👤__**{usr.Username}**__ is now playing **{after.Game}**.";
UserPresenceUpdates.AddOrUpdate(logChannel, new List<string>() { str }, (id, list) => { list.Add(str); return list; }); UserPresenceUpdates.AddOrUpdate(logChannel, new List<string>() { str }, (id, list) => { list.Add(str); return list; });
@ -318,7 +329,7 @@ namespace NadekoBot.Modules.Administration
var task = Task.Run(async () => var task = Task.Run(async () =>
{ {
try { await logChannel.SendMessageAsync($"`{prettyCurrentTime}`❗`User left:` **{usr.Username}** ({usr.Id})").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } try { await logChannel.SendMessageAsync($"❗️🕛`{prettyCurrentTime}`👤__**{usr.Username}#{usr.Discriminator}**__❌ **| USER LEFT |** 🆔 `{usr.Id}`").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); }
}); });
return Task.CompletedTask; return Task.CompletedTask;
@ -338,7 +349,7 @@ namespace NadekoBot.Modules.Administration
var task = Task.Run(async () => var task = Task.Run(async () =>
{ {
try { await logChannel.SendMessageAsync($"`{prettyCurrentTime}`❗`User joined:` **{usr.Username}** ({usr.Id})").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } try { await logChannel.SendMessageAsync($"❕🕓`{prettyCurrentTime}`👤__**{usr.Username}#{usr.Discriminator}**__✅ **| USER JOINED |** 🆔 `{usr.Id}`").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); }
}); });
return Task.CompletedTask; return Task.CompletedTask;
@ -358,7 +369,7 @@ namespace NadekoBot.Modules.Administration
var task = Task.Run(async () => var task = Task.Run(async () =>
{ {
try { await logChannel.SendMessageAsync($"`{prettyCurrentTime}`♻`User unbanned:` **{usr.Username}** ({usr.Id})").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } try { await logChannel.SendMessageAsync($"❕🕘`{prettyCurrentTime}`👤__**{usr.Username}#{usr.Discriminator}**__♻ **| USER UN-BANNED |** 🆔 `{usr.Id}`").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); }
}); });
return Task.CompletedTask; return Task.CompletedTask;
@ -378,7 +389,7 @@ namespace NadekoBot.Modules.Administration
var task = Task.Run(async () => var task = Task.Run(async () =>
{ {
try { await logChannel.SendMessageAsync($"❗`{prettyCurrentTime}`❌`User banned:` **{usr.Username}** ({usr.Id})").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } try { await logChannel.SendMessageAsync($"‼️🕕`{prettyCurrentTime}`👤__**{usr.Username}#{usr.Discriminator}**__🚫 **| USER BANNED |** 🆔 `{usr.Id}`").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); }
}); });
return Task.CompletedTask; return Task.CompletedTask;
@ -409,10 +420,10 @@ namespace NadekoBot.Modules.Administration
{ {
try try
{ {
var str = $@"🕔`{prettyCurrentTime}` **Message** 🚮 `#{channel.Name}` var str = $@"🕔`{prettyCurrentTime}`👤__**{msg.Author.Username}#{msg.Author.Discriminator}**__ **| Deleted Message |** 🆔 `{msg.Author.Id}` #⃣ `{channel.Name}`
👤`{msg.Author.Username}`: {msg.Resolve(userHandling: UserMentionHandling.NameAndDiscriminator)}"; 🗑 {msg.Resolve(userHandling: UserMentionHandling.NameAndDiscriminator)}";
if (msg.Attachments.Any()) if (msg.Attachments.Any())
str += $"{Environment.NewLine}`Attachements`: {string.Join(", ", msg.Attachments.Select(a => a.ProxyUrl))}"; str += $"{Environment.NewLine}📎 {string.Join(", ", msg.Attachments.Select(a => a.ProxyUrl))}";
await logChannel.SendMessageAsync(str.SanitizeMentions()).ConfigureAwait(false); await logChannel.SendMessageAsync(str.SanitizeMentions()).ConfigureAwait(false);
} }
catch (Exception ex) { _log.Warn(ex); } catch (Exception ex) { _log.Warn(ex); }
@ -448,10 +459,11 @@ namespace NadekoBot.Modules.Administration
var task = Task.Run(async () => var task = Task.Run(async () =>
{ {
try { await logChannel.SendMessageAsync($@"🕔`{prettyCurrentTime}` **Message** 📝 `#{channel.Name}` //try { await logChannel.SendMessageAsync($@"🕔`{prettyCurrentTime}` **Message** 📝 `#{channel.Name}`
👤`{before.Author.Username}` //👤`{before.Author.Username}`
try { await logChannel.SendMessageAsync($@"🕔`{prettyCurrentTime}`👤__**{before.Author.Username}#{before.Author.Discriminator}**__ **| 📝 Edited Message |** 🆔 `{before.Author.Id}` #⃣ `{channel.Name}`
`Old:` {before.Resolve(userHandling: UserMentionHandling.NameAndDiscriminator).SanitizeMentions()} `Old:` {before.Resolve(userHandling: UserMentionHandling.NameAndDiscriminator).SanitizeMentions()}
`New:` {after.Resolve(userHandling: UserMentionHandling.NameAndDiscriminator).SanitizeMentions()}").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } **`New:`** {after.Resolve(userHandling: UserMentionHandling.NameAndDiscriminator).SanitizeMentions()}").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); }
}); });
return Task.CompletedTask; return Task.CompletedTask;
@ -550,9 +562,9 @@ namespace NadekoBot.Modules.Administration
} }
if (logSetting.IsLogging) if (logSetting.IsLogging)
await channel.SendMessageAsync("`Logging enabled.`").ConfigureAwait(false); await channel.SendMessageAsync("✅ **Logging enabled.**").ConfigureAwait(false);
else else
await channel.SendMessageAsync("`Logging disabled.`").ConfigureAwait(false); await channel.SendMessageAsync(" **Logging disabled.**").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -579,9 +591,9 @@ namespace NadekoBot.Modules.Administration
} }
if (removed == 0) if (removed == 0)
await channel.SendMessageAsync($"`Logging will now ignore {channel.Name} ({channel.Id}) channel.`").ConfigureAwait(false); await channel.SendMessageAsync($"🆗 Logging will **now ignore** #⃣ `{channel.Name} ({channel.Id})`").ConfigureAwait(false);
else else
await channel.SendMessageAsync($"`Logging will no longer ignore {channel.Name} ({channel.Id}) channel.`").ConfigureAwait(false); await channel.SendMessageAsync($" Logging will **no longer ignore** #⃣ `{channel.Name} ({channel.Id})`").ConfigureAwait(false);
} }
//[LocalizedCommand, LocalizedRemarks, LocalizedSummary, LocalizedAlias] //[LocalizedCommand, LocalizedRemarks, LocalizedSummary, LocalizedAlias]
@ -672,9 +684,9 @@ namespace NadekoBot.Modules.Administration
} }
if (enabled) if (enabled)
await channel.SendMessageAsync($"`Logging user presence updates in {channel.Name} ({channel.Id}) channel.`").ConfigureAwait(false); await channel.SendMessageAsync($"✅ Logging **user presence** updates in #⃣ `{channel.Name} ({channel.Id})`").ConfigureAwait(false);
else else
await channel.SendMessageAsync($"`Stopped logging user presence updates.`").ConfigureAwait(false); await channel.SendMessageAsync($" Stopped logging **user presence** updates.").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -695,9 +707,9 @@ namespace NadekoBot.Modules.Administration
} }
if (enabled) if (enabled)
await channel.SendMessageAsync($"`Logging voice presence updates in {channel.Name} ({channel.Id}) channel.`").ConfigureAwait(false); await channel.SendMessageAsync($"✅ Logging **voice presence** updates in #⃣ `{channel.Name} ({channel.Id})`").ConfigureAwait(false);
else else
await channel.SendMessageAsync($"`Stopped logging voice presence updates.`").ConfigureAwait(false); await channel.SendMessageAsync($" Stopped logging **voice presence** updates.").ConfigureAwait(false);
} }
//[LocalizedCommand, LocalizedDescription, LocalizedSummary, LocalizedAlias] //[LocalizedCommand, LocalizedDescription, LocalizedSummary, LocalizedAlias]

View File

@ -32,7 +32,7 @@ namespace NadekoBot.Modules.Administration
await uow.CompleteAsync().ConfigureAwait(false); await uow.CompleteAsync().ConfigureAwait(false);
} }
await channel.SendMessageAsync($"Automatic deleting of `iam` and `iamn` confirmations has been {(newval ? "enabled" : "disabled")}.") await channel.SendMessageAsync($" Automatic deleting of `iam` and `iamn` confirmations has been {(newval ? "**enabled**" : "**disabled**")}.")
.ConfigureAwait(false); .ConfigureAwait(false);
} }
@ -51,7 +51,7 @@ namespace NadekoBot.Modules.Administration
roles = uow.SelfAssignedRoles.GetFromGuild(channel.Guild.Id); roles = uow.SelfAssignedRoles.GetFromGuild(channel.Guild.Id);
if (roles.Any(s => s.RoleId == role.Id && s.GuildId == role.GuildId)) if (roles.Any(s => s.RoleId == role.Id && s.GuildId == role.GuildId))
{ {
msg = $":anger:Role **{role.Name}** is already in the list."; msg = $"💢 Role **{role.Name}** is already in the list.";
} }
else else
{ {
@ -60,7 +60,7 @@ namespace NadekoBot.Modules.Administration
GuildId = role.GuildId GuildId = role.GuildId
}); });
await uow.CompleteAsync(); await uow.CompleteAsync();
msg = $":ok:Role **{role.Name}** added to the list."; msg = $"🆗 Role **{role.Name}** added to the list.";
} }
} }
await channel.SendMessageAsync(msg.ToString()).ConfigureAwait(false); await channel.SendMessageAsync(msg.ToString()).ConfigureAwait(false);
@ -81,10 +81,10 @@ namespace NadekoBot.Modules.Administration
} }
if (!success) if (!success)
{ {
await channel.SendMessageAsync(":anger:That role is not self-assignable.").ConfigureAwait(false); await channel.SendMessageAsync("That role is not self-assignable.").ConfigureAwait(false);
return; return;
} }
await channel.SendMessageAsync($":ok:**{role.Name}** has been removed from the list of self-assignable roles").ConfigureAwait(false); await channel.SendMessageAsync($"🗑 **{role.Name}** has been removed from the list of self-assignable roles.").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -99,7 +99,7 @@ namespace NadekoBot.Modules.Administration
using (var uow = DbHandler.UnitOfWork()) using (var uow = DbHandler.UnitOfWork())
{ {
var roleModels = uow.SelfAssignedRoles.GetFromGuild(channel.Guild.Id); var roleModels = uow.SelfAssignedRoles.GetFromGuild(channel.Guild.Id);
msg.AppendLine($"There are `{roleModels.Count()}` self assignable roles:"); msg.AppendLine($" There are `{roleModels.Count()}` self assignable roles:");
foreach (var roleModel in roleModels) foreach (var roleModel in roleModels)
{ {
@ -137,8 +137,8 @@ namespace NadekoBot.Modules.Administration
areExclusive = config.ExclusiveSelfAssignedRoles = !config.ExclusiveSelfAssignedRoles; areExclusive = config.ExclusiveSelfAssignedRoles = !config.ExclusiveSelfAssignedRoles;
await uow.CompleteAsync(); await uow.CompleteAsync();
} }
string exl = areExclusive ? "exclusive." : "not exclusive."; string exl = areExclusive ? "**exclusive**." : "**not exclusive**.";
await channel.SendMessageAsync("Self assigned roles are now " + exl); await channel.SendMessageAsync(" Self assigned roles are now " + exl);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -159,12 +159,12 @@ namespace NadekoBot.Modules.Administration
SelfAssignedRole roleModel; SelfAssignedRole roleModel;
if ((roleModel = roles.FirstOrDefault(r=>r.RoleId == role.Id)) == null) if ((roleModel = roles.FirstOrDefault(r=>r.RoleId == role.Id)) == null)
{ {
await channel.SendMessageAsync(":anger:That role is not self-assignable.").ConfigureAwait(false); await channel.SendMessageAsync("💢 That role is not self-assignable.").ConfigureAwait(false);
return; return;
} }
if (guildUser.Roles.Contains(role)) if (guildUser.Roles.Contains(role))
{ {
await channel.SendMessageAsync($":anger:You already have {role.Name} role.").ConfigureAwait(false); await channel.SendMessageAsync($"❎ You already have **{role.Name}** role.").ConfigureAwait(false);
return; return;
} }
@ -173,7 +173,7 @@ namespace NadekoBot.Modules.Administration
var sameRoles = guildUser.Roles.Where(r => roles.Any(rm => rm.RoleId == r.Id)); var sameRoles = guildUser.Roles.Where(r => roles.Any(rm => rm.RoleId == r.Id));
if (sameRoles.Any()) if (sameRoles.Any())
{ {
await channel.SendMessageAsync($":anger:You already have {sameRoles.FirstOrDefault().Name} exclusive self-assigned role.").ConfigureAwait(false); await channel.SendMessageAsync($"❎ You already have **{sameRoles.FirstOrDefault().Name}** `exclusive self-assigned` role.").ConfigureAwait(false);
return; return;
} }
} }
@ -183,11 +183,11 @@ namespace NadekoBot.Modules.Administration
} }
catch (Exception ex) catch (Exception ex)
{ {
await channel.SendMessageAsync($":anger:`I am unable to add that role to you. I can't add roles to owners or other roles higher than my role in the role hierarchy.`").ConfigureAwait(false); await channel.SendMessageAsync($"⚠️ I am unable to add that role to you. `I can't add roles to owners or other roles higher than my role in the role hierarchy.`").ConfigureAwait(false);
Console.WriteLine(ex); Console.WriteLine(ex);
return; return;
} }
var msg = await channel.SendMessageAsync($":ok:You now have {role.Name} role.").ConfigureAwait(false); var msg = await channel.SendMessageAsync($"🆗 You now have **{role.Name}** role.").ConfigureAwait(false);
if (conf.AutoDeleteSelfAssignedRoleMessages) if (conf.AutoDeleteSelfAssignedRoleMessages)
{ {
@ -217,12 +217,12 @@ namespace NadekoBot.Modules.Administration
SelfAssignedRole roleModel; SelfAssignedRole roleModel;
if ((roleModel = roles.FirstOrDefault(r => r.RoleId == role.Id)) == null) if ((roleModel = roles.FirstOrDefault(r => r.RoleId == role.Id)) == null)
{ {
await channel.SendMessageAsync(":anger:That role is not self-assignable.").ConfigureAwait(false); await channel.SendMessageAsync("💢 That role is not self-assignable.").ConfigureAwait(false);
return; return;
} }
if (!guildUser.Roles.Contains(role)) if (!guildUser.Roles.Contains(role))
{ {
await channel.SendMessageAsync($":anger:You don't have {role.Name} role.").ConfigureAwait(false); await channel.SendMessageAsync($"❎ You don't have **{role.Name}** role.").ConfigureAwait(false);
return; return;
} }
try try
@ -231,10 +231,10 @@ namespace NadekoBot.Modules.Administration
} }
catch (Exception) catch (Exception)
{ {
await channel.SendMessageAsync($":anger:`I am unable to add that role to you. I can't remove roles to owners or other roles higher than my role in the role hierarchy.`").ConfigureAwait(false); await channel.SendMessageAsync($"⚠️ I am unable to add that role to you. `I can't remove roles to owners or other roles higher than my role in the role hierarchy.`").ConfigureAwait(false);
return; return;
} }
var msg = await channel.SendMessageAsync($":ok: You no longer have {role.Name} role.").ConfigureAwait(false); var msg = await channel.SendMessageAsync($"🆗 You no longer have **{role.Name}** role.").ConfigureAwait(false);
if (conf.AutoDeleteSelfAssignedRoleMessages) if (conf.AutoDeleteSelfAssignedRoleMessages)
{ {

View File

@ -135,9 +135,9 @@ namespace NadekoBot.Modules.Administration
await ServerGreetCommands.SetGreetDel(channel.Guild.Id, timer).ConfigureAwait(false); await ServerGreetCommands.SetGreetDel(channel.Guild.Id, timer).ConfigureAwait(false);
if (timer > 0) if (timer > 0)
await channel.SendMessageAsync($"`Greet messages will be deleted after {timer} seconds.`").ConfigureAwait(false); await channel.SendMessageAsync($"🆗 Greet messages **will be deleted** after `{timer} seconds`.").ConfigureAwait(false);
else else
await channel.SendMessageAsync("`Automatic deletion of greet messages has been disabled.`").ConfigureAwait(false); await channel.SendMessageAsync(" Automatic deletion of greet messages has been **disabled**.").ConfigureAwait(false);
} }
private static async Task SetGreetDel(ulong id, int timer) private static async Task SetGreetDel(ulong id, int timer)
@ -164,9 +164,9 @@ namespace NadekoBot.Modules.Administration
var enabled = await ServerGreetCommands.SetGreet(channel.Guild.Id, channel.Id).ConfigureAwait(false); var enabled = await ServerGreetCommands.SetGreet(channel.Guild.Id, channel.Id).ConfigureAwait(false);
if (enabled) if (enabled)
await channel.SendMessageAsync("Greeting messages enabled on this channel.").ConfigureAwait(false); await channel.SendMessageAsync("Greeting messages **enabled** on this channel.").ConfigureAwait(false);
else else
await channel.SendMessageAsync("Greeting messages disabled.").ConfigureAwait(false); await channel.SendMessageAsync(" Greeting messages **disabled**.").ConfigureAwait(false);
} }
private static async Task<bool> SetGreet(ulong guildId, ulong channelId, bool? value = null) private static async Task<bool> SetGreet(ulong guildId, ulong channelId, bool? value = null)
@ -197,15 +197,15 @@ namespace NadekoBot.Modules.Administration
{ {
config = uow.GuildConfigs.For(channel.Guild.Id); config = uow.GuildConfigs.For(channel.Guild.Id);
} }
await channel.SendMessageAsync("`Current greet message:` " + config.ChannelGreetMessageText?.SanitizeMentions()); await channel.SendMessageAsync(" Current **greet** message: `" + config.ChannelGreetMessageText?.SanitizeMentions() + "`");
return; return;
} }
var sendGreetEnabled = ServerGreetCommands.SetGreetMessage(channel.Guild.Id, ref text); var sendGreetEnabled = ServerGreetCommands.SetGreetMessage(channel.Guild.Id, ref text);
await channel.SendMessageAsync("New greet message set.").ConfigureAwait(false); await channel.SendMessageAsync("🆗 New greet message **set**.").ConfigureAwait(false);
if (!sendGreetEnabled) if (!sendGreetEnabled)
await channel.SendMessageAsync("Enable greet messsages by typing `.greet`").ConfigureAwait(false); await channel.SendMessageAsync(" Enable greet messsages by typing `.greet`").ConfigureAwait(false);
} }
public static bool SetGreetMessage(ulong guildId, ref string message) public static bool SetGreetMessage(ulong guildId, ref string message)
@ -238,9 +238,9 @@ namespace NadekoBot.Modules.Administration
var enabled = await ServerGreetCommands.SetGreetDm(channel.Guild.Id).ConfigureAwait(false); var enabled = await ServerGreetCommands.SetGreetDm(channel.Guild.Id).ConfigureAwait(false);
if (enabled) if (enabled)
await channel.SendMessageAsync("DM Greet announcements enabled.").ConfigureAwait(false); await channel.SendMessageAsync("🆗 DM Greet announcements **enabled**.").ConfigureAwait(false);
else else
await channel.SendMessageAsync("Greet announcements disabled.").ConfigureAwait(false); await channel.SendMessageAsync(" Greet announcements **disabled**.").ConfigureAwait(false);
} }
private static async Task<bool> SetGreetDm(ulong guildId, bool? value = null) private static async Task<bool> SetGreetDm(ulong guildId, bool? value = null)
@ -270,15 +270,15 @@ namespace NadekoBot.Modules.Administration
{ {
config = uow.GuildConfigs.For(channel.Guild.Id); config = uow.GuildConfigs.For(channel.Guild.Id);
} }
await channel.SendMessageAsync("`Current DM greet message:` " + config.ChannelGreetMessageText?.SanitizeMentions()); await channel.SendMessageAsync(" Current **DM greet** message: `" + config.ChannelGreetMessageText?.SanitizeMentions() + "`");
return; return;
} }
var sendGreetEnabled = ServerGreetCommands.SetGreetMessage(channel.Guild.Id, ref text); var sendGreetEnabled = ServerGreetCommands.SetGreetMessage(channel.Guild.Id, ref text);
await channel.SendMessageAsync("New DM greet message set.").ConfigureAwait(false); await channel.SendMessageAsync("🆗 New DM greet message **set**.").ConfigureAwait(false);
if (!sendGreetEnabled) if (!sendGreetEnabled)
await channel.SendMessageAsync($"Enable DM greet messsages by typing `{NadekoBot.ModulePrefixes[typeof(Administration).Name]}greetdm`").ConfigureAwait(false); await channel.SendMessageAsync($" Enable DM greet messsages by typing `{NadekoBot.ModulePrefixes[typeof(Administration).Name]}greetdm`").ConfigureAwait(false);
} }
public static bool SetGreetDmMessage(ulong guildId, ref string message) public static bool SetGreetDmMessage(ulong guildId, ref string message)
@ -311,9 +311,9 @@ namespace NadekoBot.Modules.Administration
var enabled = await ServerGreetCommands.SetBye(channel.Guild.Id, channel.Id).ConfigureAwait(false); var enabled = await ServerGreetCommands.SetBye(channel.Guild.Id, channel.Id).ConfigureAwait(false);
if (enabled) if (enabled)
await channel.SendMessageAsync("Bye announcements enabled on this channel.").ConfigureAwait(false); await channel.SendMessageAsync("Bye announcements **enabled** on this channel.").ConfigureAwait(false);
else else
await channel.SendMessageAsync("Bye announcements disabled.").ConfigureAwait(false); await channel.SendMessageAsync(" Bye announcements **disabled**.").ConfigureAwait(false);
} }
private static async Task<bool> SetBye(ulong guildId, ulong channelId, bool? value = null) private static async Task<bool> SetBye(ulong guildId, ulong channelId, bool? value = null)
@ -344,15 +344,15 @@ namespace NadekoBot.Modules.Administration
{ {
config = uow.GuildConfigs.For(channel.Guild.Id); config = uow.GuildConfigs.For(channel.Guild.Id);
} }
await channel.SendMessageAsync("`Current bye message:` " + config.ChannelByeMessageText?.SanitizeMentions()); await channel.SendMessageAsync(" Current **bye** message: `" + config.ChannelByeMessageText?.SanitizeMentions() + "`");
return; return;
} }
var sendByeEnabled = ServerGreetCommands.SetByeMessage(channel.Guild.Id, ref text); var sendByeEnabled = ServerGreetCommands.SetByeMessage(channel.Guild.Id, ref text);
await channel.SendMessageAsync("New bye message set.").ConfigureAwait(false); await channel.SendMessageAsync("🆗 New bye message **set**.").ConfigureAwait(false);
if (!sendByeEnabled) if (!sendByeEnabled)
await channel.SendMessageAsync($"Enable bye messsages by typing `{NadekoBot.ModulePrefixes[typeof(Administration).Name]}bye`").ConfigureAwait(false); await channel.SendMessageAsync($" Enable bye messsages by typing `{NadekoBot.ModulePrefixes[typeof(Administration).Name]}bye`").ConfigureAwait(false);
} }
public static bool SetByeMessage(ulong guildId, ref string message) public static bool SetByeMessage(ulong guildId, ref string message)
@ -385,9 +385,9 @@ namespace NadekoBot.Modules.Administration
await ServerGreetCommands.SetByeDel(channel.Guild.Id, timer).ConfigureAwait(false); await ServerGreetCommands.SetByeDel(channel.Guild.Id, timer).ConfigureAwait(false);
if (timer > 0) if (timer > 0)
await channel.SendMessageAsync($"`Bye messages will be deleted after {timer} seconds.`").ConfigureAwait(false); await channel.SendMessageAsync($"🆗 Bye messages **will be deleted** after `{timer} seconds`.").ConfigureAwait(false);
else else
await channel.SendMessageAsync("`Automatic deletion of bye messages has been disabled.`").ConfigureAwait(false); await channel.SendMessageAsync(" Automatic deletion of bye messages has been **disabled**.").ConfigureAwait(false);
} }
private static async Task SetByeDel(ulong id, int timer) private static async Task SetByeDel(ulong id, int timer)

View File

@ -52,8 +52,8 @@ namespace NadekoBot.Modules.Administration
try try
{ {
await (await guild.GetOwnerAsync()).SendMessageAsync( await (await guild.GetOwnerAsync()).SendMessageAsync(
"I don't have manage server and/or Manage Channels permission," + "⚠️ I don't have **manage server** and/or **manage channels** permission," +
$" so I cannot run voice+text on **{guild.Name}** server.").ConfigureAwait(false); $" so I cannot run `voice+text` on **{guild.Name}** server.").ConfigureAwait(false);
} }
catch { } catch { }
using (var uow = DbHandler.UnitOfWork()) using (var uow = DbHandler.UnitOfWork())
@ -116,7 +116,7 @@ namespace NadekoBot.Modules.Administration
var botUser = await guild.GetCurrentUserAsync().ConfigureAwait(false); var botUser = await guild.GetCurrentUserAsync().ConfigureAwait(false);
if (!botUser.GuildPermissions.ManageRoles || !botUser.GuildPermissions.ManageChannels) if (!botUser.GuildPermissions.ManageRoles || !botUser.GuildPermissions.ManageChannels)
{ {
await channel.SendMessageAsync(":anger: `I require atleast manage roles and manage channels permissions to enable this feature (preffered Administration permission).`"); await channel.SendMessageAsync("💢 I require atleast **manage roles** and **manage channels permissions** to enable this feature. `(preffered Administration permission)`");
return; return;
} }
@ -124,8 +124,8 @@ namespace NadekoBot.Modules.Administration
{ {
try try
{ {
await channel.SendMessageAsync(":warning: `You are enabling this feature and I do not have ADMINISTRATOR permissions, " + await channel.SendMessageAsync("⚠️ You are enabling this feature and **I do not have ADMINISTRATOR permissions**. " +
"this may cause some issues, and you will have to clean up text channels yourself afterwards.`"); "`This may cause some issues, and you will have to clean up text channels yourself afterwards.`");
} }
catch { } catch { }
} }
@ -145,11 +145,11 @@ namespace NadekoBot.Modules.Administration
{ {
try { await textChannel.DeleteAsync().ConfigureAwait(false); } catch { } try { await textChannel.DeleteAsync().ConfigureAwait(false); } catch { }
} }
await channel.SendMessageAsync("Successfuly removed voice + text feature.").ConfigureAwait(false); await channel.SendMessageAsync(" Successfuly **removed** voice + text feature.").ConfigureAwait(false);
return; return;
} }
voicePlusTextCache.Add(guild.Id); voicePlusTextCache.Add(guild.Id);
await channel.SendMessageAsync("Successfuly enabled voice + text feature.").ConfigureAwait(false); await channel.SendMessageAsync("🆗 Successfuly **enabled** voice + text feature.").ConfigureAwait(false);
} }
catch (Exception ex) catch (Exception ex)
@ -168,7 +168,7 @@ namespace NadekoBot.Modules.Administration
var botUser = await guild.GetCurrentUserAsync().ConfigureAwait(false); var botUser = await guild.GetCurrentUserAsync().ConfigureAwait(false);
if (!botUser.GuildPermissions.Administrator) if (!botUser.GuildPermissions.Administrator)
{ {
await channel.SendMessageAsync("`I need Administrator permission to do that.`").ConfigureAwait(false); await channel.SendMessageAsync("⚠️ I need **Administrator permission** to do that.").ConfigureAwait(false);
return; return;
} }
@ -183,7 +183,7 @@ namespace NadekoBot.Modules.Administration
await Task.Delay(500); await Task.Delay(500);
} }
await channel.SendMessageAsync("`Done.`").ConfigureAwait(false); await channel.SendMessageAsync("✅ Done.").ConfigureAwait(false);
} }
} }
} }

View File

@ -193,7 +193,7 @@ namespace NadekoBot.Modules.Utility
return; return;
} }
await channel.SendMessageAsync(String.Join("\n", guilds.Select(g => $"```css\n Name: {g.Name} ID: {g.Id} Members: #{g.GetUsers().Count} OwnerID:{g.OwnerId} ```"))).ConfigureAwait(false); await channel.SendMessageAsync(String.Join("\n", guilds.Select(g => $"```css\nName: {g.Name} ID:{g.Id} Members:#{g.GetUsers().Count} OwnerID: {g.OwnerId} ```"))).ConfigureAwait(false);
} }
//[NadekoCommand, Usage, Description, Aliases] //[NadekoCommand, Usage, Description, Aliases]