Advertisement
agentsix1

discord chat bot channel specific chat

Jul 27th, 2017
40,404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.26 KB | None | 0 0
  1. Public Sub onMessageRec(sender As Object, e As Discord.MessageEventArgs) Handles discord.MessageReceived
  2.         Dim message = e.Message.RawText
  3.         Dim username = e.User.Name
  4.         Dim channel = e.Channel.Name
  5.  
  6.  
  7.         If CheckBox2.CheckState = CheckState.Checked Then
  8.             addLine("<font color=grey><</font><font color=green>#" & channel & "</font><font color=grey>> <</font><font color=purple>" & username & "</font><font color=grey>></font> <font color=white>" & message & "</font><br>")
  9.         ElseIf System.IO.File.ReadAllText(Application.StartupPath & "\channel.dat").Equals(channel) Then
  10.             addLine("<font color=grey><</font><font color=green>#" & channel & "</font><font color=grey>> <</font><font color=purple>" & username & "</font><font color=grey>></font> <font color=white>" & message & "</font><br>")
  11.         End If
  12.  
  13.     End Sub
  14.  
  15.     Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
  16.         System.IO.File.WriteAllText(Application.StartupPath & "\channel.dat", ComboBox1.Text)
  17.  
  18.     End Sub
  19.  
  20.  
  21. ------------------------------------------
  22.  
  23. timer 2 always enabled true
  24. timer 2 delay 100ms
  25.  
  26. Remember the chat will not load when you go to join the channel again. How ever you can if you really felt like it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement