Skip to content

Commit

Permalink
delete photo
Browse files Browse the repository at this point in the history
  • Loading branch information
GherasimMarius committed Oct 28, 2017
1 parent eb1ba09 commit ba7226a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 838 deletions.
15 changes: 8 additions & 7 deletions DracosBot/DracosBot/9gagCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ namespace DracosBot
{
public class _9gagCommand
{
public static string[] commands = { "!9gaghot", "!9gagtrending", "!9gagfresh", "!9gagdelete" };
public static string[] commands = { "!9gaghot", "!9gagtrending", "!9gagfresh"};
private static string[] gagLink = { "https://9gag.com/hot", "https://9gag.com/trending", "https://9gag.com/fresh" };
private static string[] photosPaths;
private static string photoToDelete;
public static string answer(int Index)
{
//tries to download html 9gag source
Expand Down Expand Up @@ -60,16 +61,16 @@ public static string answer(int Index)
gagUrl.DownloadFile(new Uri(gagPostSource), ImgPatha);

}
//saving paths of every photo downloaded
photoToDelete = ImgPatha;

photosPaths[photosPaths.Length] = ImgPatha;

Console.Write(ImgPatha);

return ImgPatha;
}
public static void clickDreaptaDelete(string path)
public static void clickDreaptaDelete()
{ //delete photos from cache
File.Delete(path);
Console.Write(photoToDelete);
File.Delete(photoToDelete);

}
}
}
Loading

0 comments on commit ba7226a

Please sign in to comment.