Skip to content

Commit

Permalink
Merge pull request #2 from ijre/nightly
Browse files Browse the repository at this point in the history
Merge nightly with master
  • Loading branch information
ijre authored Mar 28, 2020
2 parents 9cbf24c + aa29f28 commit 1daca0e
Show file tree
Hide file tree
Showing 25 changed files with 33,889 additions and 1,178 deletions.
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
.vs
intermediates
build
intermediates
obj
*.vcxproj.*
*.user
.editorconfig
*.DotSettings

SD
id*.txt
Final Build
Final Build*
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
[![total time spent](https://wakatime.com/badge/github/ijre/Hatsune_Miku-Bot.svg)](https://wakatime.com/@ijre/projects/fevfeooywz)

known issues tracked using [the todo list](https://github.com/ijre/Hatsune_Miku-Bot/projects/1)

### check out the [nightly build](https://github.com/ijre/Hatsune_Miku-Bot/tree/nightly) if you're interested in the absolutely latest changes (that you have to build yourself)
# Introduction

### Hello! This is a program that allows you to interact with Discord servers as a bot. (read: **not selfbot**)
#### Further explanation:
This is a program that uses a bot token to do everything that a normal human can do. Features still need be added, but that's the gist of it.

Essentially, think of it like the opposite of selfbotting. Where selfbotting is using a user account to run commands, this is using a bot account to do user-like things.
## Why?
Well, it started as a joke between me and my best friend, about their roommate being Hatsune Miku, and we wanted to get the real Miku to confirm that yes, she is indeed their roommate.
That, and the novelty of it all. I knew from the very start that this was a ridiculous idea but I figured this might be of use to somebody, and at the very least it would be good practice for WinForms and programming in general.
# How to setup/use
1. Download the Final.Build.7z archive from the [most recent release](https://github.com/ijre/Discord_Act-As-A-Bot/releases/latest)
2. Extract the "Final Build" folder wherever you'd like
3. Go to https://discordapp.com/developers/applications/
4. If you don't already have a bot token you wish to use, then make a new app, go to Bot at the left side, click Add Bot, after creation click Copy
5. Go into the Final Build folder wherever you extracted it, go into the "deps" folder within that folder, and create a .txt file named "id", then put the token you copied as the only contents
6. That should be all! If you have any errors when launching the program please go to the [issues page](https://github.com/ijre/Discord_Act-As-A-Bot/issues) and create a new issue
5 changes: 5 additions & 0 deletions src/hatsune_miku-bot.sln → src/Discord_Act-As-A-Bot.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "release_assist", "release_a
{62F30952-924E-4567-9EE6-A8B7000368B7} = {62F30952-924E-4567-9EE6-A8B7000368B7}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{35123436-28F9-42DE-9F48-ABE5D7A97453}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
3 changes: 0 additions & 3 deletions src/GUI/.gitignore

This file was deleted.

32 changes: 18 additions & 14 deletions src/GUI/GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B4C4B82A-D456-4354-98D4-40C46591ED94}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>hatsune_miku</RootNamespace>
<AssemblyName>Hatsune Miku GUI</AssemblyName>
<RootNamespace>discord_puppet</RootNamespace>
<AssemblyName>Act As A Discord Bot</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
Expand Down Expand Up @@ -35,10 +35,10 @@
<NoWarn>4014, 1998</NoWarn>
</PropertyGroup>
<PropertyGroup>
<StartupObject>hatsune_miku_bot_display.Program</StartupObject>
<StartupObject>discord_puppet.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\bilbobaggins.ico</ApplicationIcon>
<ApplicationIcon>Resources\kneedeep.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Final Build|AnyCPU'">
<OutputPath>..\Final Build\</OutputPath>
Expand Down Expand Up @@ -71,7 +71,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="PickyCatch.cs" />
<Compile Include="ImageOpenForm.cs">
<SubType>Form</SubType>
</Compile>
Expand All @@ -86,6 +85,13 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="utils\MessageUtils.cs" />
<Compile Include="utils\ExceptionUtils.cs" />
<EmbeddedResource Include="ImageOpenForm.resx">
<DependentUpon>ImageOpenForm.cs</DependentUpon>
</EmbeddedResource>
Expand All @@ -97,15 +103,13 @@
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="..\.editorconfig">
<Link>.editorconfig</Link>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
Expand All @@ -116,15 +120,15 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\corrupted pic.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\bilbobaggins.ico" />
<None Include="Resources\background.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DSharpPlus">
<Version>3.2.3</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<None Include="Resources\kneedeep.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
8 changes: 4 additions & 4 deletions src/GUI/ImageOpenForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 18 additions & 30 deletions src/GUI/ImageOpenForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,33 @@
using System.IO;
using System.Windows.Forms;

namespace IOF
namespace discord_puppet
{
public partial class ImageOpenForm : Form
public partial class IOF : Form
{
public ImageOpenForm()
public IOF(string url)
{
InitializeComponent();

OpenFileDialog diag = new OpenFileDialog()
{
DefaultExt = "txt",
Filter = "(*.txt) | *.txt",
InitialDirectory = Application.StartupPath + "\\deps\\messages\\images",
Title = "Choose which image you would like to view"
};
diag.ShowDialog();
Uri newUri;
Uri.TryCreate(url, UriKind.Absolute, out newUri);
webBrowser1.Url = newUri;
webBrowser1.Visible = true;

if (!String.IsNullOrEmpty(diag.FileName))
webBrowser1.DocumentCompleted += (object sender, WebBrowserDocumentCompletedEventArgs args) =>
{
Uri newUri;
Uri.TryCreate(File.ReadAllText(diag.FileName), UriKind.Absolute, out newUri);
webBrowser1.Url = newUri;
webBrowser1.Visible = true;
Height = webBrowser1.Document.Images[0].ScrollRectangle.Height + 70;
Width = webBrowser1.Document.Images[0].ScrollRectangle.Width + 70;
webBrowser1.DocumentCompleted += (object sender, WebBrowserDocumentCompletedEventArgs args) =>
if (int.Parse(Screen.PrimaryScreen.Bounds.Width.ToString()) <= int.Parse(Size.Width.ToString())
|| int.Parse(Screen.PrimaryScreen.Bounds.Height.ToString()) <= int.Parse(Size.Height.ToString()))
{
Height = webBrowser1.Document.Images[0].ScrollRectangle.Height + 70;
Width = webBrowser1.Document.Images[0].ScrollRectangle.Width + 70;
if (int.Parse(Screen.PrimaryScreen.Bounds.Width.ToString()) <= int.Parse(Size.Width.ToString())
|| int.Parse(Screen.PrimaryScreen.Bounds.Height.ToString()) <= int.Parse(Size.Height.ToString()))
{
Height = Screen.PrimaryScreen.Bounds.Height / 2;
Width = Screen.PrimaryScreen.Bounds.Width / 2;
}
Height = Screen.PrimaryScreen.Bounds.Height / 2;
Width = Screen.PrimaryScreen.Bounds.Width / 2;
}
SetDesktopLocation((Screen.PrimaryScreen.Bounds.Width / 2) - (Size.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (Size.Height / 2));
};
}
SetDesktopLocation((Screen.PrimaryScreen.Bounds.Width / 2) - (Size.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (Size.Height / 2));
};
}

static bool ignoreNext = false;
Expand Down Expand Up @@ -76,7 +64,7 @@ private void WebBrowser1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e
ignoreNext = true;
}
else if (!ignoreNext)
this.Hide();
Hide();
else
ignoreNext = false;
}
Expand Down
Loading

0 comments on commit 1daca0e

Please sign in to comment.