示例#1
0
        public GeneralModule(Module m, Framework.MikiApplication b)
        {
            //EventSystem.Instance.AddCommandDoneEvent(x =>
            //{
            //	x.Name = "--count-commands";
            //	x.processEvent = async (msg, e, success, t) =>
            //	{
            //		if (success)
            //		{
            //			using (var context = new MikiContext())
            //			{
            //				User user = await User.GetAsync(context, msg.Author);
            //				CommandUsage u = await CommandUsage.GetAsync(context, msg.Author.Id.ToDbLong(), e.Name);

            //				u.Amount++;
            //				user.Total_Commands++;

            //				await CommandUsage.UpdateCacheAsync(user.Id, e.Name, u);
            //				await context.SaveChangesAsync();
            //			}
            //		}
            //	};
            //});
        }
示例#2
0
        public FunModule(Module m, Framework.MikiApplication b)
        {
            ImageboardProviderPool.AddProvider(new ImageboardProvider <E621Post>(new ImageboardConfigurations
            {
                QueryKey          = new Uri("http://e621.net/post/index.json?tags="),
                ExplicitTag       = "rating:e",
                QuestionableTag   = "rating:q",
                SafeTag           = "rating:s",
                NetUseCredentials = true,
                NetHeaders        = new List <Tuple <string, string> >()
                {
                    new Tuple <string, string>("User-Agent", "Other"),
                },
                BlacklistedTags =
                {
                    "loli",
                    "shota",
                }
            }));
            ImageboardProviderPool.AddProvider(new ImageboardProvider <DanbooruPost>(new ImageboardConfigurations
            {
                QueryKey          = new Uri("https://danbooru.donmai.us/posts.json?tags="),
                ExplicitTag       = "rating:e",
                QuestionableTag   = "rating:q",
                SafeTag           = "rating:s",
                NetUseCredentials = true,
                NetHeaders        =
                {
                    new Tuple <string, string>("Authorization", $"Basic {Convert.ToBase64String(Encoding.UTF8.GetBytes(Global.Config.DanbooruCredentials))}"),
                },
                BlacklistedTags =
                {
                    "loli",
                    "shota"
                }
            }));
            ImageboardProviderPool.AddProvider(new ImageboardProvider <GelbooruPost>(new ImageboardConfigurations
            {
                QueryKey        = new Uri("http://gelbooru.com/index.php?page=dapi&s=post&q=index&json=1&tags="),
                BlacklistedTags =
                {
                    "loli",
                    "shota",
                }
            }));
            ImageboardProviderPool.AddProvider(new ImageboardProvider <SafebooruPost>(new ImageboardConfigurations
            {
                QueryKey        = new Uri("https://safebooru.org/index.php?page=dapi&s=post&q=index&json=1&tags="),
                BlacklistedTags =
                {
                    "loli",
                    "shota",
                }
            }));
            ImageboardProviderPool.AddProvider(new ImageboardProvider <Rule34Post>(new ImageboardConfigurations
            {
                QueryKey        = new Uri("http://rule34.xxx/index.php?page=dapi&s=post&q=index&json=1&tags="),
                BlacklistedTags =
                {
                    "loli",
                    "shota",
                }
            }));
            ImageboardProviderPool.AddProvider(new ImageboardProvider <KonachanPost>(new ImageboardConfigurations
            {
                QueryKey        = new Uri("https://konachan.com/post.json?tags="),
                BlacklistedTags =
                {
                    "loli",
                    "shota",
                }
            }));

            ImageboardProviderPool.AddProvider(new ImageboardProvider <YanderePost>(new ImageboardConfigurations
            {
                QueryKey        = new Uri("https://yande.re/post.json?tags="),
                BlacklistedTags =
                {
                    "loli",
                    "shota",
                }
            }));
        }