public static void DeleteMessage(string chnid, string msgid) { try { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); channelservice.DeleteMessage(chnid, msgid).Wait(); } catch (Exception exception) { //App.NavigateToBugReport(exception); } }
public static async Task TriggerTypingIndicator(string channelId) { try { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); await channelservice.TriggerTypingIndicator(channelId); } catch (Exception exception) { App.NavigateToBugReport(exception); } }
public static void ModifyGuildChannel(string chnId, ModifyChannel newChn) { try { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); channelservice.ModifyChannel(chnId, newChn).Wait(); } catch (Exception exception) { App.NavigateToBugReport(exception); } }
public static async Task <Message> GetMessage(string chnid, string msgid) { try { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); return(await channelservice.GetChannelMessage(chnid, msgid)); } catch (Exception exception) { App.NavigateToBugReport(exception); } return(new SharedModels.Message()); }
public static async Task <IEnumerable <SharedModels.Message> > GetChannelPinnedMessages(string id) { try { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); return(await channelservice.GetPinnedMessages(id)); } catch (Exception exception) { App.NavigateToBugReport(exception); } return(null); }
public static async Task CreateMessage(string id, string text) { try { MessageUpsert message = new MessageUpsert(); message.Content = text; IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); await channelservice.CreateMessage(id, message); } catch (Exception exception) { App.NavigateToBugReport(exception); } }
public static async Task DeleteReactionAsync(string channelid, string messageid, string emoji) { try { await Task.Run(() => { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); channelservice.DeleteReaction(channelid, messageid, emoji).Wait(); }); } catch (Exception exception) { App.NavigateToBugReport(exception); } }
public static async Task AckMessage(string chnId, string msgId) { try { await Task.Run(async() => { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); await channelservice.AckMessage(chnId, msgId); }); } catch (Exception exception) { App.NavigateToBugReport(exception); } }
public static async Task <IEnumerable <Invite> > GetChannelInvites(string channelId) { try { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); var ch = await channelservice.GetChannelInvites(channelId); return(ch); } catch (Exception exception) { App.NavigateToBugReport(exception); } return(null); }
public static SharedModels.GuildChannel GetGuildChannel(string id) { try { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); Task <SharedModels.GuildChannel> channelTask = channelservice.GetGuildChannel(id); channelTask.Wait(); return(channelTask.Result); } catch (Exception exception) { App.NavigateToBugReport(exception); } return(new SharedModels.GuildChannel()); }
public static async void EditMessageAsync(string chnid, string msgid, string content) { try { await Task.Run(() => { EditMessage editmessage = new EditMessage(); editmessage.Content = content; IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); channelservice.EditMessage(chnid, msgid, editmessage); }); } catch (Exception exception) { App.NavigateToBugReport(exception); } }
private Task <bool> Login() { Messenger.Default.Send(new ConnectionStatusMessage(ConnectionStatus.Connecting)); IAuthenticator authenticator = new DiscordAuthenticator(_accessToken); AuthenticatedRestFactory authenticatedRestFactory = new AuthenticatedRestFactory(new DiscordApiConfiguration() { BaseUrl = "https://discordapp.com/api" }, authenticator); ActivitesService = authenticatedRestFactory.GetActivitesService(); ChannelService = authenticatedRestFactory.GetChannelService(); ConnectionsService = authenticatedRestFactory.GetConnectionService(); GameService = authenticatedRestFactory.GetGameService(); GuildService = authenticatedRestFactory.GetGuildService(); InviteService = authenticatedRestFactory.GetInviteService(); MiscService = authenticatedRestFactory.GetMiscService(); UserService = authenticatedRestFactory.GetUserService(); VoiceService = authenticatedRestFactory.GetVoiceService(); return(_gatewayService.InitializeGateway(_accessToken)); }
public static async Task <Invite> CreateInvite(string chnId, CreateInvite invite) { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); return(await channelservice.CreateChannelInvite(chnId, invite)); }
public static void UnpinMessage(string chnId, string msgId) { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); channelservice.DeletePinnedChannelMessage(chnId, msgId); }
public static async Task <IEnumerable <SharedModels.Message> > GetChannelMessagesBefore(string id, string msgpos) { IChannelService channelservice = AuthenticatedRestFactory.GetChannelService(); return(await channelservice.GetChannelMessagesBefore(id, msgpos)); }