diff --git a/DML.Client/DML.Client.csproj b/DML.Client/DML.Client.csproj index 4b6dd43..3bcc684 100644 --- a/DML.Client/DML.Client.csproj +++ b/DML.Client/DML.Client.csproj @@ -8,8 +8,4 @@ - - - - diff --git a/DML.Client/DMLClient.cs b/DML.Client/DMLClient.cs index 691f563..07060f0 100644 --- a/DML.Client/DMLClient.cs +++ b/DML.Client/DMLClient.cs @@ -22,4 +22,4 @@ namespace DML.Client return Client.LoginState == LoginState.LoggedIn && Client.ConnectionState == ConnectionState.Connected; } } -} +} \ No newline at end of file diff --git a/Discord Media Loader.Application/Classes/Core.cs b/Discord Media Loader.Application/Classes/Core.cs index 3d628f2..95370b2 100644 --- a/Discord Media Loader.Application/Classes/Core.cs +++ b/Discord Media Loader.Application/Classes/Core.cs @@ -1,11 +1,5 @@ -using System; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Runtime; -using System.Threading.Tasks; -using System.Windows.Forms; -using Discord; +using Discord; +using Discord.Net; using Discord.WebSocket; using DML.AppCore.Classes; using DML.Application.Classes.RPC; @@ -17,6 +11,13 @@ using SharpRaven.Data; using SweetLib.Utils; using SweetLib.Utils.Logger; using SweetLib.Utils.Logger.Memory; +using System; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Runtime; +using System.Threading.Tasks; +using System.Windows.Forms; using Logger = SweetLib.Utils.Logger.Logger; namespace DML.Application.Classes @@ -86,7 +87,6 @@ namespace DML.Application.Classes Logger.Trace("Created log folder."); } - var logFile = Path.Combine(logFolder, SweetUtils.LegalizeFilename($"{DateTime.Now.ToString(CultureInfo.CurrentCulture.DateTimeFormat.SortableDateTimePattern)}.log.zip")); @@ -95,12 +95,12 @@ namespace DML.Application.Classes logMemory.ArchiveFile = logFile; } - Logger.Debug("Loading database..."); + var databasePath = Path.Combine(DataDirectory, "config.db"); #if DEBUG - Database = new LiteDatabase(Path.Combine(DataDirectory, "config.debug.db")); - Database.Log.Logging += (message) => Logger.Trace($"LiteDB: {message}"); -#else - Database = new LiteDatabase(Path.Combine(DataDirectory, "config.db")); + databasePath = Path.Combine(DataDirectory, "config.debug.db"); +#endif + Logger.Debug("Loading database..."); + Database = new LiteDatabase(databasePath); Database.Log.Logging += (message) => Logger.Trace($"LiteDB: {message}"); #endif @@ -118,6 +118,18 @@ namespace DML.Application.Classes Settings.Store(); } + if (Settings.ShowStartUpHints) + { + if (MessageBox.Show(splash, "This tool is considered as a selfbot which may violate the Discord TOS. By using this tool you take the risk to get your account banned. Although this never happened yet (as far as I know) you have to confirm to this.\n\r\n\rDo you wish to continue?", "HOLD UP!!", MessageBoxButtons.YesNo) != DialogResult.Yes) + { + splash.Close(); + return; + } + + Settings.ShowStartUpHints = false; + Settings.Store(); + } + Logger.Debug("Loading jobs collection out of database..."); Scheduler.JobList = Job.RestoreJobs().ToList(); @@ -173,7 +185,6 @@ namespace DML.Application.Classes Logger.Info("Trying to log into discord..."); - var abort = false; DMLClient.Client.Connected += Client_Connected; @@ -181,17 +192,28 @@ namespace DML.Application.Classes while (!loggedIn) { - if (!string.IsNullOrEmpty(Settings.LoginToken)) + try { - Logger.Debug("Trying to login with last known token..."); - loggedIn = await DMLClient.Login(Settings.LoginToken); + if (!string.IsNullOrEmpty(Settings.LoginToken)) + { + Logger.Debug("Trying to login with last known token..."); + loggedIn = await DMLClient.Login(Settings.LoginToken); + } + + } + catch (HttpException) + { + Logger.Warn("HTTPException occured during login. Probably from login token."); } if (!loggedIn) { Logger.Debug("Showing dialog for username and password..."); var loginDlg = new LoginDialog(); - loginDlg.ShowDialog(); + if (loginDlg.ShowDialog() != DialogResult.OK) + { + return; + } } } @@ -210,12 +232,16 @@ namespace DML.Application.Classes var isError = false; var guild = FindServerById(job.GuildId); if (guild == null) + { isError = true; + } else { var channel = FindChannelById(guild, job.ChannelId); if (channel == null) + { isError = true; + } } if (isError) @@ -281,9 +307,11 @@ namespace DML.Application.Classes } catch (Exception ex) { - Logger.Error($"{ex.Message} occured at: {ex.StackTrace}"); + Logger.Error($"{ex.Message} [{ex.GetType().Name}] occured at: {ex.StackTrace}"); if (MessageBox.Show($"An error occured while running Discord Media Loader:\n{ex.GetType().Name}: {ex.Message}\n\nDo you aggree to sending the error report to the creator of the tool?", "Discord Media Loader", MessageBoxButtons.YesNo) == DialogResult.Yes) + { Raven.Capture(new SentryEvent(ex)); + } } } diff --git a/Discord Media Loader.Application/Classes/Settings.cs b/Discord Media Loader.Application/Classes/Settings.cs index f6065f1..309df4f 100644 --- a/Discord Media Loader.Application/Classes/Settings.cs +++ b/Discord Media Loader.Application/Classes/Settings.cs @@ -15,6 +15,7 @@ namespace DML.Application.Classes public string FileNameScheme { get; set; } = @"%guild%\%channel%\%id%"; public bool SkipExistingFiles { get; set; } = true; public int ThreadLimit { get; set; } = 50; + public bool ShowStartUpHints { get; set; } = true; public bool RescanRequired { get; set; } = true; public bool UseRPC { get; set; } = false; diff --git a/Discord Media Loader.Application/DML.Application.csproj b/Discord Media Loader.Application/DML.Application.csproj index a490d32..ac6a707 100644 --- a/Discord Media Loader.Application/DML.Application.csproj +++ b/Discord Media Loader.Application/DML.Application.csproj @@ -61,6 +61,9 @@ ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll + + ..\packages\Microsoft.Win32.Registry.4.3.0\lib\net46\Microsoft.Win32.Registry.dll + ..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll @@ -83,6 +86,9 @@ ..\packages\SharpRaven.2.2.0\lib\net45\SharpRaven.dll + + ..\packages\SweetLib.0.2.1-alpha\lib\netstandard1.3\SweetLib.dll + ..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll @@ -177,6 +183,7 @@ FrmInternalSplash.cs + Form @@ -211,10 +218,6 @@ - - {02c1f8ef-32f2-4e77-a36d-79129402af37} - SweetLib - {045eb4a1-34e7-47e0-867e-e10c40505095} DML.Client diff --git a/Discord Media Loader.Application/Dialogs/LoginDialog.Designer.cs b/Discord Media Loader.Application/Dialogs/LoginDialog.Designer.cs index 0a48921..2c13385 100644 --- a/Discord Media Loader.Application/Dialogs/LoginDialog.Designer.cs +++ b/Discord Media Loader.Application/Dialogs/LoginDialog.Designer.cs @@ -44,7 +44,7 @@ this.pnlButtons.Controls.Add(this.btnAbort); this.pnlButtons.Controls.Add(this.btnOk); this.pnlButtons.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pnlButtons.Location = new System.Drawing.Point(0, 168); + this.pnlButtons.Location = new System.Drawing.Point(0, 189); this.pnlButtons.Name = "pnlButtons"; this.pnlButtons.Size = new System.Drawing.Size(426, 51); this.pnlButtons.TabIndex = 0; @@ -71,9 +71,11 @@ // // lbHowToToken // + this.lbHowToToken.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); this.lbHowToToken.Location = new System.Drawing.Point(7, 58); this.lbHowToToken.Name = "lbHowToToken"; - this.lbHowToToken.Size = new System.Drawing.Size(412, 87); + this.lbHowToToken.Size = new System.Drawing.Size(412, 128); this.lbHowToToken.TabIndex = 5; this.lbHowToToken.Text = resources.GetString("lbHowToToken.Text"); // @@ -97,7 +99,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(426, 219); + this.ClientSize = new System.Drawing.Size(426, 240); this.Controls.Add(this.lbHowToToken); this.Controls.Add(this.edToken); this.Controls.Add(this.lbToken); diff --git a/Discord Media Loader.Application/Dialogs/LoginDialog.resx b/Discord Media Loader.Application/Dialogs/LoginDialog.resx index 0ffe195..3eab166 100644 --- a/Discord Media Loader.Application/Dialogs/LoginDialog.resx +++ b/Discord Media Loader.Application/Dialogs/LoginDialog.resx @@ -120,7 +120,9 @@ To find your login token please start Discord and press Ctrl + Shift + I shortcut. A browser inspector will open. Navigate into the "Application" tab and select "Local Storage" / "https://discordapp.com". If the right site keeps blank use "Session Storage" instead. -Look for the token key and copy its value without the quotation marks. +Look for the token key and copy its value without the quotation marks. + +IF YOU CANNOT FIND YOUR TOKEN you can try pressing Ctrl + R while having the inspector open. While reloading you still should be able to grab the token. It may disappear after discord has finished loading. diff --git a/Discord Media Loader.Application/Helper/IdentifiedString.cs b/Discord Media Loader.Application/Helper/IdentifiedString.cs new file mode 100644 index 0000000..828d6cf --- /dev/null +++ b/Discord Media Loader.Application/Helper/IdentifiedString.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DML.Application.Helper +{ + internal class IdentifiedString + { + internal T Id { get; set; } + internal string Caption { get; set; } + + internal IdentifiedString(T id, string caption) + { + Id = id; + Caption = caption; + } + + public override string ToString() => Caption; + } +} diff --git a/Discord Media Loader.Application/MainForm.Designer.cs b/Discord Media Loader.Application/MainForm.Designer.cs index d3ea045..5f54124 100644 --- a/Discord Media Loader.Application/MainForm.Designer.cs +++ b/Discord Media Loader.Application/MainForm.Designer.cs @@ -46,6 +46,11 @@ this.cbGuild = new System.Windows.Forms.ComboBox(); this.lbGuild = new System.Windows.Forms.Label(); this.statusStrip = new System.Windows.Forms.StatusStrip(); + this.lbStatus = new System.Windows.Forms.ToolStripDropDownButton(); + this.invisibleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.doNotDisturbToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.doNotDenyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.onlineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pgbProgress = new System.Windows.Forms.ToolStripProgressBar(); this.lbProgress = new System.Windows.Forms.ToolStripStatusLabel(); this.lblVersionPlaceholder = new System.Windows.Forms.ToolStripStatusLabel(); @@ -57,12 +62,9 @@ this.btnDelete = new System.Windows.Forms.Button(); this.lbxJobs = new System.Windows.Forms.ListBox(); this.tmrRefreshProgress = new System.Windows.Forms.Timer(this.components); - this.lbStatus = new System.Windows.Forms.ToolStripDropDownButton(); - this.onlineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.doNotDenyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.doNotDisturbToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.invisibleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tmrTriggerRefresh = new System.Windows.Forms.Timer(this.components); + this.showTokenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.pnlSettings.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.edThreadLimit)).BeginInit(); this.groupBox1.SuspendLayout(); @@ -254,6 +256,45 @@ this.statusStrip.TabIndex = 2; this.statusStrip.Text = "statusStrip1"; // + // lbStatus + // + this.lbStatus.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.invisibleToolStripMenuItem, + this.doNotDisturbToolStripMenuItem, + this.doNotDenyToolStripMenuItem, + this.onlineToolStripMenuItem}); + this.lbStatus.Name = "lbStatus"; + this.lbStatus.Size = new System.Drawing.Size(13, 20); + this.lbStatus.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolStripDropDownButton1_DropDownItemClicked); + // + // invisibleToolStripMenuItem + // + this.invisibleToolStripMenuItem.Name = "invisibleToolStripMenuItem"; + this.invisibleToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.invisibleToolStripMenuItem.Tag = "3"; + this.invisibleToolStripMenuItem.Text = "Invisible"; + // + // doNotDisturbToolStripMenuItem + // + this.doNotDisturbToolStripMenuItem.Name = "doNotDisturbToolStripMenuItem"; + this.doNotDisturbToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.doNotDisturbToolStripMenuItem.Tag = "2"; + this.doNotDisturbToolStripMenuItem.Text = "Do not disturb"; + // + // doNotDenyToolStripMenuItem + // + this.doNotDenyToolStripMenuItem.Name = "doNotDenyToolStripMenuItem"; + this.doNotDenyToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.doNotDenyToolStripMenuItem.Tag = "1"; + this.doNotDenyToolStripMenuItem.Text = "Idle"; + // + // onlineToolStripMenuItem + // + this.onlineToolStripMenuItem.Name = "onlineToolStripMenuItem"; + this.onlineToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.onlineToolStripMenuItem.Tag = "0"; + this.onlineToolStripMenuItem.Text = "Online"; + // // pgbProgress // this.pgbProgress.Name = "pgbProgress"; @@ -267,19 +308,21 @@ // lblVersionPlaceholder // this.lblVersionPlaceholder.Name = "lblVersionPlaceholder"; - this.lblVersionPlaceholder.Size = new System.Drawing.Size(426, 17); + this.lblVersionPlaceholder.Size = new System.Drawing.Size(459, 17); this.lblVersionPlaceholder.Spring = true; // // lbVersion // this.lbVersion.Name = "lbVersion"; - this.lbVersion.Size = new System.Drawing.Size(118, 17); - this.lbVersion.Text = "v https://github.com"; + this.lbVersion.Size = new System.Drawing.Size(54, 17); + this.lbVersion.Text = "VERSION"; // // btnDropDown // this.btnDropDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.btnDropDown.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.showTokenToolStripMenuItem, + this.toolStripSeparator2, this.visitGithubToolStripMenuItem, this.aboutToolStripMenuItem}); this.btnDropDown.ImageTransparentColor = System.Drawing.Color.Magenta; @@ -290,14 +333,14 @@ // visitGithubToolStripMenuItem // this.visitGithubToolStripMenuItem.Name = "visitGithubToolStripMenuItem"; - this.visitGithubToolStripMenuItem.Size = new System.Drawing.Size(135, 22); + this.visitGithubToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.visitGithubToolStripMenuItem.Text = "Visit Github"; this.visitGithubToolStripMenuItem.Click += new System.EventHandler(this.visitGithubToolStripMenuItem_Click); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(135, 22); + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.aboutToolStripMenuItem.Text = "About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); // @@ -341,50 +384,23 @@ this.tmrRefreshProgress.Interval = 500; this.tmrRefreshProgress.Tick += new System.EventHandler(this.tmrRefreshProgress_Tick); // - // lbStatus - // - this.lbStatus.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.invisibleToolStripMenuItem, - this.doNotDisturbToolStripMenuItem, - this.doNotDenyToolStripMenuItem, - this.onlineToolStripMenuItem}); - this.lbStatus.Name = "lbStatus"; - this.lbStatus.Size = new System.Drawing.Size(13, 20); - this.lbStatus.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolStripDropDownButton1_DropDownItemClicked); - // - // onlineToolStripMenuItem - // - this.onlineToolStripMenuItem.Name = "onlineToolStripMenuItem"; - this.onlineToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.onlineToolStripMenuItem.Tag = "0"; - this.onlineToolStripMenuItem.Text = "Online"; - // - // doNotDenyToolStripMenuItem - // - this.doNotDenyToolStripMenuItem.Name = "doNotDenyToolStripMenuItem"; - this.doNotDenyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.doNotDenyToolStripMenuItem.Tag = "1"; - this.doNotDenyToolStripMenuItem.Text = "Idle"; - // - // doNotDisturbToolStripMenuItem - // - this.doNotDisturbToolStripMenuItem.Name = "doNotDisturbToolStripMenuItem"; - this.doNotDisturbToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.doNotDisturbToolStripMenuItem.Tag = "2"; - this.doNotDisturbToolStripMenuItem.Text = "Do not disturb"; - // - // invisibleToolStripMenuItem - // - this.invisibleToolStripMenuItem.Name = "invisibleToolStripMenuItem"; - this.invisibleToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.invisibleToolStripMenuItem.Tag = "3"; - this.invisibleToolStripMenuItem.Text = "Invisible"; - // // tmrTriggerRefresh // this.tmrTriggerRefresh.Interval = 5000; this.tmrTriggerRefresh.Tick += new System.EventHandler(this.tmrTriggerRefresh_Tick); // + // showTokenToolStripMenuItem + // + this.showTokenToolStripMenuItem.Name = "showTokenToolStripMenuItem"; + this.showTokenToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.showTokenToolStripMenuItem.Text = "Copy login token"; + this.showTokenToolStripMenuItem.Click += new System.EventHandler(this.showTokenToolStripMenuItem_Click); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6); + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -448,5 +464,7 @@ private System.Windows.Forms.ToolStripMenuItem doNotDenyToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem onlineToolStripMenuItem; private System.Windows.Forms.Timer tmrTriggerRefresh; + private System.Windows.Forms.ToolStripMenuItem showTokenToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; } } \ No newline at end of file diff --git a/Discord Media Loader.Application/MainForm.cs b/Discord Media Loader.Application/MainForm.cs index 87aa8e9..c9f0bcf 100644 --- a/Discord Media Loader.Application/MainForm.cs +++ b/Discord Media Loader.Application/MainForm.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; @@ -8,8 +9,10 @@ using Discord; using Discord.WebSocket; using DML.AppCore.Classes; using DML.Application.Classes; +using DML.Application.Helper; using DML.Application.Classes.RPC; using DML.Client; +using static DML.Client.DMLClient; using static SweetLib.Utils.Logger.Logger; namespace DML.Application @@ -60,7 +63,9 @@ namespace DML.Application if (cbGuild.Items.Count == 0) { Trace("Adding guilds to component..."); - cbGuild.Items.AddRange(DMLClient.Client.Guilds.OrderBy(g => g.Name).Select(g => g.Name).ToArray()); + + cbGuild.Items.AddRange(DMLClient.Client.Guilds.Where(g => g.Name != null).OrderBy(g => g.Name).Select(g => new IdentifiedString(g.Id, g.Name)).ToArray()); + cbGuild.SelectedIndex = 0; Trace("Guild component initialized."); } @@ -70,8 +75,7 @@ namespace DML.Application lbxJobs.Items.Clear(); foreach (var job in Core.Scheduler.JobList) { - lbxJobs.Items.Add( - $"{FindServerById(job.GuildId)?.Name}:{FindChannelById(FindServerById(job.GuildId), job.ChannelId)?.Name}"); + lbxJobs.Items.Add(new IdentifiedString(job.Id, $"{FindServerById(job.GuildId)?.Name}:{FindChannelById(FindServerById(job.GuildId), job.ChannelId)?.Name}")); } lbxJobs.SelectedIndex = oldIndex; @@ -156,7 +160,7 @@ namespace DML.Application UseWaitCursor = true; try { - var guild = FindServerByName(cbGuild.Text); + var guild = FindServerById(((IdentifiedString)cbGuild.SelectedItem).Id); if (guild != null) { @@ -164,7 +168,9 @@ namespace DML.Application cbChannel.Items.Clear(); Trace("Adding new channels..."); - cbChannel.Items.AddRange(guild.TextChannels.OrderBy(c => c.Position).Select(c => c.Name).ToArray()); + + cbChannel.Items.AddRange(guild.TextChannels.OrderBy(c => c.Position).Select(c => new IdentifiedString(c.Id, c.Name)).ToArray()); + Trace($"Added {cbChannel.Items.Count} channels."); cbChannel.SelectedIndex = 0; @@ -186,8 +192,8 @@ namespace DML.Application { var job = new Job { - GuildId = FindServerByName(cbGuild.Text).Id, - ChannelId = FindChannelByName(FindServerByName(cbGuild.Text), cbChannel.Text).Id + GuildId = ((IdentifiedString)cbGuild.SelectedItem).Id, + ChannelId = ((IdentifiedString)cbChannel.SelectedItem).Id }; if (!(from j in Core.Scheduler.JobList @@ -211,28 +217,15 @@ namespace DML.Application MessageBox.Show("No job has been seleted.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } - var jobNameData = lbxJobs.SelectedItem.ToString().Split(':'); + var jobId = ((IdentifiedString)lbxJobs.SelectedItem).Id; - var guildName = ""; - for (var i = 0; i < jobNameData.Length - 1; i++) - guildName += jobNameData[i] + ":"; - guildName = guildName.Substring(0, guildName.Length - 1); - - var channelName = jobNameData[jobNameData.Length - 1]; - - var guild = FindServerByName(guildName); - var channel = FindChannelByName(guild, channelName); - - foreach (var job in Core.Scheduler.JobList) + var job = Core.Scheduler.JobList.FirstOrDefault(j => j.Id == jobId); + if (job != null) { - if (job.GuildId == guild.Id && job.ChannelId == channel.Id) - { - Core.Scheduler.JobList.Remove(job); - Core.Scheduler.RunningJobs.Remove(job.Id); - job.Stop(); - job.Delete(); - break; - } + Core.Scheduler.JobList.Remove(job); + Core.Scheduler.RunningJobs.Remove(job.Id); + job.Stop(); + job.Delete(); } lbxJobs.SelectedIndex = -1; @@ -304,5 +297,12 @@ namespace DML.Application lbStatus.Text = DMLClient.Client.CurrentUser.Status.ToString(); tmrTriggerRefresh.Stop(); } + + private void showTokenToolStripMenuItem_Click(object sender, EventArgs e) + { + Clipboard.SetText(Core.Settings.LoginToken); + MessageBox.Show(this, "Your login token has been copied to your clipboard.", "Discord Media Loader", + MessageBoxButtons.OK); + } } } diff --git a/Discord Media Loader.Application/Properties/AssemblyInfo.cs b/Discord Media Loader.Application/Properties/AssemblyInfo.cs index c65716e..8bc8300 100644 --- a/Discord Media Loader.Application/Properties/AssemblyInfo.cs +++ b/Discord Media Loader.Application/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Serraniel")] [assembly: AssemblyProduct("Discord Media Loader.Application")] -[assembly: AssemblyCopyright("Copyright © 2017 - 2018 by Serraniel")] +[assembly: AssemblyCopyright("Copyright © 2017 - 2019 by Serraniel")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.2.1.0")] +[assembly: AssemblyFileVersion("1.2.1.0")] diff --git a/Discord Media Loader.Application/app.config b/Discord Media Loader.Application/app.config index d5170f1..05e0aae 100644 --- a/Discord Media Loader.Application/app.config +++ b/Discord Media Loader.Application/app.config @@ -18,6 +18,22 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Discord Media Loader.Application/packages.config b/Discord Media Loader.Application/packages.config index d3092d0..9142f47 100644 --- a/Discord Media Loader.Application/packages.config +++ b/Discord Media Loader.Application/packages.config @@ -11,11 +11,13 @@ + + diff --git a/Discord Media Loader.sln b/Discord Media Loader.sln index 8124baf..09f9aa3 100644 --- a/Discord Media Loader.sln +++ b/Discord Media Loader.sln @@ -7,9 +7,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Discord Media Loader", "Dis EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DML.Application", "Discord Media Loader.Application\DML.Application.csproj", "{C130DE6A-3237-42B5-BE9F-783D1CD104C6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SweetLib", "..\SweetLib\SweetLib\SweetLib.csproj", "{02C1F8EF-32F2-4E77-A36D-79129402AF37}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DML.Client", "DML.Client\DML.Client.csproj", "{045EB4A1-34E7-47E0-867E-E10C40505095}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DML.Client", "DML.Client\DML.Client.csproj", "{045EB4A1-34E7-47E0-867E-E10C40505095}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -25,10 +23,6 @@ Global {C130DE6A-3237-42B5-BE9F-783D1CD104C6}.Debug|Any CPU.Build.0 = Debug|Any CPU {C130DE6A-3237-42B5-BE9F-783D1CD104C6}.Release|Any CPU.ActiveCfg = Release|Any CPU {C130DE6A-3237-42B5-BE9F-783D1CD104C6}.Release|Any CPU.Build.0 = Release|Any CPU - {02C1F8EF-32F2-4E77-A36D-79129402AF37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {02C1F8EF-32F2-4E77-A36D-79129402AF37}.Debug|Any CPU.Build.0 = Debug|Any CPU - {02C1F8EF-32F2-4E77-A36D-79129402AF37}.Release|Any CPU.ActiveCfg = Release|Any CPU - {02C1F8EF-32F2-4E77-A36D-79129402AF37}.Release|Any CPU.Build.0 = Release|Any CPU {045EB4A1-34E7-47E0-867E-E10C40505095}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {045EB4A1-34E7-47E0-867E-E10C40505095}.Debug|Any CPU.Build.0 = Debug|Any CPU {045EB4A1-34E7-47E0-867E-E10C40505095}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/Discord Media Loader/App.config b/Discord Media Loader/App.config index 7cf02b2..1974fd7 100644 --- a/Discord Media Loader/App.config +++ b/Discord Media Loader/App.config @@ -21,6 +21,22 @@ + + + + + + + + + + + + + + + + diff --git a/Discord Media Loader/Properties/AssemblyInfo.cs b/Discord Media Loader/Properties/AssemblyInfo.cs index 4d74e45..e26ca74 100644 --- a/Discord Media Loader/Properties/AssemblyInfo.cs +++ b/Discord Media Loader/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Serraniel")] [assembly: AssemblyProduct("Discord Media Loader")] -[assembly: AssemblyCopyright("Copyright © 2017 - 2018 by Serraniel")] +[assembly: AssemblyCopyright("Copyright © 2017 - 2019 by Serraniel")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.2.0")] -[assembly: AssemblyFileVersion("1.0.2.0")] +[assembly: AssemblyVersion("1.0.3.0")] +[assembly: AssemblyFileVersion("1.0.3.0")] diff --git a/README.md b/README.md index 76946ef..e8ead6d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # Discord Media Loader + +## IMPORTANT: This selfbot may violate discord TOS. Use at own risk!!! + *Discord Media Loader* is a small tool for downloading all attachments of *Discord* servers. -**[Download](https://github.com/Serraniel/DiscordMediaLoader/releases)** +**[Download](https://github.com/Serraniel/DiscordMediaLoader/releases)** **Build:** [![build status badge](https://ci.serraniel.com/app/rest/builds/buildType:(DiscordMediaLoader_BuildMaster)/statusIcon)](https://ci.serraniel.com/viewType.html?buildTypeId=DiscordMediaLoader_BuildMaster) ## License