commit
dad789f6f5
@ -41,7 +41,7 @@ ________________________________________________________________________________
|
|||||||
- If you mess up the setup of `credentials.json`, rename `credentials_example.json` to `credentials.json`.
|
- If you mess up the setup of `credentials.json`, rename `credentials_example.json` to `credentials.json`.
|
||||||
- Open the file with [Notepad++][Notepad++].
|
- Open the file with [Notepad++][Notepad++].
|
||||||
- In there you will see fields such as `Token`, `ClientId`, `BotId` and `OwnerIDs`.
|
- In there you will see fields such as `Token`, `ClientId`, `BotId` and `OwnerIDs`.
|
||||||
- In your [applications page][DiscordApp] (the window you were asked to keep open earlier), under the `Bot User` section, you will see `Token:click to reveal`, click to reveal the token.
|
- In your [applications page][DiscordApp] (the window you were asked to keep open earlier), under the `Bot User` section, you will see `Token:click to reveal`, click to reveal the token. (Note: Make sure that you actually use a Token and not a Client Secret! It is in the **App Bot User** tab.)
|
||||||
- Copy your bot's token, and on the `"Token"` line of your `credentials.json`, paste your bot token between the quotation marks.
|
- Copy your bot's token, and on the `"Token"` line of your `credentials.json`, paste your bot token between the quotation marks.
|
||||||
- Copy the `Client ID` on the page and replace the `12312123` part of the `ClientId` line with it.
|
- Copy the `Client ID` on the page and replace the `12312123` part of the `ClientId` line with it.
|
||||||
- Again, copy the same `Client ID` and replace the `null` part of the `BotId` line with it.
|
- Again, copy the same `Client ID` and replace the `null` part of the `BotId` line with it.
|
||||||
|
1555
src/NadekoBot/Migrations/20170501103455_patreon-id.Designer.cs
generated
Normal file
1555
src/NadekoBot/Migrations/20170501103455_patreon-id.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
24
src/NadekoBot/Migrations/20170501103455_patreon-id.cs
Normal file
24
src/NadekoBot/Migrations/20170501103455_patreon-id.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace NadekoBot.Migrations
|
||||||
|
{
|
||||||
|
public partial class patreonid : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "PatreonUserId",
|
||||||
|
table: "RewardedUsers",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "PatreonUserId",
|
||||||
|
table: "RewardedUsers");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -966,6 +966,8 @@ namespace NadekoBot.Migrations
|
|||||||
|
|
||||||
b.Property<DateTime>("LastReward");
|
b.Property<DateTime>("LastReward");
|
||||||
|
|
||||||
|
b.Property<string>("PatreonUserId");
|
||||||
|
|
||||||
b.Property<ulong>("UserId");
|
b.Property<ulong>("UserId");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
@ -52,8 +52,8 @@ namespace NadekoBot.Modules.Games.Trivia
|
|||||||
return new TriviaQuestion("Who's That Pokémon?",
|
return new TriviaQuestion("Who's That Pokémon?",
|
||||||
map[num].ToTitleCase(),
|
map[num].ToTitleCase(),
|
||||||
"Pokemon",
|
"Pokemon",
|
||||||
$@"http://nadekobot.xyz/images/pokemon/shadows/{num}.png",
|
$@"http://nadekobot.me/images/pokemon/shadows/{num}.png",
|
||||||
$@"http://nadekobot.xyz/images/pokemon/real/{num}.png");
|
$@"http://nadekobot.me/images/pokemon/real/{num}.png");
|
||||||
}
|
}
|
||||||
TriviaQuestion randomQuestion;
|
TriviaQuestion randomQuestion;
|
||||||
while (exclude.Contains(randomQuestion = pool[rng.Next(0, pool.Length)])) ;
|
while (exclude.Contains(randomQuestion = pool[rng.Next(0, pool.Length)])) ;
|
||||||
|
@ -173,13 +173,14 @@ namespace NadekoBot.Modules.Utility
|
|||||||
using (var uow = DbHandler.UnitOfWork())
|
using (var uow = DbHandler.UnitOfWork())
|
||||||
{
|
{
|
||||||
var users = uow._context.Set<RewardedUser>();
|
var users = uow._context.Set<RewardedUser>();
|
||||||
var usr = users.FirstOrDefault(x => x.UserId == userId);
|
var usr = users.FirstOrDefault(x => x.PatreonUserId == data.User.id);
|
||||||
|
|
||||||
if (usr == null)
|
if (usr == null)
|
||||||
{
|
{
|
||||||
users.Add(new RewardedUser()
|
users.Add(new RewardedUser()
|
||||||
{
|
{
|
||||||
UserId = userId,
|
UserId = userId,
|
||||||
|
PatreonUserId = data.User.id,
|
||||||
LastReward = now,
|
LastReward = now,
|
||||||
AmountRewardedThisMonth = amount,
|
AmountRewardedThisMonth = amount,
|
||||||
});
|
});
|
||||||
@ -194,6 +195,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
{
|
{
|
||||||
usr.LastReward = now;
|
usr.LastReward = now;
|
||||||
usr.AmountRewardedThisMonth = amount;
|
usr.AmountRewardedThisMonth = amount;
|
||||||
|
usr.PatreonUserId = data.User.id;
|
||||||
|
|
||||||
await CurrencyHandler.AddCurrencyAsync(userId, "Patreon reward - recurring", amount, uow).ConfigureAwait(false);
|
await CurrencyHandler.AddCurrencyAsync(userId, "Patreon reward - recurring", amount, uow).ConfigureAwait(false);
|
||||||
|
|
||||||
@ -207,6 +209,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
|
|
||||||
usr.LastReward = now;
|
usr.LastReward = now;
|
||||||
usr.AmountRewardedThisMonth = amount;
|
usr.AmountRewardedThisMonth = amount;
|
||||||
|
usr.PatreonUserId = data.User.id;
|
||||||
|
|
||||||
await CurrencyHandler.AddCurrencyAsync(usr.UserId, "Patreon reward - update", toAward, uow).ConfigureAwait(false);
|
await CurrencyHandler.AddCurrencyAsync(usr.UserId, "Patreon reward - update", toAward, uow).ConfigureAwait(false);
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@
|
|||||||
<value>greetmsg</value>
|
<value>greetmsg</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="greetmsg_desc" xml:space="preserve">
|
<data name="greetmsg_desc" xml:space="preserve">
|
||||||
<value>Sets a new join announcement message which will be shown in the server's channel. Type `%user%` if you want to mention the new member. Using it with no message will show the current greet message. You can use embed json from <http://nadekobot.xyz/embedbuilder/> instead of a regular text, if you want the message to be embedded.</value>
|
<value>Sets a new join announcement message which will be shown in the server's channel. Type `%user%` if you want to mention the new member. Using it with no message will show the current greet message. You can use embed json from <http://nadekobot.me/embedbuilder/> instead of a regular text, if you want the message to be embedded.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="greetmsg_usage" xml:space="preserve">
|
<data name="greetmsg_usage" xml:space="preserve">
|
||||||
<value>`{0}greetmsg Welcome, %user%.`</value>
|
<value>`{0}greetmsg Welcome, %user%.`</value>
|
||||||
@ -202,7 +202,7 @@
|
|||||||
<value>byemsg</value>
|
<value>byemsg</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="byemsg_desc" xml:space="preserve">
|
<data name="byemsg_desc" xml:space="preserve">
|
||||||
<value>Sets a new leave announcement message. Type `%user%` if you want to show the name the user who left. Type `%id%` to show id. Using this command with no message will show the current bye message. You can use embed json from <http://nadekobot.xyz/embedbuilder/> instead of a regular text, if you want the message to be embedded.</value>
|
<value>Sets a new leave announcement message. Type `%user%` if you want to show the name the user who left. Type `%id%` to show id. Using this command with no message will show the current bye message. You can use embed json from <http://nadekobot.me/embedbuilder/> instead of a regular text, if you want the message to be embedded.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="byemsg_usage" xml:space="preserve">
|
<data name="byemsg_usage" xml:space="preserve">
|
||||||
<value>`{0}byemsg %user% has left.`</value>
|
<value>`{0}byemsg %user% has left.`</value>
|
||||||
@ -2329,7 +2329,7 @@
|
|||||||
<value>`{0}greetdmmsg Welcome to the server, %user%`.</value>
|
<value>`{0}greetdmmsg Welcome to the server, %user%`.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="greetdmmsg_desc" xml:space="preserve">
|
<data name="greetdmmsg_desc" xml:space="preserve">
|
||||||
<value>Sets a new join announcement message which will be sent to the user who joined. Type `%user%` if you want to mention the new member. Using it with no message will show the current DM greet message. You can use embed json from <http://nadekobot.xyz/embedbuilder/> instead of a regular text, if you want the message to be embedded.</value>
|
<value>Sets a new join announcement message which will be sent to the user who joined. Type `%user%` if you want to mention the new member. Using it with no message will show the current DM greet message. You can use embed json from <http://nadekobot.me/embedbuilder/> instead of a regular text, if you want the message to be embedded.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="cash_desc" xml:space="preserve">
|
<data name="cash_desc" xml:space="preserve">
|
||||||
<value>Check how much currency a person has. (Defaults to yourself)</value>
|
<value>Check how much currency a person has. (Defaults to yourself)</value>
|
||||||
|
@ -5,6 +5,7 @@ namespace NadekoBot.Services.Database.Models
|
|||||||
public class RewardedUser : DbEntity
|
public class RewardedUser : DbEntity
|
||||||
{
|
{
|
||||||
public ulong UserId { get; set; }
|
public ulong UserId { get; set; }
|
||||||
|
public string PatreonUserId { get; set; }
|
||||||
public int AmountRewardedThisMonth { get; set; }
|
public int AmountRewardedThisMonth { get; set; }
|
||||||
public DateTime LastReward { get; set; }
|
public DateTime LastReward { get; set; }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user